OLD | NEW |
---|---|
(Empty) | |
1 <script src="../resources/js-test.js"></script> | |
2 <body id="body"> | |
3 <div role="grid"> | |
4 <div role="row"> | |
5 <div role="columnheader">col head</div> | |
6 <div role="columnheader">col head</div> | |
7 <div role="columnheader">col head</div> | |
8 </div> | |
9 <div role="row"> | |
10 <div role="rowheader">row head</div> | |
11 <div role="gridcell">data</div> | |
12 <div role="rowheader">row head</div> | |
13 </div> | |
14 <div role="row"> | |
15 <div role="rowheader">row head</div> | |
16 <div role="rowheader">row head</div> | |
17 <div role="columnheader">col head</div> | |
18 </div> | |
19 </div> | |
20 </body> | |
21 <p>End of test</p> | |
22 <p id="description"></p> | |
23 <div id="console"></div> | |
24 <script> | |
25 function buildAccessibilityTree(accessibilityObject, i) { | |
dmazzoni
2015/01/23 19:02:06
We're using buildAccessibilityTree in 9 tests now
| |
26 if(accessibilityObject.stringValue.indexOf('End of test') >= 0) | |
27 return false; | |
28 | |
29 if (accessibilityObject.role == 'AXRole: AXColumn' || accessibilityObjec t.role == 'AXRole: AXTableHeaderContainer') | |
30 return true; | |
31 | |
32 var indent = ""; | |
33 for (var k = 0; k < i; k++) | |
34 indent += " "; | |
35 debug(indent + accessibilityObject.role + " " + accessibilityObject.stri ngValue); | |
36 var childrenCount = accessibilityObject.childrenCount; | |
37 for (var j = 0; j < childrenCount; j++) { | |
38 if (!buildAccessibilityTree(accessibilityObject.childAtIndex(j), i + 1)) | |
39 return false; | |
40 } | |
41 return true; | |
42 } | |
43 | |
44 if (window.accessibilityController) { | |
45 document.getElementById("body").focus(); | |
46 buildAccessibilityTree(accessibilityController.focusedElement, 0); | |
47 } | |
48 </script> | |
OLD | NEW |