Title: [291768] trunk/LayoutTests
Revision
291768
Author
andresg...@apple.com
Date
2022-03-23 14:55:02 -0700 (Wed, 23 Mar 2022)

Log Message

ITM: Fix for accessibility/table-attributes.html in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=238258
<rdar://problem/90707533>

Reviewed by Chris Fleizach.

- Modified this test to build the output in memory and log it at the end
in one call. This makes the test to run faster and not timeout in
isolated tree mode. In addition, we now retrieve the table element by
ID instead of setting focus to the body and getting the first child of
the focused element, which is not ITM friendly.
- Added the axDebug helper function which unlike debug causes minimum
side effects by modifying the innerText of the console element instead
of adding span children to it. Adding children to the console element
causes event notifications that affect the behavior of the test in both
ITM on and off.

* accessibility/table-attributes-expected.txt:
* accessibility/table-attributes.html:
* platform/glib/accessibility/table-attributes-expected.txt:
* resources/accessibility-helper.js:
(axDebug): Added.
* resources/js-test.js:
(getOrCreate): Exposes this function.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (291767 => 291768)


--- trunk/LayoutTests/ChangeLog	2022-03-23 21:27:33 UTC (rev 291767)
+++ trunk/LayoutTests/ChangeLog	2022-03-23 21:55:02 UTC (rev 291768)
@@ -1,3 +1,30 @@
+2022-03-23  Andres Gonzalez  <andresg...@apple.com>
+
+        ITM: Fix for accessibility/table-attributes.html in isolated tree mode.
+        https://bugs.webkit.org/show_bug.cgi?id=238258
+        <rdar://problem/90707533>
+
+        Reviewed by Chris Fleizach.
+
+        - Modified this test to build the output in memory and log it at the end
+        in one call. This makes the test to run faster and not timeout in
+        isolated tree mode. In addition, we now retrieve the table element by
+        ID instead of setting focus to the body and getting the first child of
+        the focused element, which is not ITM friendly.
+        - Added the axDebug helper function which unlike debug causes minimum
+        side effects by modifying the innerText of the console element instead
+        of adding span children to it. Adding children to the console element
+        causes event notifications that affect the behavior of the test in both
+        ITM on and off.
+
+        * accessibility/table-attributes-expected.txt:
+        * accessibility/table-attributes.html:
+        * platform/glib/accessibility/table-attributes-expected.txt:
+        * resources/accessibility-helper.js:
+        (axDebug): Added.
+        * resources/js-test.js:
+        (getOrCreate): Exposes this function.
+
 2022-03-23  Jon Lee  <jon...@apple.com>
 
         Unreviewed fuzzy gardening.

Modified: trunk/LayoutTests/accessibility/table-attributes-expected.txt (291767 => 291768)


--- trunk/LayoutTests/accessibility/table-attributes-expected.txt	2022-03-23 21:27:33 UTC (rev 291767)
+++ trunk/LayoutTests/accessibility/table-attributes-expected.txt	2022-03-23 21:55:02 UTC (rev 291768)
@@ -1,13 +1,3 @@
-Example #1: Nested Stubs
-Ruritanian
-Population
-Survey	All
-Genders	By Gender
-Males	Females
-All Regions	North	3333	1111	2222
-South	3333	1111	2222
---------------------------
-
 AXHasDocumentRoleAncestor: 0
 AXHasWebApplicationAncestor: 0
 AXRole: AXCell
@@ -209,9 +199,6 @@
 
 ------------
 
-
---------------------------
-
 AXHasDocumentRoleAncestor: 0
 AXHasWebApplicationAncestor: 0
 AXRole: AXCell
@@ -293,9 +280,6 @@
 
 ------------
 
-
---------------------------
-
 AXHasDocumentRoleAncestor: 0
 AXHasWebApplicationAncestor: 0
 AXRole: AXColumn
@@ -482,9 +466,6 @@
 
 ------------
 
-
---------------------------
-
 AXHasDocumentRoleAncestor: 0
 AXHasWebApplicationAncestor: 0
 AXRole: AXRow
@@ -622,9 +603,6 @@
 
 ------------
 
-
---------------------------
-
 AXHasDocumentRoleAncestor: 0
 AXHasWebApplicationAncestor: 0
 AXRole: AXCell
@@ -1186,9 +1164,6 @@
 
 ------------
 
-
---------------------------
-
 AXHasDocumentRoleAncestor: 0
 AXHasWebApplicationAncestor: 0
 AXRole: AXGroup
@@ -1198,7 +1173,7 @@
 AXChildrenInNavigationOrder: <array of size 5>
 AXHelp:
 AXParent: <AXGroup>
-AXSize: NSSize: {335, 66}
+AXSize: NSSize: {336, 66}
 AXTitle:
 AXDescription:
 AXValue:
