Title: [293206] trunk/LayoutTests
Revision
293206
Author
andresg...@apple.com
Date
2022-04-21 20:27:11 -0700 (Thu, 21 Apr 2022)

Log Message

AX ITM: Fix for multiple flaky tests in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=239583
<rdar://problem/92064483>

Reviewed by Chris Fleizach.

Rewrote these flaky tests so that now pass in isolated tree mode:
- Use expect() instead of shouldBe*() and log the output at the end of
the test.
- Avoid setting focus to an element just to get the accessible element.

* accessibility/legend-children-are-visible-expected.txt:
* accessibility/legend-children-are-visible.html:
* accessibility/mac/aria-label-overrides-visible-text-expected.txt:
* accessibility/mac/aria-label-overrides-visible-text.html:
* accessibility/mac/aria-popup-buttons-on-native-elements-expected.txt:
* accessibility/mac/aria-popup-buttons-on-native-elements.html:
* accessibility/mac/link-with-title-expected.txt:
* accessibility/mac/link-with-title.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (293205 => 293206)


--- trunk/LayoutTests/ChangeLog	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/ChangeLog	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,3 +1,25 @@
+2022-04-21  Andres Gonzalez  <andresg...@apple.com>
+
+        AX ITM: Fix for multiple flaky tests in isolated tree mode.
+        https://bugs.webkit.org/show_bug.cgi?id=239583
+        <rdar://problem/92064483>
+
+        Reviewed by Chris Fleizach.
+
+        Rewrote these flaky tests so that now pass in isolated tree mode:
+        - Use expect() instead of shouldBe*() and log the output at the end of
+        the test.
+        - Avoid setting focus to an element just to get the accessible element.
+
+        * accessibility/legend-children-are-visible-expected.txt:
+        * accessibility/legend-children-are-visible.html:
+        * accessibility/mac/aria-label-overrides-visible-text-expected.txt:
+        * accessibility/mac/aria-label-overrides-visible-text.html:
+        * accessibility/mac/aria-popup-buttons-on-native-elements-expected.txt:
+        * accessibility/mac/aria-popup-buttons-on-native-elements.html:
+        * accessibility/mac/link-with-title-expected.txt:
+        * accessibility/mac/link-with-title.html:
+
 2022-04-21  Karl Rackler  <rack...@apple.com>
 
         [ macOS wk2 arm64 ] media/modern-media-controls/tracks-support/text-track-selected-via-media-api.html is a flaky failure

Modified: trunk/LayoutTests/accessibility/legend-children-are-visible-expected.txt (293205 => 293206)


--- trunk/LayoutTests/accessibility/legend-children-are-visible-expected.txt	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/accessibility/legend-children-are-visible-expected.txt	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,11 +1,8 @@
-This tests that children of a will be visible to the AX hierarchy (so that in case a control element is inside, it can be reached)
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
+This tests that children of a  will be exposed in the AX hierarchy.
 fieldset description: AXDescription: Not link Link
 legend child 1: string value: AXValue: Not link
 legend child 2: title: AXTitle: Link
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/legend-children-are-visible.html (293205 => 293206)


--- trunk/LayoutTests/accessibility/legend-children-are-visible.html	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/accessibility/legend-children-are-visible.html	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,12 +1,11 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
-<script src=""
+<script src=""
 </head>
-<body id="body">
+<body>
 
 <div id="content">
-
 <form>
     <fieldset id="fieldset">
         <legend>Not link <a href=""
@@ -14,29 +13,22 @@
         <input type="radio" name="color" id="green">
     </fieldset>
 </form>
-
 </div>
 
-<p id="description"></p>
-<div id="console"></div>
-
 <script>
