Skip to content

Commit

Permalink
Fix issues in wai-aria-tools/make_tests.pl and regenerate tests (web-…
Browse files Browse the repository at this point in the history
…platform-tests#7476)

* wai-aria/tools: Remove obsolete code from make_tests.pl

The code block intended to "massage the data to make it more sensible"
is no longer needed. It was only being applied to ATK and was a means
to work around some test-author errors. The correct solution is to fix
the assertions prior to generating the test files. Furthermore, removing
this code and regenerating the tests is resulting in no changes to the
test files.

* wai-aria/tools: Don't include empty assertions in test steps

When empty assertions appear in a test step, it can result in a FAIL
("No results reported from ATTA; expected true got false"). When a
particular platform has no assertions associated with a particular
step, the result should be NOTRUN. Removing the empty assertions fixes
the erroneous FAILs.

* Core-AAM: Regenerate tests after fixing the empty-assertion bug in make_tests.pl

* WAI-ARIA: Regenerate tests after fixing the empty-assertion bug in make_tests.pl
  • Loading branch information
joanmarie authored and halindrome committed Sep 25, 2017
1 parent fbfb057 commit d2c1a19
Show file tree
Hide file tree
Showing 33 changed files with 18 additions and 117 deletions.
1 change: 0 additions & 1 deletion core-aam/aria-atomic_true-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"[test]"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"property",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-colcount_new-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
{
"element" : "cell",
"test" : {
"AXAPI" : [],
"IAccessible2" : [
[
"result",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-controls-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"[test]"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"relation",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-describedby-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"[test]"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"relation",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-disabled_true-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
{
"element" : "checkbox",
"test" : {
"AXAPI" : [],
"MSAA" : [
[
"property",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-errormessage-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"[test]"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"relation",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-flowto-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"[test]"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"relation",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-labelledby-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"[test]"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"relation",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-live_assertive-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"container-live:assertive"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"property",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-live_off-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"container-live:off"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"property",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-live_polite-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"container-live:polite"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"property",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-modal_false_new-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
{
"element" : "group",
"test" : {
"ATK" : [],
"AXAPI" : [
[
"property",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-modal_true_new-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
{
"element" : "group",
"test" : {
"ATK" : [],
"AXAPI" : [
[
"property",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"[test]"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"relation",
Expand Down
3 changes: 1 addition & 2 deletions core-aam/aria-readonly_true_on_radiogroup-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
"doesNotContain",
"STATE_CHECKABLE"
]
],
"AXAPI" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-relevant-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"container-relevant:additions"
]
],
"AXAPI" : [],
"IAccessible2" : [
[
"property",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-rowcount_new-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
{
"element" : "row",
"test" : {
"AXAPI" : [],
"IAccessible2" : [
[
"result",
Expand Down
1 change: 0 additions & 1 deletion core-aam/aria-rowindex_new-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
{
"element" : "row",
"test" : {
"AXAPI" : [],
"IAccessible2" : [
[
"result",
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/alertdialog_modal_false-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@
"is",
"true"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/alertdialog_modal_true-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@
"is",
"false"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
"contains",
"IA2_RELATION_DETAILS_FOR"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/aria-details_pointing_to_div_element-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
"contains",
"IA2_RELATION_DETAILS_FOR"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/combobox_controls_an_invalid_id-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
"doesNotContain",
"IA2_RELATION_CONTROLLED_BY"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/dialog_modal_false-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@
"is",
"true"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/dialog_modal_true-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@
"is",
"false"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/dialog_modal_unspecified-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@
"is",
"true"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/errormessage_object_in_invalid_state-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
"contains",
"IA2_RELATION_ERROR_FOR"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/errormessage_object_in_valid_state-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
"doesNotContain",
"IA2_RELATION_ERROR_FOR"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
6 changes: 2 additions & 4 deletions wai-aria/option_selected_value_changes-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@
"is",
"AXSelectedChildrenChanged"
]
],
"UIA" : []
]
},
"title" : "step 5",
"type" : "test"
Expand All @@ -118,8 +117,7 @@
"is",
"0"
]
],
"AXAPI" : []
]
},
"title" : "step 6",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/row_colindex_4-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@
"is",
"4"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
3 changes: 1 addition & 2 deletions wai-aria/row_rowindex_4-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@
"is",
"4"
]
],
"UIA" : []
]
},
"title" : "step 2",
"type" : "test"
Expand Down
67 changes: 1 addition & 66 deletions wai-aria/tools/make_tests.pl
Original file line number Diff line number Diff line change
Expand Up @@ -421,76 +421,11 @@ ()
$tests->{"WAIFAKE"} = [ [ "property", "role", "is", "ROLE_TABLE_CELL" ], [ "property", "interfaces", "contains", "TableCell" ] ];
}
foreach my $name (@apiNames) {
if (exists $asserts->{$name}) {
if (exists $asserts->{$name} && scalar(@{$asserts->{$name}})) {
$tests->{$name} = $asserts->{$name};
}
};


# massage the data to make it more sensible
if (exists $tests->{"ATK"}) {
# # print "processing ATK for $title\n";
my @conditions = @{$tests->{"ATK"}};
for (my $i = 0; $i < scalar(@conditions); $i++) {
my @new = ();
my $start = 0;
my $assert = "true";
if ($conditions[$i]->[0] =~ m/^NOT/) {
$start = 1;
$assert = "false";
}

# print qq(Looking at $title $conditions[$i]->[$start]\n);
if ($conditions[$i]->[$start] =~ m/^ROLE_/) {
$new[0] = "role";
$new[1] = $conditions[$i]->[$start];
$new[2] = $assert;
} elsif ($conditions[$i]->[$start] =~ m/(.*) interface/i) {
$new[0] = "interface";
$new[1] = $1;
# print "$1 condition is " . $conditions[$i]->[1] . "\n";
if ($conditions[$i]->[1] ne '<shown>'
&& $conditions[$i]->[1] !~ m/true/i ) {
$assert = "false";
}
$new[2] = $assert;
} elsif ($conditions[$i]->[$start] eq "object" || $conditions[$i]->[$start] eq "attribute" ) {
$new[0] = "attribute";
my $val = $conditions[$i]->[2];
$val =~ s/"//g;
$new[1] = $conditions[$i]->[1] . ":" . $val;
if ($conditions[$i]->[3] eq "not exposed"
|| $conditions[$i]->[3] eq "false") {
$new[2] = "false";
} else {
$new[2] = "true";
}
} elsif ($conditions[$i]->[$start] =~ m/^STATE_/) {
$new[0] = "state";
$new[1] = $conditions[$i]->[$start];
$new[2] = $assert;
} elsif ($conditions[$i]->[$start] =~ m/^object attribute (.*)/) {
my $name = $1;
$new[0] = "attribute";
my $val = $conditions[$i]->[1];
$val =~ s/"//g;
if ($val eq "not exposed" || $val eq "not mapped") {
$new[1] = $name;
$new[2] = "false";
} else {
$new[1] = $name . ":" . $val;
$new[2] = "true";
}
} else {
@new = @{$conditions[$i]};
if ($conditions[$i]->[2] eq '<shown>') {
$new[2] = "true";
}
}
$conditions[$i] = \@new;
}
$tests->{"ATK"} = \@conditions;
}
$step->{test} = $tests;

} elsif ($asserts->{type} eq "attribute") {
Expand Down
6 changes: 2 additions & 4 deletions wai-aria/treeitem_selected_value_changes-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@
"is",
"AXSelectedChildrenChanged"
]
],
"UIA" : []
]
},
"title" : "step 5",
"type" : "test"
Expand All @@ -118,8 +117,7 @@
"is",
"0"
]
],
"AXAPI" : []
]
},
"title" : "step 6",
"type" : "test"
Expand Down

0 comments on commit d2c1a19

Please sign in to comment.