Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / table-header.html
blobb933b27eaba32cb9046ca150cb365de69e8aac22
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 </head>
6 <body id="body">
8 <div id="content">
10 <table id="table" border=1>
11 <tr><th>header 1</th><th>header 2</th></tr>
12 <tr><td>foo</td><td>bar</td></tr>
13 </table>
15 </div>
17 <script>
19 description("This tests that table headers are exposed for accessibility.");
21 if (window.accessibilityController) {
22 var table = accessibilityController.accessibleElementById("table");
23 shouldBe("table.rowCount", "2");
24 var tableheader = table.tableHeader();
25 shouldBeTrue("tableheader.isValid");
26 shouldBe("tableheader.childrenCount", "2");
27 window.firstHeaderText = tableheader.childAtIndex(0).childAtIndex(0).stringValue;
28 shouldBe("firstHeaderText", "'AXValue: header 1'");
29 window.secondHeaderText = tableheader.childAtIndex(1).childAtIndex(0).stringValue;
30 shouldBe("secondHeaderText", "'AXValue: header 2'");
32 // Clear the HTML for cleaner results.
33 document.getElementById("content").innerHTML = "";
37 </script>
39 </body>
40 </html>