Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: LayoutTests/accessibility/table-header-column-row.html

Issue 876003003: Extract buildAccessibilityTree() from the individual layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated some tests and added rolesToIgnore param to helper function. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <script src="../resources/js-test.js"></script> 1 <script src="../resources/js-test.js"></script>
2 <script src="../resources/accessibility-helper.js"></script>
2 <table width="50%" border="1"> 3 <table width="50%" border="1">
3 <caption> 4 <caption>
4 scope test 5 scope test
5 </caption> 6 </caption>
6 <tr> 7 <tr>
7 <th scope="col">col head</th> 8 <th scope="col">col head</th>
8 <th scope="row">row head</th> 9 <th scope="row">row head</th>
9 <th>col head</th> 10 <th>col head</th>
10 </tr> 11 </tr>
11 <tr> 12 <tr>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 </tr> 93 </tr>
93 </table> 94 </table>
94 <p>End of test</p> 95 <p>End of test</p>
95 <p id="description"></p> 96 <p id="description"></p>
96 <div id="console"></div> 97 <div id="console"></div>
97 <script> 98 <script>
98 description("This tests that AXRoles for header cells are assigned."); 99 description("This tests that AXRoles for header cells are assigned.");
99 100
100 if (window.testRunner) 101 if (window.testRunner)
101 testRunner.dumpAsText(); 102 testRunner.dumpAsText();
102
103 function buildAccessibilityTree(accessibilityObject, indent) {
104 if (accessibilityObject.role == 'AXRole: AXColumn' || accessibilityObject.ro le == 'AXRole: AXTableHeaderContainer')
105 return true;
106 var str = "";
107 for (var i = 0; i < indent; i++)
108 str += " ";
109 str += accessibilityObject.role;
110 str += " " + accessibilityObject.stringValue;
111
112 if (accessibilityObject.role == '')
113 str += accessibilityObject.allAttributes();
114
115 str += "\n";
116 document.getElementById("console").innerText += str;
117
118 if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
119 return false;
120
121 var count = accessibilityObject.childrenCount;
122 for (var i = 0; i < count; ++i) {
123 if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
124 return false;
125 }
126
127 return true;
128 }
129
130 if (window.accessibilityController) { 103 if (window.accessibilityController) {
131 var body = accessibilityController.focusedElement; 104 buildAccessibilityTree(accessibilityController.focusedElement, 0, 1, ['AXCol umn', 'AXTableHeaderContainer']);
132 buildAccessibilityTree(body, 0);
133 } 105 }
134 </script> 106 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698