From 89cadf04a44fea0f526ad37e459377c351f7602b Mon Sep 17 00:00:00 2001
From: Valerie Young
Date: Thu, 15 Aug 2024 16:38:20 -0700
Subject: [PATCH 1/5] First draft: tests using JSONs from manual test
---
.../json-test-example/aria-autocomplete.html | 45 ++++
.../json-test-example/aria-braillelabel.html | 28 +++
.../json-test-example/aria-errormessage.html | 30 +++
core-aam/json-test-example/blockquote.html | 23 ++
...es_for_aria-pressed_and_aria-haspopup.html | 55 +++++
...n_with_defined_value_for_aria-pressed.html | 32 +++
...ith_non_false_value_for_aria-haspopup.html | 62 ++++++
.../json-test-example/scripts/aam-utils.js | 107 +++++++++
.../json-test-example/scripts/attr-map.js | 114 ++++++++++
.../json-test-example/scripts/role-map.js | 186 ++++++++++++++++
resources/testdriver.js | 20 ++
.../wptrunner/wptrunner/executors/actions.py | 17 +-
.../wptrunner/executors/executoratspi.py | 209 +++++++++++++++---
.../executorplatformaccessibility.py | 18 ++
tools/wptrunner/wptrunner/testdriver-extra.js | 5 +
15 files changed, 924 insertions(+), 27 deletions(-)
create mode 100644 core-aam/json-test-example/aria-autocomplete.html
create mode 100644 core-aam/json-test-example/aria-braillelabel.html
create mode 100644 core-aam/json-test-example/aria-errormessage.html
create mode 100644 core-aam/json-test-example/blockquote.html
create mode 100644 core-aam/json-test-example/button_with_default_values_for_aria-pressed_and_aria-haspopup.html
create mode 100644 core-aam/json-test-example/button_with_defined_value_for_aria-pressed.html
create mode 100644 core-aam/json-test-example/button_with_non_false_value_for_aria-haspopup.html
create mode 100644 core-aam/json-test-example/scripts/aam-utils.js
create mode 100644 core-aam/json-test-example/scripts/attr-map.js
create mode 100644 core-aam/json-test-example/scripts/role-map.js
diff --git a/core-aam/json-test-example/aria-autocomplete.html b/core-aam/json-test-example/aria-autocomplete.html
new file mode 100644
index 00000000000000..86ec0a8ff2e6b8
--- /dev/null
+++ b/core-aam/json-test-example/aria-autocomplete.html
@@ -0,0 +1,45 @@
+
+
+
+
+ aria-braillelabel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core-aam/json-test-example/aria-braillelabel.html b/core-aam/json-test-example/aria-braillelabel.html
new file mode 100644
index 00000000000000..53621b04d1bb6d
--- /dev/null
+++ b/core-aam/json-test-example/aria-braillelabel.html
@@ -0,0 +1,28 @@
+
+
+
+
+ aria-braillelabel
+
+
+
+
+
+
+
+
+
+
+
@@ -21,41 +20,89 @@
click me
diff --git a/core-aam/acacia/test-statements/scripts/aam-utils.js b/core-aam/acacia/test-statements/scripts/aam-utils.js
index d7aa33f2261580..3bc0008b23bd20 100644
--- a/core-aam/acacia/test-statements/scripts/aam-utils.js
+++ b/core-aam/acacia/test-statements/scripts/aam-utils.js
@@ -30,7 +30,7 @@ const AAMUtils = {
name: name of the test
*/
- verifyAPI: function(id, map, test_name) {
+ verifyAPI: function(test_name, id, map) {
if (!map) {
throw "Error: missing accessibility API test map";
}
@@ -46,75 +46,6 @@ const AAMUtils = {
this.runAssertions(map[api], results);
- }, `api: ${api}, ${test_name}`);
- }
- }
- },
-
- /*
- Creates a subtest for each API. Runs no asserts for APIs not found.
-
- id: id of element to test the accessibility node of
- value: value of the attribute being tested
- map: entry in attr-map.js, or similar, with the string ""
- to be replaced by the value argument
- test_name: name of the test
- */
-
- verifyAttrAPI: function(id, value, map, test_name) {
- if (!map) {
- throw "Error: missing accessibility API test map";
- }
-
- let new_map = JSON.parse(
- JSON.stringify(map).replaceAll("", value)
- );
-
- for (const api of this.APIS) {
- if (new_map[api]) {
- promise_test(async t => {
- let results = await test_driver.test_accessibility_api(
- id,
- new_map,
- api
- );
-
- this.runAssertions(new_map[api], results);
-
- }, `api: ${api}, ${test_name}`);
- }
- }
- },
-
- /*
- Creates a subtest for each API. Runs no asserts for APIs not found.
-
- id: id of element to test the accessibility node of
- relations: list of ids of "related" elements
- map: entry in attr-map.js, or similar
- test_name: name of the test
- */
-
- verifyRelationAPI: function(id, relations, map, test_name) {
- if (!map) {
- throw "Error: missing accessibility API test map";
- }
-
- let new_map = JSON.parse(
- JSON.stringify(map).replaceAll("\"\"", JSON.stringify(relations))
- );
-
- for (const api of this.APIS) {
- if (new_map[api]) {
- promise_test(async t => {
- let results = await test_driver.test_accessibility_api(
- id,
- new_map,
- api
- );
-
- this.runAssertions(new_map[api], results);
-
}, `api: ${api}, ${test_name}`);
}
}
diff --git a/core-aam/acacia/test-statements/scripts/attr-map.js b/core-aam/acacia/test-statements/scripts/attr-map.js
deleted file mode 100644
index ecb96f8857bcf4..00000000000000
--- a/core-aam/acacia/test-statements/scripts/attr-map.js
+++ /dev/null
@@ -1,114 +0,0 @@
-attrmap = {
- "aria-autocomplete": {
- "Atspi" : [
- [
- "property",
- "objectAttributes",
- "contains",
- "autocomplete:"
- ],
- [
- "property",
- "states",
- "contains",
- "STATE_SUPPORTS_AUTOCOMPLETION"
- ]
- ],
- "IAccessible2" : [
- [
- "property",
- "objectAttributes",
- "contains",
- "autocomplete:"
- ],
- [
- "property",
- "states",
- "contains",
- "IA2_STATE_SUPPORTS_AUTOCOMPLETION"
- ]
- ]
- },
- "aria-braillelabel": {
- "Atspi" : [
- [
- "property",
- "objectAttributes",
- "contains",
- "braillelabel:"
- ]
- ],
- "AXAPI" : [
- [
- "property",
- "AXBrailleLabel",
- "is",
- ""
- ]
- ],
- "IAccessible2" : [
- [
- "property",
- "objectAttributes",
- "contains",
- "braillelabel:"
- ]
- ],
- "UIA" : [
- [
- "property",
- "AriaProperties.braillelabel",
- "is",
- ""
- ]
- ]
- },
- "aria-errormessage": {
- "Atspi" : [
- [
- "relation",
- "RELATION_ERROR_MESSAGE",
- "is",
- ""
- ],
- [
- "reverseRelation",
- "RELATION_ERROR_FOR",
- "is",
- ""
- ]
-
- ],
- "AXAPI" : [
- [
- "property",
- "AXErrorMessageElements",
- "is",
- ""
- ]
- ],
- "IAccessible2" : [
- [
- "relation",
- "IA2_RELATION_ERROR",
- "is",
- ""
- ],
- [
- "reverseRelation",
- "IA2_RELATION_ERROR_FOR",
- "is",
- ""
- ]
-
- ],
- "UIA" : [
- [
- "property",
- "ControllerFor",
- "is",
- ""
- ]
- ]
- }
-}
diff --git a/core-aam/acacia/test-statements/scripts/role-map.js b/core-aam/acacia/test-statements/scripts/role-map.js
deleted file mode 100644
index 31808ffc02c0c6..00000000000000
--- a/core-aam/acacia/test-statements/scripts/role-map.js
+++ /dev/null
@@ -1,186 +0,0 @@
-rolemap = {
- "blockquote" : {
- "Atspi" : [
- [
- "property",
- "role",
- "is",
- "block quote"
- ]
- ],
- "AXAPI" : [
- [
- "property",
- "AXRole",
- "is",
- "AXGroup"
- ],
- [
- "property",
- "AXSubrole",
- "is",
- ""
- ]
- ],
- "IAccessible2" : [
- [
- "property",
- "role",
- "is",
- "IA2_ROLE_BLOCK_QUOTE"
- ],
- [
- "property",
- "msaaRole",
- "is",
- "ROLE_SYSTEM_GROUPING"
- ]
- ],
- "UIA" : [
- [
- "property",
- "ControlType",
- "is",
- "Group"
- ],
- [
- "property",
- "LocalizedControlType",
- "is",
- "blockquote"
- ]
- ]
- },
- "button_with_default_values_for_aria-pressed_and_aria-haspopup": {
- "Atspi" : [
- [
- "property",
- "role",
- "is",
- "push button"
- ]
- ],
- "AXAPI" : [
- [
- "property",
- "AXRole",
- "is",
- "AXButton"
- ],
- [
- "property",
- "AXSubrole",
- "is",
- ""
- ]
- ],
- "IAccessible2" : [
- [
- "property",
- "msaaRole",
- "is",
- "ROLE_SYSTEM_PUSHBUTTON"
- ]
- ],
- "UIA" : [
- [
- "property",
- "ControlType",
- "is",
- "Button"
- ]
- ]
- },
- "button_with_non_false_value_for_aria-haspopup" : {
- "Atspi" : [
- [
- "property",
- "role",
- "is",
- "push button"
- ]
- ],
- "AXAPI" : [
- [
- "property",
- "AXRole",
- "is",
- "AXPopUpButton"
- ],
- [
- "property",
- "AXSubrole",
- "is",
- ""
- ],
- [
- "property",
- "actions",
- "contains",
- "AXShowMenu"
- ]
- ],
- "IAccessible2" : [
- [
- "property",
- "msaaRole",
- "is",
- "ROLE_SYSTEM_PUSHBUTTON"
- ]
- ],
- "UIA" : [
- [
- "property",
- "ControlType",
- "is",
- "Button"
- ]
- ]
- },
- "button_with_defined_value_for_aria-pressed": {
- "Atspi" : [
- [
- "property",
- "role",
- "is",
- "toggle button"
- ]
- ],
- "AXAPI" : [
- [
- "property",
- "AXRole",
- "is",
- "AXCheckBox"
- ],
- [
- "property",
- "AXSubrole",
- "is",
- "AXToggle"
- ]
- ],
- "IAccessible2" : [
- [
- "property",
- "role",
- "is",
- "IA2_ROLE_TOGGLE_BUTTON"
- ],
- [
- "property",
- "msaaRole",
- "is",
- "ROLE_SYSTEM_PUSHBUTTON"
- ]
- ],
- "UIA" : [
- [
- "property",
- "ControlType",
- "is",
- "Button"
- ]
- ]
- }
-}
From cffec5d125e508c8902fad94cc072ee76aaa0ab7 Mon Sep 17 00:00:00 2001
From: Valerie Young
Date: Wed, 27 Nov 2024 15:16:27 -0800
Subject: [PATCH 5/5] f
---
core-aam/acacia/property-bag/button.html | 2 +-
..._with_default_values_for_aria-pressed_and_aria-haspopup.html | 2 +-
.../button_with_non_false_value_for_aria-haspopup.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/core-aam/acacia/property-bag/button.html b/core-aam/acacia/property-bag/button.html
index 5dc231526f14c8..a1e42a5f12c9b3 100644
--- a/core-aam/acacia/property-bag/button.html
+++ b/core-aam/acacia/property-bag/button.html
@@ -15,7 +15,7 @@
const node = await test_driver.get_accessibility_api_node('test');
if (node.API == 'atspi') {
- assert_equals(node.role, 'push button', 'Atspi role');
+ assert_equals(node.role, 'button', 'Atspi role');
}
else if (node.API == 'axapi') {
assert_equals(node.role, 'AXButton', 'AX API role');
diff --git a/core-aam/acacia/test-statements/button_with_default_values_for_aria-pressed_and_aria-haspopup.html b/core-aam/acacia/test-statements/button_with_default_values_for_aria-pressed_and_aria-haspopup.html
index 675aab4ddd1dbb..b3f0ac91c0289a 100644
--- a/core-aam/acacia/test-statements/button_with_default_values_for_aria-pressed_and_aria-haspopup.html
+++ b/core-aam/acacia/test-statements/button_with_default_values_for_aria-pressed_and_aria-haspopup.html
@@ -25,7 +25,7 @@
"property",
"role",
"is",
- "push button"
+ "button"
]
],
"AXAPI" : [
diff --git a/core-aam/acacia/test-statements/button_with_non_false_value_for_aria-haspopup.html b/core-aam/acacia/test-statements/button_with_non_false_value_for_aria-haspopup.html
index 6eb9a8f23714a3..a6e5126352ea8c 100644
--- a/core-aam/acacia/test-statements/button_with_non_false_value_for_aria-haspopup.html
+++ b/core-aam/acacia/test-statements/button_with_non_false_value_for_aria-haspopup.html
@@ -26,7 +26,7 @@
"property",
"role",
"is",
- "push button"
+ "button"
]
],
"AXAPI" : [