+    if (window.accessibilityController) {
+        let output = "This tests that children of a <legend> will be exposed in the AX hierarchy.\n";
 
-    description("This tests that children of a <legend> will be visible to the AX hierarchy (so that in case a control element is inside, it can be reached)");
+        var fieldset = accessibilityController.accessibleElementById("fieldset");
+        var legendChild1 = fieldset.childAtIndex(0);
+        var legendChild2 = fieldset.childAtIndex(1);
+        output += `fieldset description: ${fieldset.description}\n`;
+        output += `legend child 1: string value: ${legendChild1.stringValue}\n`;
+        output += `legend child 2: title: ${legendChild2.title}\n`;
 
-    if (window.accessibilityController) {
-          var fieldset = accessibilityController.accessibleElementById("fieldset");
-          var legendChild1 = fieldset.childAtIndex(0);
-          var legendChild2 = fieldset.childAtIndex(1);
-          debug("fieldset description: " + fieldset.description);
-          debug("legend child 1: string value: " + legendChild1.stringValue);
-          debug("legend child 2: title: " + legendChild2.title);
-
-          document.getElementById("content").style.visibility = "hidden";
+        debug(output);
+        document.getElementById("content").style.visibility = "hidden";
     }
-
 </script>
-
-<script src=""
 </body>
 </html>

Modified: trunk/LayoutTests/accessibility/mac/aria-label-overrides-visible-text-expected.txt (293205 => 293206)


--- trunk/LayoutTests/accessibility/mac/aria-label-overrides-visible-text-expected.txt	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/accessibility/mac/aria-label-overrides-visible-text-expected.txt	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,13 +1,9 @@
-test1 test1
 This tests ensures that if aria-label is used, the AXTitle will not expose its children on Mac.
+PASS: link1.description === 'AXDescription: '
+PASS: link1.title === 'AXTitle: test1'
+PASS: link2.description === 'AXDescription: LINK'
+PASS: link2.title === 'AXTitle: '
 
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS link1.description is 'AXDescription: '
-PASS link1.title is 'AXTitle: test1'
-PASS link2.description is 'AXDescription: LINK'
-PASS link2.title is 'AXTitle: '
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/mac/aria-label-overrides-visible-text.html (293205 => 293206)


--- trunk/LayoutTests/accessibility/mac/aria-label-overrides-visible-text.html	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/accessibility/mac/aria-label-overrides-visible-text.html	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,27 +1,31 @@
 <!DOCTYPE HTML>
 <html>
+<head>
+<script src=""
+<script src=""
+</head>
 <body>
-<script src=""
 
-<a tabindex="0" id="link1" href=""
-<a tabindex="0" id="link2" href="" aria-label="LINK">test1</a>
+<div id="content">
+<a id="link1" href=""
+<a id="link2" href="" aria-label="LINK">test1</a>
+</div>
 
-<div id="console"></div>
 <script>
-description("This tests ensures that if aria-label is used, the AXTitle will not expose its children on Mac.")
+    if (window.testRunner && window.accessibilityController) {
+        let output = "This tests ensures that if aria-label is used, the AXTitle will not expose its children on Mac.\n";
 
-if (window.testRunner && window.accessibilityController) {
-   var link1 = accessibilityController.accessibleElementById("link1");
-   shouldBe("link1.description", "'AXDescription: '");
-   shouldBe("link1.title", "'AXTitle: test1'");
+        var link1 = accessibilityController.accessibleElementById("link1");
+        output += expect("link1.description", "'AXDescription: '");
+        output += expect("link1.title", "'AXTitle: test1'");
 
-   var link2 = accessibilityController.accessibleElementById("link2");
-   shouldBe("link2.description", "'AXDescription: LINK'");
-   shouldBe("link2.title", "'AXTitle: '");
-}
+        var link2 = accessibilityController.accessibleElementById("link2");
+        output += expect("link2.description", "'AXDescription: LINK'");
+        output += expect("link2.title", "'AXTitle: '");
 
+        debug(output);
+        document.getElementById("content").style.visibility = "hidden";
+    }
 </script>
-
-<script src=""
 </body>
 </html>

Modified: trunk/LayoutTests/accessibility/mac/aria-popup-buttons-on-native-elements-expected.txt (293205 => 293206)


--- trunk/LayoutTests/accessibility/mac/aria-popup-buttons-on-native-elements-expected.txt	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/accessibility/mac/aria-popup-buttons-on-native-elements-expected.txt	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,21 +1,17 @@
-Options Options  Options
 This tests that native style buttons with aria-haspopup appear as popup buttons.
+PASS: button.role === 'AXRole: AXPopUpButton'
+PASS: button.title === 'AXTitle: Options'
+PASS: button.stringValue === 'AXValue: '
+PASS: button.role === 'AXRole: AXPopUpButton'
+PASS: button.title === 'AXTitle: Options'
+PASS: button.stringValue === 'AXValue: '
+PASS: button.role === 'AXRole: AXPopUpButton'
+PASS: button.title === 'AXTitle: Options'
+PASS: button.stringValue === 'AXValue: '
+PASS: button.role === 'AXRole: AXPopUpButton'
+PASS: button.title === 'AXTitle: Options'
+PASS: button.stringValue === 'AXValue: '
 
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS button.role is 'AXRole: AXPopUpButton'
-PASS button.title is 'AXTitle: Options'
-PASS button.stringValue is 'AXValue: '
-PASS button.role is 'AXRole: AXPopUpButton'
-PASS button.title is 'AXTitle: Options'
-PASS button.stringValue is 'AXValue: '
-PASS button.role is 'AXRole: AXPopUpButton'
-PASS button.title is 'AXTitle: Options'
-PASS button.stringValue is 'AXValue: '
-PASS button.role is 'AXRole: AXPopUpButton'
-PASS button.title is 'AXTitle: Options'
-PASS button.stringValue is 'AXValue: '
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/mac/aria-popup-buttons-on-native-elements.html (293205 => 293206)


--- trunk/LayoutTests/accessibility/mac/aria-popup-buttons-on-native-elements.html	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/accessibility/mac/aria-popup-buttons-on-native-elements.html	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,39 +1,36 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 </head>
-<body id="body">
+<body>
 
-<a id="button1" tabindex="0" class="button" href="" aria-haspopup="true" role="button">Options</a>
-<span id="button2" class="button" tabindex="0" role="button" aria-haspopup="true">Options</span>
+<div id="content">
+<a id="button1" class="button" href="" aria-haspopup="true" role="button">Options</a>
+<span id="button2" class="button" role="button" aria-haspopup="true">Options</span>
 
-<button id="button3" type="button" aria-haspopup="true">Options</button>
-<input id="button4" type="button" aria-haspopup="true" value="Options">
+<button id="button3" type="button" class="button" aria-haspopup="true">Options</button>
+<input id="button4" type="button" class="button" aria-haspopup="true" value="Options">
+</div>
 
-
-<p id="description"></p>
-<div id="console"></div>
-
 <script>
-    description("This tests that native style buttons with aria-haspopup appear as popup buttons.");
-    
     if (window.accessibilityController) {
+        let output = "This tests that native style buttons with aria-haspopup appear as popup buttons.\n";
 
-        for (var k = 1; k < 5; k++) {
+        var button;
+        document.querySelectorAll(".button").forEach(element => {
+           button = accessibilityController.accessibleElementById(element.id);
+           output += expect("button.role", "'AXRole: AXPopUpButton'");
+           output += expect("button.title", "'AXTitle: Options'");
 
-           document.getElementById("button" + k).focus();
-           var button = accessibilityController.focusedElement;
-           shouldBe("button.role", "'AXRole: AXPopUpButton'");        
-           shouldBe("button.title", "'AXTitle: Options'");        
+           // Verify that the title is not duplicated as the AXValue
+           output += expect("button.stringValue", "'AXValue: '");
+        });
 
-           // Verify that the title is not duplicated as the AXValue
-           shouldBe("button.stringValue", "'AXValue: '");        
-        }
+        debug(output);
+        document.getElementById("content").style.visibility = "hidden";
     }
-    
 </script>
-
-<script src=""
 </body>
 </html>

Modified: trunk/LayoutTests/accessibility/mac/link-with-title-expected.txt (293205 => 293206)


--- trunk/LayoutTests/accessibility/mac/link-with-title-expected.txt	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/accessibility/mac/link-with-title-expected.txt	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,14 +1,10 @@
-TEXT
 This tests that a link with a title attribute will only include that in the help field.
+Link with title and visible text
+PASS: link1.description === 'AXDescription: '
+PASS: link1.title === 'AXTitle: TEXT'
+PASS: link1.helpText === 'AXHelp: TITLE'
 
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Link with title and visible text
-PASS link1.description is 'AXDescription: '
-PASS link1.title is 'AXTitle: TEXT'
-PASS link1.helpText is 'AXHelp: TITLE'
 PASS successfullyParsed is true
 
 TEST COMPLETE
-
+TEXT

Modified: trunk/LayoutTests/accessibility/mac/link-with-title.html (293205 => 293206)


--- trunk/LayoutTests/accessibility/mac/link-with-title.html	2022-04-22 02:48:39 UTC (rev 293205)
+++ trunk/LayoutTests/accessibility/mac/link-with-title.html	2022-04-22 03:27:11 UTC (rev 293206)
@@ -1,29 +1,25 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 </head>
 <body>
 
 <a id="link1" href="" title="TITLE">TEXT</a>
 
-<p id="description"></p>
-<div id="console"></div>
-
 <script>
-    description("This tests that a link with a title attribute will only include that in the help field.");
-    
     if (window.accessibilityController) {
+        let output = "This tests that a link with a title attribute will only include that in the help field.\n";
+
         var link1 = accessibilityController.accessibleElementById("link1");
-        
-        debug("Link with title and visible text");
-        shouldBe("link1.description", "'AXDescription: '");
-        shouldBe("link1.title", "'AXTitle: TEXT'");
-        shouldBe("link1.helpText", "'AXHelp: TITLE'");
+        output += "Link with title and visible text\n";
+        output += expect("link1.description", "'AXDescription: '");
+        output += expect("link1.title", "'AXTitle: TEXT'");
+        output += expect("link1.helpText", "'AXHelp: TITLE'");
 
+        debug(output);
     }
 </script>
-
-<script src=""
 </body>
 </html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to