Improve some LayoutTests/inspector flakey output for tests with InspectorTest.reloadPage
[WebKit-https.git] / LayoutTests / accessibility / ios-simulator / radio-button.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
8 <input type="checkbox" id="checkbox">
9 <input id="radio1" type="radio" checked name="group">
10 <input id="radio2" type="radio" name="group">
11 <input id="radio3" type="radio" name="group">
12
13 <p id="description"></p>
14 <div id="console"></div>
15
16 <script>
17
18     description("This tests that radio buttons are exposed as distinct types from checkboxes, that they can report the right value whether it's checked, and they can report they're part of a group.");
19
20     if (window.accessibilityController) {
21
22         document.getElementById("checkbox").focus();
23         var checkbox = accessibilityController.focusedElement;
24
25         document.getElementById("radio1").focus();
26         var radio1 = accessibilityController.focusedElement;
27
28         document.getElementById("radio2").focus();
29         var radio2 = accessibilityController.focusedElement;
30
31         document.getElementById("radio3").focus();
32         var radio3 = accessibilityController.focusedElement;
33
34         // Verify checkbox and radio have different traits.
35         shouldBeTrue("checkbox.traits != radio1.traits");
36
37         // Verify the value of the checked radio item is correct.
38         shouldBe("radio1.stringValue", "'AXValue: 1'");
39         shouldBe("radio2.stringValue", "'AXValue: 0'");
40         shouldBe("radio3.stringValue", "'AXValue: 0'");
41
42         // Verify the radio buttons are part of a group.
43         shouldBe("radio1.rowIndexRange()", "'{0, 3}'");
44         shouldBe("radio2.rowIndexRange()", "'{1, 3}'");
45         shouldBe("radio3.rowIndexRange()", "'{2, 3}'");
46     }
47
48 </script>
49
50 <script src="../../resources/js-test-post.js"></script>
51 </body>
52 </html>