Improve some LayoutTests/inspector flakey output for tests with InspectorTest.reloadPage
[WebKit-https.git] / LayoutTests / accessibility / ios-simulator / centerpoint.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 <label for="check1">blah</label>
14
15 <input type="checkbox" id="check1">
16
17 <br><br>
18
19 <input type="checkbox" id="check2">
20
21 <p id="description"></p>
22 <div id="console"></div>
23
24 <script>
25
26     description("This tests that the center point for a checkbox with a label is not the same as the mid point of the frame (because the frame includes the bounds of the label)");
27
28     if (window.accessibilityController) {
29
30         // Make sure a checkbox with a label DOES NOT have the same center point as the frame
31         document.getElementById("check1").focus();
32         var pass = accessibilityController.focusedElement;
33
34         var clickPointX = pass.clickPointX;
35         var clickPointY = pass.clickPointY;
36
37         var x = pass.x;
38         var y = pass.y;
39         var w = pass.width;
40         var h = pass.height;
41
42         shouldBeFalse("(x + w/2) == clickPointX");
43         shouldBeFalse("(y + h/2) == clickPointY");
44
45         // Now make sure a checkbox without a label DOES have the same centerpoint as the frame
46         document.getElementById("check2").focus();
47         pass = accessibilityController.focusedElement;
48
49         var clickPointX = pass.clickPointX;
50         var clickPointY = pass.clickPointY;
51
52         var x = pass.x;
53         var y = pass.y;
54         var w = pass.width;
55         var h = pass.height;
56
57         shouldBeTrue("(x + w/2) == clickPointX");
58         shouldBeTrue("(y + h/2) == clickPointY");
59     }
60
61     successfullyParsed = true;
62 </script>
63
64 <script src="../../resources/js-test-post.js"></script>
65
66 </body>
67 </html>
68