@@ -1224,6 +1199,14 @@
 ------------
 
 
---------------------------
+PASS successfullyParsed is true
 
-
+TEST COMPLETE
+Example #1: Nested Stubs
+Ruritanian
+Population
+Survey	All
+Genders	By Gender
+Males	Females
+All Regions	North	3333	1111	2222
+South	3333	1111	2222

Modified: trunk/LayoutTests/accessibility/table-attributes.html (291767 => 291768)


--- trunk/LayoutTests/accessibility/table-attributes.html	2022-03-23 21:27:33 UTC (rev 291767)
+++ trunk/LayoutTests/accessibility/table-attributes.html	2022-03-23 21:55:02 UTC (rev 291768)
@@ -1,63 +1,52 @@
 <html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+
+<table id="testTable" align="center" border="1" cellpadding="5" cellspacing="0"
+    summary="This is the summary text that should appear as a description">
+    <caption> Example #1: Nested Stubs </caption>
+    <tr>
+        <th class="center" colspan="2" rowspan="2">Ruritanian<br> Population
+            <br> Survey</th>
+        <th class="center" rowspan="2">All<br> Genders</th>
+        <th class="center" colspan="2">By Gender</th>
+    </tr>
+    <tr>
+        <th class="center">Males</th>
+        <th class="center">Females</th>
+    </tr>
+    <tr>
+        <th align="left" rowspan="2">All Regions</th>
+        <th>North</th>
+        <td align="right">3333</td>
+        <td align="right">1111</td>
+        <td align="right">2222</td>
+    </tr>
+    <tr>
+        <th>South</th>
+        <td align="right">3333</td>
+        <td align="right">1111</td>
+        <td align="right">2222</td>
+    </tr>
+</table>
+
 <script>
-    if (window.testRunner)
-        testRunner.dumpAsText();
+    if (window.accessibilityController) {
+        let output = "";
+        let table = accessibilityController.accessibleElementById("testTable");
+
+        output += table.attributesOfColumnHeaders() + "\n";
+        output += table.attributesOfRowHeaders() + "\n";
+        output += table.attributesOfColumns() + "\n";
+        output += table.attributesOfRows() + "\n";
+        output += table.attributesOfVisibleCells() + "\n";
+        output += table.attributesOfHeader() + "\n";
+
+        axDebug(output);
+    }
 </script>
-<body id="body">
-    
-    <table id="testTable" align="center" border="1" cellpadding="5" cellspacing="0" 
-        summary="This is the summary text that should appear as a description">
-        <caption> Example #1: Nested Stubs </caption>
-        <tr>
-            <th class="center" colspan="2" rowspan="2">Ruritanian<br> Population
-                <br> Survey</th>
-            <th class="center" rowspan="2">All<br> Genders</th>
-            
-            <th class="center" colspan="2">By Gender</th>
-            </tr>
-        <tr>
-            <th class="center">Males</th>
-            <th class="center">Females</th>
-            </tr>
-        <tr>
-            
-            <th align="left" rowspan="2">All Regions</th>
-            <th>North</th>
-            <td align="right">3333</td>
-            <td align="right">1111</td>
-            <td align="right">2222</td>
-            </tr>
-        
-        <tr>
-            <th>South</th>
-            <td align="right">3333</td>
-            <td align="right">1111</td>
-            <td align="right">2222</td>
-            </tr>
-    </table>
-    
-    <div id="result"></div>
-    
-    <script>
-        if (window.accessibilityController) {
-            var body = document.getElementById("body");
-            body.focus();
-            var table = accessibilityController.focusedElement.childAtIndex(0);
-            
-            result.innerText += "--------------------------\n\n"; 
-            result.innerText += table.attributesOfColumnHeaders() + "\n\n"; 
-            result.innerText += "--------------------------\n\n"; 
-            result.innerText += table.attributesOfRowHeaders() + "\n\n"; 
-            result.innerText += "--------------------------\n\n"; 
-            result.innerText += table.attributesOfColumns() + "\n\n"; 
-            result.innerText += "--------------------------\n\n"; 
-            result.innerText += table.attributesOfRows() + "\n\n"; 
-            result.innerText += "--------------------------\n\n"; 
-            result.innerText += table.attributesOfVisibleCells() + "\n\n"; 
-            result.innerText += "--------------------------\n\n"; 
-            result.innerText += table.attributesOfHeader() + "\n\n"; 
-            result.innerText += "--------------------------\n\n"; 
-        }
-    </script>
 </body>
 </html>

Modified: trunk/LayoutTests/platform/glib/accessibility/table-attributes-expected.txt (291767 => 291768)


