OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body id="body"> | 6 <body id="body"> |
7 | 7 |
8 <div id="content"> | 8 <div id="content"> |
9 | 9 |
10 <table id="table" border=1> | 10 <table id="table" border=1> |
11 <tr><th>header 1</th><th>header 2</th></tr> | 11 <tr><th>header 1</th><th>header 2</th></tr> |
12 <tr><td>foo</td><td>bar</td></tr> | 12 <tr><td>foo</td><td>bar</td></tr> |
13 </table> | 13 </table> |
14 | 14 |
15 </div> | 15 </div> |
16 | 16 |
17 <script> | 17 <script> |
18 | 18 |
19 description("This tests that table headers are exposed for accessibility."); | 19 description("This tests that table headers are exposed for accessibility."); |
20 | 20 |
21 if (window.accessibilityController) { | 21 if (window.accessibilityController) { |
22 var table = accessibilityController.accessibleElementById("table"); | 22 var table = accessibilityController.accessibleElementById("table"); |
23 shouldBe("table.rowCount", "2"); | 23 shouldBe("table.rowCount", "2"); |
24 var tableheader = table.tableHeader(); | 24 var tableheader = table.tableHeader(); |
25 shouldBeTrue("tableheader.isValid"); | 25 shouldBeTrue("tableheader.isValid"); |
26 shouldBe("tableheader.childrenCount", "2"); | 26 shouldBe("tableheader.childrenCount", "2"); |
27 window.firstHeaderText = tableheader.childAtIndex(0).childAtIndex(0).str
ingValue; | 27 window.firstHeaderText = tableheader.childAtIndex(0).childAtIndex(0).nam
e; |
28 shouldBe("firstHeaderText", "'AXValue: header 1'"); | 28 shouldBe("firstHeaderText", "'header 1'"); |
29 window.secondHeaderText = tableheader.childAtIndex(1).childAtIndex(0).st
ringValue; | 29 window.secondHeaderText = tableheader.childAtIndex(1).childAtIndex(0).na
me; |
30 shouldBe("secondHeaderText", "'AXValue: header 2'"); | 30 shouldBe("secondHeaderText", "'header 2'"); |
31 | 31 |
32 // Clear the HTML for cleaner results. | 32 // Clear the HTML for cleaner results. |
33 document.getElementById("content").innerHTML = ""; | 33 document.getElementById("content").innerHTML = ""; |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 </script> | 37 </script> |
38 | 38 |
39 </body> | 39 </body> |
40 </html> | 40 </html> |
41 | |
OLD | NEW |