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