REGRESSION(r174567): [GTK] Layout Tests platform/gtk/accessibility/aria-table-hierarc...
[WebKit-https.git] / LayoutTests / platform / gtk / accessibility / table-hierarchy.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test-pre.js"></script>
5 </head>
6 <body id="body">
7 <table>
8 <tr><td>foo</td><td>bar</td></tr>
9 </table>
10 <table>
11 <tr><th>Odd</th><th>Even</th></tr>
12 <tr><td>1</td><td>2</td></tr>
13 <tr><td>3</td><td>4</td></tr>
14 </table>
15 <table>
16 <tbody>
17 <tr><td>hello</td><td>world</td></tr>
18 </tbody>
19 </table>
20 <table border=1>
21 <tr><th>Odd</th><th>Even</th></tr>
22 <tr><td><p>1</p></td><td><p>2</p></td></tr>
23 <tr><td><p>3</p></td><td><p>4</p></td></tr>
24 </table>
25 <p id="description"></p>
26 <div id="console"></div>
27 <script>
28     description("This tests the Atk table hierarhy.");
29     if (window.accessibilityController) {
30         testRunner.dumpAsText();
31         document.getElementById("body").focus();
32         var webArea = accessibilityController.focusedElement;
33
34         var table1 = webArea.childAtIndex(0);
35         shouldBe("table1.role", "'AXRole: AXTable'");
36         shouldBe("table1.rowCount", "1");
37         shouldBe("table1.columnCount", "2");
38         var table2 = webArea.childAtIndex(1);
39         shouldBe("table2.role", "'AXRole: AXTable'");
40         shouldBe("table2.rowCount", "3");
41         shouldBe("table2.columnCount", "2");
42         var table3 = webArea.childAtIndex(2);
43         shouldBe("table3.role", "'AXRole: AXTable'");
44         shouldBe("table3.rowCount", "1");
45         shouldBe("table3.columnCount", "2");
46         var table4 = webArea.childAtIndex(3);
47         shouldBe("table4.role", "'AXRole: AXTable'");
48         shouldBe("table4.rowCount", "3");
49         shouldBe("table4.columnCount", "2");
50
51         var children = table1.childrenCount;
52         shouldBe("children", "2");
53         for (i = 0; i < children; ++i) {
54             shouldBe("table1.childAtIndex(i).role", "'AXRole: AXCell'");
55         }
56         children = table2.childrenCount;
57         shouldBe("children", "6");
58         shouldBe("table2.childAtIndex(0).role", "'AXRole: AXRowHeader'");
59         shouldBe("table2.childAtIndex(1).role", "'AXRole: AXRowHeader'");
60         for (i = 2; i < children; ++i) {
61             shouldBe("table2.childAtIndex(i).role", "'AXRole: AXCell'");
62         }
63         children = table3.childrenCount;
64         shouldBe("children", "2");
65         for (i = 0; i < children; ++i) {
66             shouldBe("table3.childAtIndex(i).role", "'AXRole: AXCell'");
67         }
68         children = table4.childrenCount;
69         shouldBe("children", "6");
70         shouldBe("table4.childAtIndex(0).role", "'AXRole: AXRowHeader'");
71         shouldBe("table4.childAtIndex(1).role", "'AXRole: AXRowHeader'");
72         for (i = 2; i < children; ++i) {
73             shouldBe("table4.childAtIndex(i).role", "'AXRole: AXCell'");
74         }
75     }
76 </script>
77 <script src="../../../resources/js-test-post.js"></script>
78 </body>
79 </html>