--- trunk/LayoutTests/platform/glib/accessibility/table-attributes-expected.txt	2022-03-23 21:27:33 UTC (rev 291767)
+++ trunk/LayoutTests/platform/glib/accessibility/table-attributes-expected.txt	2022-03-23 21:55:02 UTC (rev 291768)
@@ -1,17 +1,7 @@
-Example #1: Nested Stubs
-Ruritanian
-Population
-Survey	All
-Genders	By Gender
-Males	Females
-All Regions	North	3333	1111	2222
-South	3333	1111	2222
---------------------------
-
 AXRole: AXColumnHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 234.000, 27.0000 }
+AXPosition:  { 234.000, 27.0000 }
 AXSize: { 144.000, 66.0000 }
 AXTitle:
 AXDescription:
@@ -30,7 +20,7 @@
 AXRole: AXColumnHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 234.000, 27.0000 }
+AXPosition:  { 234.000, 27.0000 }
 AXSize: { 144.000, 66.0000 }
 AXTitle:
 AXDescription:
@@ -49,7 +39,7 @@
 AXRole: AXColumnHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 377.000, 27.0000 }
+AXPosition:  { 377.000, 27.0000 }
 AXSize: { 70.0000, 66.0000 }
 AXTitle:
 AXDescription:
@@ -68,7 +58,7 @@
 AXRole: AXColumnHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 446.000, 27.0000 }
+AXPosition:  { 446.000, 27.0000 }
 AXSize: { 120.000, 30.0000 }
 AXTitle:
 AXDescription:
@@ -87,7 +77,7 @@
 AXRole: AXColumnHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 446.000, 27.0000 }
+AXPosition:  { 446.000, 27.0000 }
 AXSize: { 120.000, 30.0000 }
 AXTitle:
 AXDescription:
@@ -104,14 +94,11 @@
 AXPlatformAttributes: computed-role:columnheader, tag:th
 ------------
 
-
---------------------------
-
 AXRole: AXRowHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 227.000, 93.0000 }
-AXSize: { 90.0000, 60.0000 }
+AXPosition:  { 234.000, 93.0000 }
+AXSize: { 91.0000, 60.0000 }
 AXTitle:
 AXDescription:
 AXValue: All Regions
@@ -129,8 +116,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 317.000, 123.000 }
-AXSize: { 53.0000, 30.0000 }
+AXPosition:  { 324.000, 123.000 }
+AXSize: { 54.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: South
@@ -147,17 +134,11 @@
 ------------
 
 
---------------------------
-
-
-
---------------------------
-
 AXRole: AXRow
 AXParent: AXTable: Example #1: Nested Stubs
 AXChildren: 3
-AXPosition: { 227.000, 27.0000 }
-AXSize: { 331.000, 30.0000 }
+AXPosition:  { 234.000, 27.0000 }
+AXSize: { 332.000, 30.0000 }
 AXTitle:
 AXDescription:
 AXFocusable: 0
@@ -174,8 +155,8 @@
 AXRole: AXRow
 AXParent: AXTable: Example #1: Nested Stubs
 AXChildren: 2
-AXPosition: { 227.000, 57.0000 }
-AXSize: { 331.000, 36.0000 }
+AXPosition:  { 234.000, 57.0000 }
+AXSize: { 332.000, 36.0000 }
 AXTitle:
 AXDescription:
 AXFocusable: 0
@@ -192,8 +173,8 @@
 AXRole: AXRow
 AXParent: AXTable: Example #1: Nested Stubs
 AXChildren: 5
-AXPosition: { 227.000, 93.0000 }
-AXSize: { 331.000, 30.0000 }
+AXPosition:  { 234.000, 93.0000 }
+AXSize: { 332.000, 30.0000 }
 AXTitle:
 AXDescription:
 AXFocusable: 0
@@ -210,8 +191,8 @@
 AXRole: AXRow
 AXParent: AXTable: Example #1: Nested Stubs
 AXChildren: 4
-AXPosition: { 227.000, 123.000 }
-AXSize: { 331.000, 30.0000 }
+AXPosition:  { 234.000, 123.000 }
+AXSize: { 332.000, 30.0000 }
 AXTitle:
 AXDescription:
 AXFocusable: 0
@@ -226,14 +207,11 @@
 AXPlatformAttributes: computed-role:row, tag:tr
 ------------
 
-
---------------------------
-
 AXRole: AXColumnHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 227.000, 27.0000 }
-AXSize: { 143.000, 66.0000 }
+AXPosition:  { 234.000, 27.0000 }
+AXSize: { 144.000, 66.0000 }
 AXTitle:
 AXDescription:
 AXValue: Ruritanian<\n>Population <\n>Survey
@@ -251,8 +229,8 @@
 AXRole: AXColumnHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 370.000, 27.0000 }
-AXSize: { 69.0000, 66.0000 }
+AXPosition:  { 377.000, 27.0000 }
+AXSize: { 70.0000, 66.0000 }
 AXTitle:
 AXDescription:
 AXValue: All<\n>Genders
