3c4f588cc46bd4b87a96a60306ff37e41610c42f
[WebKit-https.git] / LayoutTests / accessibility / aria-tab-roles.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script>
5 var successfullyParsed = false;
6 </script>
7 <script src="../fast/js/resources/js-test-pre.js"></script>
8 </head>
9 <body id="body">
10
11 <ul id="tablist_1" role="tablist">
12 <li id="tab_1" role="tab" tabindex="0" class="">Crust</li>
13 <li id="tab_2" role="tab" tabindex="0" class="">Veges</li>
14 </ul>
15
16 <div id="panel_1" role="tabpanel" aria-labelledby="tab_1" >
17 <h3>Select Crust</h3>
18 </div>
19
20
21 <p id="description"></p>
22 <div id="console"></div>
23
24 <script>
25
26     description("This tests that the aria roles for tab, tabpanel and tablist work as expected correctly.");
27
28     if (window.accessibilityController) {
29
30           var body = document.getElementById("body");
31           body.focus();
32
33           var tabList = accessibilityController.focusedElement.childAtIndex(0);
34           var tab1 = tabList.childAtIndex(0);
35           var tab2 = tabList.childAtIndex(1);
36           var tabPanel = accessibilityController.focusedElement.childAtIndex(1);
37
38           shouldBe("tabList.role", "'AXRole: AXTabGroup'");
39           shouldBe("tab1.role", "'AXRole: AXRadioButton'");
40           shouldBe("tab1.title", "'AXTitle: Crust'");
41           shouldBe("tab1.childrenCount", "0");
42           shouldBe("tab2.role", "'AXRole: AXRadioButton'");
43           shouldBe("tab2.title", "'AXTitle: Veges'");
44           shouldBe("tabPanel.role", "'AXRole: AXGroup'");
45           shouldBe("tabPanel.subrole", "'AXSubrole: AXTabPanel'");
46     }
47
48     successfullyParsed = true;
49 </script>
50
51 <script src="../fast/js/resources/js-test-post.js"></script>
52 </body>
53 </html>