Title: [292598] trunk/LayoutTests
Revision
292598
Author
[email protected]
Date
2022-04-08 04:15:48 -0700 (Fri, 08 Apr 2022)

Log Message

Fix for accessibility/roles-table-and-cell.html in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=238936
<rdar://problem/91414958>

Reviewed by Chris Fleizach.

Fixes this test in isolated tree mode by not writing to the console
until the end of the test.

* accessibility/roles-table-and-cell-expected.txt:
* accessibility/roles-table-and-cell.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (292597 => 292598)


--- trunk/LayoutTests/ChangeLog	2022-04-08 10:23:46 UTC (rev 292597)
+++ trunk/LayoutTests/ChangeLog	2022-04-08 11:15:48 UTC (rev 292598)
@@ -1,3 +1,17 @@
+2022-04-08  Andres Gonzalez  <[email protected]>
+
+        Fix for accessibility/roles-table-and-cell.html in isolated tree mode.
+        https://bugs.webkit.org/show_bug.cgi?id=238936
+        <rdar://problem/91414958>
+
+        Reviewed by Chris Fleizach.
+
+        Fixes this test in isolated tree mode by not writing to the console
+        until the end of the test.
+
+        * accessibility/roles-table-and-cell-expected.txt:
+        * accessibility/roles-table-and-cell.html:
+
 2022-04-08  Carlos Garcia Campos  <[email protected]>
 
         Incorrect CORP/COEP check in 304 responses

Modified: trunk/LayoutTests/accessibility/roles-table-and-cell-expected.txt (292597 => 292598)


--- trunk/LayoutTests/accessibility/roles-table-and-cell-expected.txt	2022-04-08 10:23:46 UTC (rev 292597)
+++ trunk/LayoutTests/accessibility/roles-table-and-cell-expected.txt	2022-04-08 11:15:48 UTC (rev 292598)
@@ -1,13 +1,10 @@
-This tests that table and cell have the correct ARIA roles
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
+This tests that table and cell have the correct ARIA roles.
 PASS: div[role="grid"] -> grid.
 PASS: table[role="table"] -> table.
 PASS: td[role="gridcell"] -> gridcell.
 PASS: td -> cell.
 PASS: td[role="cell"] -> cell.
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/roles-table-and-cell.html (292597 => 292598)


--- trunk/LayoutTests/accessibility/roles-table-and-cell.html	2022-04-08 10:23:46 UTC (rev 292597)
+++ trunk/LayoutTests/accessibility/roles-table-and-cell.html	2022-04-08 11:15:48 UTC (rev 292598)
@@ -1,7 +1,9 @@
 <!DOCTYPE HTML>
 <html>
+<head>
+<script src=""
+</head>
 <body>
-<script src=""
 
 <!-- ==================================================================================================== -->
 <!-- This tests ARIA table role and cell role work as intended                                            -->
@@ -8,64 +10,50 @@
 <!-- ==================================================================================================== -->
 
 <div role="grid" data-role="grid" class="ex">
-	<div role="gridcell" data-role="gridcell" class="ex">data</div>
-  	<div role="cell" data-role="cell" class="ex">data2</div>
-  	<div role="cell" data-role="cell" class="ex">data3</div>
+    <div role="gridcell" data-role="gridcell" class="ex">data</div>
+    <div role="cell" data-role="cell" class="ex">data2</div>
+    <div role="cell" data-role="cell" class="ex">data3</div>
 </div>
 
 <table role="table" data-role="table" class="ex">
-	<td role="gridcell" data-role="gridcell" class="ex">data</td>
-  	<td data-role="cell" class="ex">data2</td>
-  	<td role="cell" data-role="cell" class="ex">data3</td>
+    <td role="gridcell" data-role="gridcell" class="ex">data</td>
+    <td data-role="cell" class="ex">data2</td>
+    <td role="cell" data-role="cell" class="ex">data3</td>
 </table>
 
-<div id="console"></div>
 <script>
-if (window.testRunner && window.accessibilityController) {
-    description("This tests that table and cell have the correct ARIA roles")
-    var examples = document.querySelectorAll(".ex");
-    var el, contentAttrRoleString, axElement, computedAriaRole, output, expectedRole, expectation, result, note;
-    for (var i = 0, c = examples.length; i < c; i++) {
-        el = examples[i];
-		el.id = "ex" + i
+    if (window.testRunner && window.accessibilityController) {
+        let output = "This tests that table and cell have the correct ARIA roles.\n";
 
-        axElement = accessibilityController.accessibleElementById(el.id);
-        if (!axElement)
-        	continue;
+        let examples = document.querySelectorAll(".ex");
+        for (let i = 0; i < examples.length; i++) {
+            let el = examples[i];
+            el.id = "ex" + i;
 
-        computedAriaRole = axElement.computedRoleString;
+            axElement = accessibilityController.accessibleElementById(el.id);
+            if (!axElement)
+                continue;
 
-        contentAttrRoleString = el.getAttribute("role");
-        note = el.getAttribute("data-note")
-        output = el.tagName.toLowerCase() + (contentAttrRoleString ? ("[role=\""+contentAttrRoleString+"\"]") : "") + (note ? note : "");
-        output += " -> ";
-        output += computedAriaRole;
-        output += ". ";
+            let role = axElement.computedRoleString;
+            let contentAttrRoleString = el.getAttribute("role");
+            let note = el.getAttribute("data-note");
+            let out = el.tagName.toLowerCase() + (contentAttrRoleString ? ("[role=\"" + contentAttrRoleString + "\"]") : "") + (note ? note : "");
+            out += ` -> ${role}. `;
 
-        expectedRole = "";
-        if (el.hasAttribute("data-role")) {
-            expectedRole = el.getAttribute("data-role");
-        }
+            let expectedRole = "";
+            if (el.hasAttribute("data-role"))
+                expectedRole = el.getAttribute("data-role");
 
-        expectation = expectedRole;
-        matchedResults = (computedAriaRole == expectedRole)
-
-        result = document.getElementById('console');
-        if (matchedResults) {
-            result.innerText += "PASS: " + output + "\n";
-        } else {
-            result.innerText += "FAIL: " + output + "Expected: " + expectation + ".\n";
+            if (role == expectedRole)
+                output += `PASS: ${out}\n`;
+            else
+                output += `FAIL: ${out} Expected: ${expectedRole}.\n`;
         }
-    }
 
-    // Once tests are complete, hide all the example markup.
-    examples = document.querySelectorAll(".ex");
-    for (var i = 0, c = examples.length; i < c; i++) {
-        el = examples[i];
-        el.style.display = "none";
+        debug(output);
+        // Once tests are complete, hide all the example markup.
+        examples.forEach((element) => { element.style.display = "none"; });
     }
-}
 </script>
-<script src=""
 </body>
 </html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to