@@ -270,8 +248,8 @@
 AXRole: AXColumnHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 439.000, 27.0000 }
-AXSize: { 119.000, 30.0000 }
+AXPosition:  { 446.000, 27.0000 }
+AXSize: { 120.000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: By Gender
@@ -289,8 +267,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 439.000, 57.0000 }
-AXSize: { 52.0000, 36.0000 }
+AXPosition:  { 446.000, 57.0000 }
+AXSize: { 53.0000, 36.0000 }
 AXTitle:
 AXDescription:
 AXValue: Males
@@ -308,8 +286,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 491.000, 57.0000 }
-AXSize: { 67.0000, 36.0000 }
+AXPosition:  { 498.000, 57.0000 }
+AXSize: { 68.0000, 36.0000 }
 AXTitle:
 AXDescription:
 AXValue: Females
@@ -327,8 +305,8 @@
 AXRole: AXRowHeader
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 227.000, 93.0000 }
-AXSize: { 90.0000, 60.0000 }
+AXPosition:  { 234.000, 93.0000 }
+AXSize: { 91.0000, 60.0000 }
 AXTitle:
 AXDescription:
 AXValue: All Regions
@@ -346,8 +324,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 317.000, 93.0000 }
-AXSize: { 53.0000, 30.0000 }
+AXPosition:  { 324.000, 93.0000 }
+AXSize: { 54.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: North
@@ -365,8 +343,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 370.000, 93.0000 }
-AXSize: { 69.0000, 30.0000 }
+AXPosition:  { 377.000, 93.0000 }
+AXSize: { 70.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: 3333
@@ -384,8 +362,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 439.000, 93.0000 }
-AXSize: { 52.0000, 30.0000 }
+AXPosition:  { 446.000, 93.0000 }
+AXSize: { 53.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: 1111
@@ -403,8 +381,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 491.000, 93.0000 }
-AXSize: { 67.0000, 30.0000 }
+AXPosition:  { 498.000, 93.0000 }
+AXSize: { 68.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: 2222
@@ -422,8 +400,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 317.000, 123.000 }
-AXSize: { 53.0000, 30.0000 }
+AXPosition:  { 324.000, 123.000 }
+AXSize: { 54.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: South
@@ -441,8 +419,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 370.000, 123.000 }
-AXSize: { 69.0000, 30.0000 }
+AXPosition:  { 377.000, 123.000 }
+AXSize: { 70.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: 3333
@@ -460,8 +438,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 439.000, 123.000 }
-AXSize: { 52.0000, 30.0000 }
+AXPosition:  { 446.000, 123.000 }
+AXSize: { 53.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: 1111
@@ -479,8 +457,8 @@
 AXRole: AXCell
 AXParent: AXRow
 AXChildren: 0
-AXPosition: { 491.000, 123.000 }
-AXSize: { 67.0000, 30.0000 }
+AXPosition:  { 498.000, 123.000 }
+AXSize: { 68.0000, 30.0000 }
 AXTitle:
 AXDescription:
 AXValue: 2222
@@ -497,10 +475,15 @@
 ------------
 
 
---------------------------
 
+PASS successfullyParsed is true
 
-
---------------------------
-
-
+TEST COMPLETE
+Example #1: Nested Stubs
+Ruritanian
+Population
+Survey	All
+Genders	By Gender
+Males	Females
+All Regions	North	3333	1111	2222
+South	3333	1111	2222

Modified: trunk/LayoutTests/resources/accessibility-helper.js (291767 => 291768)


--- trunk/LayoutTests/resources/accessibility-helper.js	2022-03-23 21:27:33 UTC (rev 291767)
+++ trunk/LayoutTests/resources/accessibility-helper.js	2022-03-23 21:55:02 UTC (rev 291768)
@@ -1,3 +1,8 @@
+function axDebug(msg)
+{
+    getOrCreate("console", "div").innerText += `${msg}\n`;
+};
+
 // This function is necessary when printing AX attributes that are stringified with angle brackets:
 //    AXChildren: <array of size 0>
 // `debug` outputs to the `innerHTML` of a generated element, so these brackets must be escaped to be printed.

Modified: trunk/LayoutTests/resources/js-test.js (291767 => 291768)


--- trunk/LayoutTests/resources/js-test.js	2022-03-23 21:27:33 UTC (rev 291767)
+++ trunk/LayoutTests/resources/js-test.js	2022-03-23 21:55:02 UTC (rev 291768)
@@ -52,7 +52,7 @@
             document.documentElement.appendChild(rootElement);
     }
 
-    function getOrCreate(id, tagName)
+    getOrCreate = function getOrCreate(id, tagName)
     {
         var element = document.getElementById(id);
         if (element)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to