Diff
Modified: trunk/LayoutTests/ChangeLog (286793 => 286794)
--- trunk/LayoutTests/ChangeLog 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/ChangeLog 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,3 +1,38 @@
+2021-12-09 Tyler Wilcock <[email protected]>
+
+ AX: Make 6 more layout tests async so they pass in isolated tree mode
+ https://bugs.webkit.org/show_bug.cgi?id=233966
+
+ Reviewed by Chris Fleizach.
+
+ * accessibility/element-haspopup-expected.txt:
+ * accessibility/element-haspopup.html:
+ Use accessibilityController.accessibleElementById to get a reference
+ to the link1 and link2 AX objects instead of document.getElementById()
+ and accessibilityController.focusedElement. The latter would work, but
+ would require the test to be made unnecessarily async.
+
+ * accessibility/mac/label-element-changing-children-string-value-expected.txt:
+ * accessibility/mac/label-element-changing-children-string-value.html:
+ * accessibility/mac/label-element-changing-textcontent-string-value-expected.txt:
+ * accessibility/mac/label-element-changing-textcontent-string-value.html:
+ * accessibility/mac/update-children-when-aria-role-changes-expected.txt:
+ * accessibility/mac/update-children-when-aria-role-changes.html:
+ * accessibility/tabindex-removed-expected.txt:
+ * accessibility/tabindex-removed.html:
+ Make these tests async. They dynamically change page content with JS,
+ so they must verify expectations asynchronously to pass in isolated
+ tree mode.
+
+ * accessibility/auto-fill-crash.html:
+ Make this test async.
+ * accessibility/auto-fill-crash-expected.txt:
+ * platform/glib/accessibility/auto-fill-crash-expected.txt:
+ Update expectations to reflect the test rewrite.
+ * platform/win/accessibility/auto-fill-crash-expected.txt:
+ Removed because the expectation is the same as the base
+ auto-fill-crash-expected.txt
+
2021-12-09 Robert Jenner <[email protected]>
[ iOS EWS ] 2X media/track (layout-tests) are a constant image failure
Modified: trunk/LayoutTests/accessibility/auto-fill-crash-expected.txt (286793 => 286794)
--- trunk/LayoutTests/accessibility/auto-fill-crash-expected.txt 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/auto-fill-crash-expected.txt 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,12 +1,11 @@
-
This tests that when an auto fill element is removed we won't crash accessing an old value.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS textFieldAxObject.childrenCount is 2
-PASS textFieldAxObject.childAtIndex(childrenCountExpected - 1).description is 'AXDescription: contact info AutoFill'
-PASS textFieldAxObject.childrenCount is 1
+PASS axTextField.childrenCount === 2
+PASS axTextField.childAtIndex(expectedChildrenCount - 1).description === 'AXDescription: contact info AutoFill'
+PASS axTextField.childrenCount === 1
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/accessibility/auto-fill-crash.html (286793 => 286794)
--- trunk/LayoutTests/accessibility/auto-fill-crash.html 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/auto-fill-crash.html 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,44 +1,38 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
-<meta charset="utf-8">
-<script src=""
+<script src=""
+<script src=""
</head>
-<body id="body">
+<body>
<input type="text" value="hello" id="textfield">
-<p id="description"></p>
-<div id="console"></div>
-
<script>
-
description("This tests that when an auto fill element is removed we won't crash accessing an old value.");
if (window.accessibilityController) {
+ window.jsTestIsAsync = true;
+
+ var platformName = accessibilityController.platformName;
var axTextField = accessibilityController.accessibleElementById("textfield");
- var childrenCountExpected = accessibilityController.platformName == "atk" ? "1" : "2";
- window.internals.setShowAutoFillButton(document.getElementById("textfield"), "Contacts");
- var textFieldAxObject = accessibilityController.accessibleElementById('textfield');
- shouldBe("textFieldAxObject.childrenCount", childrenCountExpected);
- // Verify the autofill button is represented in the accessibility tree.
- shouldBe("textFieldAxObject.childAtIndex(childrenCountExpected - 1).description", "'AXDescription: contact info AutoFill'");
+ var domTextField = document.getElementById("textfield");
- var platform = accessibilityController.platformName;
- // Windows expects 2 children.
- childrenCountExpected = "2";
- if (platform == "mac" || platform == "ios")
- childrenCountExpected = "1"
- else if (platform == "atk")
- childrenCountExpected = "0"
+ window.internals.setShowAutoFillButton(domTextField, "Contacts");
+ var expectedChildrenCount = platformName == "atk" ? "1" : "2";
+ setTimeout(async function() {
+ await expectAsyncExpression("axTextField.childrenCount", expectedChildrenCount);
+ // Verify the autofill button is represented in the accessibility tree.
+ await expectAsyncExpression("axTextField.childAtIndex(expectedChildrenCount - 1).description", "'AXDescription: contact info AutoFill'");
- // Don't crash!
- window.internals.setShowAutoFillButton(document.getElementById("textfield"), "None");
- shouldBe("textFieldAxObject.childrenCount", childrenCountExpected);
+ // Don't crash!
+ window.internals.setShowAutoFillButton(domTextField, "None");
+ await expectAsyncExpression("axTextField.childrenCount", platformName == "atk" ? "0" : "1");
+
+ finishJSTest();
+ }, 0);
}
-
</script>
-
-<script src=""
</body>
</html>
+
Modified: trunk/LayoutTests/accessibility/element-haspopup-expected.txt (286793 => 286794)
--- trunk/LayoutTests/accessibility/element-haspopup-expected.txt 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/element-haspopup-expected.txt 2021-12-09 20:02:20 UTC (rev 286794)
@@ -10,11 +10,11 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS accessibilityController.focusedElement.hasPopup is true
-PASS accessibilityController.focusedElement.hasPopup is false
-PASS p1.hasPopup is true
-PASS p2.hasPopup is false
-PASS p3.hasPopup is false
+PASS accessibilityController.accessibleElementById('link1').hasPopup is true
+PASS accessibilityController.accessibleElementById('link2').hasPopup is false
+PASS accessibilityController.accessibleElementById('paragraph1').hasPopup is true
+PASS accessibilityController.accessibleElementById('paragraph2').hasPopup is false
+PASS accessibilityController.accessibleElementById('paragraph3').hasPopup is false
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/accessibility/element-haspopup.html (286793 => 286794)
--- trunk/LayoutTests/accessibility/element-haspopup.html 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/element-haspopup.html 2021-12-09 20:02:20 UTC (rev 286794)
@@ -27,20 +27,12 @@
description("This tests that an element will report that it has a popup correctly.");
if (window.accessibilityController) {
- document.getElementById("link1").focus();
- shouldBe("accessibilityController.focusedElement.hasPopup", "true");
+ shouldBe("accessibilityController.accessibleElementById('link1').hasPopup", "true");
+ shouldBe("accessibilityController.accessibleElementById('link2').hasPopup", "false");
- document.getElementById("link2").focus();
- shouldBe("accessibilityController.focusedElement.hasPopup", "false");
-
- var p1 = accessibilityController.accessibleElementById("paragraph1");
- shouldBe("p1.hasPopup", "true");
-
- var p2 = accessibilityController.accessibleElementById("paragraph2");
- shouldBe("p2.hasPopup", "false");
-
- var p3 = accessibilityController.accessibleElementById("paragraph3");
- shouldBe("p3.hasPopup", "false");
+ shouldBe("accessibilityController.accessibleElementById('paragraph1').hasPopup", "true");
+ shouldBe("accessibilityController.accessibleElementById('paragraph2').hasPopup", "false");
+ shouldBe("accessibilityController.accessibleElementById('paragraph3').hasPopup", "false");
}
</script>
Modified: trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt (286793 => 286794)
--- trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,4 +1,3 @@
- firstfoo choice
This tests that if a label element's children change, the string value updates
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -6,8 +5,8 @@
PASS label.role is 'AXRole: AXStaticText'
PASS initialStringValue is 'AXValue: first choice'
-PASS mutatedStringValue is 'AXValue: first foo choice'
+PASS label.stringValue === 'AXValue: first foo choice'
PASS successfullyParsed is true
TEST COMPLETE
-
+ firstfoo choice
Modified: trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value.html (286793 => 286794)
--- trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value.html 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value.html 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
-<script src=""
+<script src=""
+<script src=""
</head>
-<body id="body">
+<body>
<input type="radio" id="input" />
<label for="" id="label">
@@ -11,39 +12,32 @@
<span>choice</span>
</label>
-<p id="description"></p>
-<div id="console"></div>
-
<script>
+ description("This tests that if a label element's children change, the string value updates");
- var label = 0;
- var initialStringValue = 0;
- var mutatedStringValue = 0;
-
- description("This tests that if a label element's children change, the string value updates");
+ var label, initialStringValue;
if (window.accessibilityController) {
+ window.jsTestIsAsync = true;
- if (window.accessibilityController) {
+ label = accessibilityController.accessibleElementById("label");
+ initialStringValue = label.stringValue;
+ let first = document.getElementById("first")
+ let span = document.createElement("span");
+ let textNode = document.createTextNode("foo");
+ span.appendChild(textNode);
+ first.appendChild(textNode);
- var body = document.getElementById("body");
- body.focus();
-
- label = accessibilityController.accessibleElementById("label");
- initialStringValue = label.stringValue;
- var first = document.getElementById("first")
- var element = document.createElement("span");
- var foo = document.createTextNode("foo");
- element.appendChild(foo);
- first.appendChild(foo);
- mutatedStringValue = label.stringValue;
+ shouldBe("label.role", "'AXRole: AXStaticText'");
+ shouldBe("initialStringValue", "'AXValue: first choice'");
- shouldBe("label.role", "'AXRole: AXStaticText'");
- shouldBe("initialStringValue", "'AXValue: first choice'");
- shouldBe("mutatedStringValue", "'AXValue: first foo choice'");
- }
+ setTimeout(async function() {
+ await expectAsyncExpression("label.stringValue", "'AXValue: first foo choice'");
+ finishJSTest();
+ }, 0);
}
</script>
-
-<script src=""
</body>
</html>
+
+
+
Modified: trunk/LayoutTests/accessibility/mac/label-element-changing-textcontent-string-value-expected.txt (286793 => 286794)
--- trunk/LayoutTests/accessibility/mac/label-element-changing-textcontent-string-value-expected.txt 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/mac/label-element-changing-textcontent-string-value-expected.txt 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,4 +1,3 @@
- second choice
This tests that if a label element's children's textContent changes, the string value updates
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -6,8 +5,8 @@
PASS label.role is 'AXRole: AXStaticText'
PASS initialStringValue is 'AXValue: first choice'
-PASS mutatedStringValue is 'AXValue: second choice'
+PASS label.stringValue === 'AXValue: second choice'
PASS successfullyParsed is true
TEST COMPLETE
-
+ second choice
Modified: trunk/LayoutTests/accessibility/mac/label-element-changing-textcontent-string-value.html (286793 => 286794)
--- trunk/LayoutTests/accessibility/mac/label-element-changing-textcontent-string-value.html 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/mac/label-element-changing-textcontent-string-value.html 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,9 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
-<script src=""
+<script src=""
+<script src=""
</head>
-<body id="body">
+<body>
<input type="radio" id="input" />
<label for="" id="label">
@@ -11,36 +12,25 @@
<span>choice</span>
</label>
-<p id="description"></p>
-<div id="console"></div>
-
<script>
+ description("This tests that if a label element's children's textContent changes, the string value updates");
- var label = 0;
- var initialStringValue = 0;
- var mutatedStringValue = 0;
-
- description("This tests that if a label element's children's textContent changes, the string value updates");
+ var label, initialStringValue;
if (window.accessibilityController) {
+ window.jsTestIsAsync = true;
- if (window.accessibilityController) {
+ label = accessibilityController.accessibleElementById("label");
+ initialStringValue = label.stringValue;
+ shouldBe("label.role", "'AXRole: AXStaticText'");
+ shouldBe("initialStringValue", "'AXValue: first choice'");
- var body = document.getElementById("body");
- body.focus();
-
- label = accessibilityController.accessibleElementById("label");
- initialStringValue = label.stringValue;
- var first = document.getElementById("first")
- first.textContent = "second";
- mutatedStringValue = label.stringValue;
-
- shouldBe("label.role", "'AXRole: AXStaticText'");
- shouldBe("initialStringValue", "'AXValue: first choice'");
- shouldBe("mutatedStringValue", "'AXValue: second choice'");
- }
+ document.getElementById("first").textContent = "second";
+ setTimeout(async function() {
+ await expectAsyncExpression("label.stringValue", "'AXValue: second choice'")
+ finishJSTest();
+ }, 0);
}
</script>
-
-<script src=""
</body>
</html>
+
Modified: trunk/LayoutTests/accessibility/mac/update-children-when-aria-role-changes-expected.txt (286793 => 286794)
--- trunk/LayoutTests/accessibility/mac/update-children-when-aria-role-changes-expected.txt 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/mac/update-children-when-aria-role-changes-expected.txt 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,14 +1,13 @@
-button 1
This tests that when an ARIA role changes, the AX hierarchy is updated accordingly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS parent.childAtIndex(0).role is 'AXRole: AXButton'
-PASS parent.childAtIndex(1) == null || parent.childAtIndex(1).isValid == false is true
-PASS parent.childAtIndex(0).role is 'AXRole: AXStaticText'
-PASS parent.childAtIndex(1).role is 'AXRole: AXButton'
+PASS container.childAtIndex(0).role is 'AXRole: AXButton'
+PASS container.childAtIndex(1) == null || container.childAtIndex(1).isValid == false is true
+PASS container.childAtIndex(0).role === 'AXRole: AXStaticText'
+PASS container.childAtIndex(1).role === 'AXRole: AXButton'
PASS successfullyParsed is true
TEST COMPLETE
-
+button 1
Modified: trunk/LayoutTests/accessibility/mac/update-children-when-aria-role-changes.html (286793 => 286794)
--- trunk/LayoutTests/accessibility/mac/update-children-when-aria-role-changes.html 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/mac/update-children-when-aria-role-changes.html 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,43 +1,36 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
-<script src=""
-<script>
-if (window.testRunner)
- testRunner.dumpAsText();
-</script>
+<script src=""
+<script src=""
</head>
<body>
-<div id="parent" tabindex=0 role="group">
+<div id="container" tabindex=0 role="group">
<span role="button" id="button1">button 1</span>
<span id="button2" title="button 2"></span>
</div>
-<p id="description"></p>
-<div id="console"></div>
-
<script>
-
description("This tests that when an ARIA role changes, the AX hierarchy is updated accordingly.");
+ var container;
if (window.accessibilityController) {
- document.getElementById("parent").focus();
- var parent = accessibilityController.focusedElement;
- shouldBe("parent.childAtIndex(0).role", "'AXRole: AXButton'");
- shouldBeTrue("parent.childAtIndex(1) == null || parent.childAtIndex(1).isValid == false");
+ window.jsTestIsAsync = true;
+
+ container = accessibilityController.accessibleElementById("container");
+ shouldBe("container.childAtIndex(0).role", "'AXRole: AXButton'");
+ shouldBeTrue("container.childAtIndex(1) == null || container.childAtIndex(1).isValid == false");
document.getElementById("button1").removeAttribute("role");
document.getElementById("button2").setAttribute("role", "button");
-
- shouldBe("parent.childAtIndex(0).role", "'AXRole: AXStaticText'");
- shouldBe("parent.childAtIndex(1).role", "'AXRole: AXButton'");
+ setTimeout(async function() {
+ await expectAsyncExpression("container.childAtIndex(0).role", "'AXRole: AXStaticText'");
+ await expectAsyncExpression("container.childAtIndex(1).role", "'AXRole: AXButton'");
+ finishJSTest();
+ }, 0);
}
-
</script>
-
-<script src=""
-
</body>
</html>
Modified: trunk/LayoutTests/accessibility/tabindex-removed-expected.txt (286793 => 286794)
--- trunk/LayoutTests/accessibility/tabindex-removed-expected.txt 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/tabindex-removed-expected.txt 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,4 +1,3 @@
- test
This tests that when tabindex is updated on an element, the children are re-computed.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -8,9 +7,9 @@
PASS button.parentElement().isEqual(group) is true
PASS group.parentElement().isEqual(main) is true
PASS main.childAtIndex(0).isEqual(group) is true
-PASS main.childAtIndex(0).isEqual(button) is true
-PASS button.parentElement().isEqual(main) is true
+PASS main.childAtIndex(0).isEqual(button) === true
+PASS button.parentElement().isEqual(main) === true
PASS successfullyParsed is true
TEST COMPLETE
-
+ test
Modified: trunk/LayoutTests/accessibility/tabindex-removed.html (286793 => 286794)
--- trunk/LayoutTests/accessibility/tabindex-removed.html 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/accessibility/tabindex-removed.html 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,41 +1,41 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
-<script src=""
+<script src=""
+<script src=""
</head>
<body>
<main id="main">
-
-<div style="display:inline" tabindex="0">
-<button id="button">test</button>
-</div>
-
+ <div style="display:inline" tabindex="0">
+ <button id="button">test</button>
+ </div>
</main>
-<p id="description"></p>
-<div id="console"></div>
-
<script>
description("This tests that when tabindex is updated on an element, the children are re-computed.")
+ var button, group, main;
if (window.accessibilityController) {
- var main = accessibilityController.accessibleElementById("main");
- var group = main.childAtIndex(0);
- var button = accessibilityController.accessibleElementById("button");
+ window.jsTestIsAsync = true;
+ button = accessibilityController.accessibleElementById("button");
+ main = accessibilityController.accessibleElementById("main");
+ group = main.childAtIndex(0);
+
shouldBeTrue("group.childAtIndex(0).parentElement().isEqual(group)");
shouldBeTrue("button.parentElement().isEqual(group)");
shouldBeTrue("group.parentElement().isEqual(main)");
shouldBeTrue("main.childAtIndex(0).isEqual(group)");
- // Removing the tabindex updates children
+ // Removing tabindex should cause children to update.
document.getElementById("main").children[0].removeAttribute("tabindex");
-
- shouldBeTrue("main.childAtIndex(0).isEqual(button)");
- shouldBeTrue("button.parentElement().isEqual(main)");
+ setTimeout(async function() {
+ await expectAsyncExpression("main.childAtIndex(0).isEqual(button)", "true");
+ await expectAsyncExpression("button.parentElement().isEqual(main)", "true");
+ finishJSTest();
+ }, 0);
}
</script>
-<script src=""
</body>
</html>
Modified: trunk/LayoutTests/platform/glib/accessibility/auto-fill-crash-expected.txt (286793 => 286794)
--- trunk/LayoutTests/platform/glib/accessibility/auto-fill-crash-expected.txt 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/platform/glib/accessibility/auto-fill-crash-expected.txt 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,12 +1,11 @@
-
This tests that when an auto fill element is removed we won't crash accessing an old value.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS textFieldAxObject.childrenCount is 1
-PASS textFieldAxObject.childAtIndex(childrenCountExpected - 1).description is 'AXDescription: contact info AutoFill'
-PASS textFieldAxObject.childrenCount is 0
+PASS axTextField.childrenCount === 1
+PASS axTextField.childAtIndex(expectedChildrenCount - 1).description === 'AXDescription: contact info AutoFill'
+PASS axTextField.childrenCount === 0
PASS successfullyParsed is true
TEST COMPLETE
Deleted: trunk/LayoutTests/platform/win/accessibility/auto-fill-crash-expected.txt (286793 => 286794)
--- trunk/LayoutTests/platform/win/accessibility/auto-fill-crash-expected.txt 2021-12-09 19:53:55 UTC (rev 286793)
+++ trunk/LayoutTests/platform/win/accessibility/auto-fill-crash-expected.txt 2021-12-09 20:02:20 UTC (rev 286794)
@@ -1,13 +0,0 @@
-
-This tests that when an auto fill element is removed we won't crash accessing an old value.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS textFieldAxObject.childrenCount is 2
-PASS textFieldAxObject.childAtIndex(childrenCountExpected - 1).description is 'AXDescription: contact info AutoFill'
-PASS textFieldAxObject.childrenCount is 2
-PASS successfullyParsed is true
-
-TEST COMPLETE
-