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

Side by Side Diff: LayoutTests/accessibility/listitem-presentation-inherited.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 <ul role="presentation"> 3 <ul role="presentation">
3 <li role="listitem">Item 1</li> 4 <li role="listitem">Item 1</li>
4 <li role="listitem">Item 2</li> 5 <li role="listitem">Item 2</li>
5 <li role="listitem">Item 3</li> 6 <li role="listitem">Item 3</li>
6 </ul> 7 </ul>
7 8
8 <ul role="presentation"> 9 <ul role="presentation">
9 <li>Plain Text 1</li> 10 <li>Plain Text 1</li>
10 <li>Plain Text 2</li> 11 <li>Plain Text 2</li>
11 <li>Plain Text 3</li> 12 <li>Plain Text 3</li>
12 </ul> 13 </ul>
13 <p>End of test</p> 14 <p>End of test</p>
14 <p id="description"></p> 15 <p id="description"></p>
15 <div id="console"></div> 16 <div id="console"></div>
16 <script> 17 <script>
17 description("This tests that the presentation role is inherited."); 18 description("This tests that the presentation role is inherited.");
18 19
19 if (window.testRunner) 20 if (window.testRunner)
20 testRunner.dumpAsText(); 21 testRunner.dumpAsText();
21 22 if (window.accessibilityController) {
22 function buildAccessibilityTree(accessibilityObject, indent) { 23 buildAccessibilityTree(accessibilityController.focusedElement, 0, 1);
23 var str = "";
24 for (var i = 0; i < indent; i++)
25 str += " ";
26 str += accessibilityObject.role;
27 str += " " + accessibilityObject.stringValue;
28
29 if (accessibilityObject.role == '')
30 str += accessibilityObject.allAttributes();
31
32 str += "\n";
33 document.getElementById("console").innerText += str;
34
35 if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
36 return false;
37
38 var count = accessibilityObject.childrenCount;
39 for (var i = 0; i < count; ++i) {
40 if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
41 return false;
42 }
43
44 return true;
45 } 24 }
46 25 </script>
47 if (window.accessibilityController) {
48 var body = accessibilityController.focusedElement;
49 buildAccessibilityTree(body, 0);
50 }
51 </script>
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/legend.html ('k') | LayoutTests/accessibility/table-header-column-row.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698