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

Side by Side Diff: LayoutTests/resources/accessibility-helper.js

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
« no previous file with comments | « LayoutTests/accessibility/table-with-empty-thead-causes-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 function buildAccessibilityTree(accessibilityObject, indent, allAttributesRequir ed, rolesToIgnore, targetObject, targetString) {
2 if (rolesToIgnore) {
3 for (var i = 0; i < rolesToIgnore.length; i++) {
4 if (accessibilityObject.role == 'AXRole: ' + rolesToIgnore[i])
5 return true;
6 }
7 }
8
9 var str = "";
10 for (var i = 0; i < indent; i++)
11 str += " ";
12 str += accessibilityObject.role;
13 str += " " + accessibilityObject.stringValue;
14 str += allAttributesRequired && accessibilityObject.role == '' ? accessibili tyObject.allAttributes() : '';
15 str += targetObject && accessibilityObject.isEqual(targetObject) ? " " + targetString : '';
16 str += "\n";
17
18 document.getElementById("console").innerText += str;
19
20 if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
21 return false;
22
23 var count = accessibilityObject.childrenCount;
24 for (var i = 0; i < count; i++) {
25 if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1, allAttributesRequired, rolesToIgnore, targetObject, targetString))
26 return false;
27 }
28
29 return true;
30 }
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/table-with-empty-thead-causes-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698