54fe575efec8b3a2c5d84c6fedf909dddf5f641a
[WebKit-https.git] / LayoutTests / platform / ios-simulator / accessibility / selected-buttons.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test-pre.js"></script>
5 <script>
6 var successfullyParsed = false;
7 if (window.testRunner)
8    testRunner.dumpAsText();
9 </script>
10 </head>
11 <body>
12
13 <div tabindex="0" id="button1" role="button" aria-selected="true">button 1</div>
14 <div tabindex="0" id="button2" role="button" aria-selected="false">button 2</div>
15
16 <div tabindex="0" id="tab1" role="tab" aria-selected="true">tab 1</div>
17 <div tabindex="0" id="tab2" role="tab" aria-selected="false">tab 2</div>
18
19 <p id="description"></p>
20 <div id="console"></div>
21
22 <script>
23
24     description("This tests that aria-selected behaves as expected (by returning the right traits) on tabs and buttons.");
25
26     if (window.accessibilityController) {
27
28         // Make sure a checkbox with a label DOES NOT have the same center point as the frame
29         document.getElementById("button1").focus();
30         var button1 = accessibilityController.focusedElement;
31         shouldBeTrue("button1.isSelected");
32
33         document.getElementById("button2").focus();
34         var button2 = accessibilityController.focusedElement;
35         shouldBeFalse("button2.isSelected");
36
37         document.getElementById("tab1").focus();
38         var tab1 = accessibilityController.focusedElement;
39         shouldBeTrue("tab1.isSelected");
40
41         document.getElementById("tab2").focus();
42         var tab2 = accessibilityController.focusedElement;
43         shouldBeFalse("tab2.isSelected");
44     }
45
46     successfullyParsed = true;
47 </script>
48
49 <script src="../../../resources/js-test-post.js"></script>
50
51 </body>
52 </html>
53