tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / platform / mac / accessibility / html-slider-indicator.html
1 <html>
2 <head>
3 <script src="../../../fast/js/resources/js-test-pre.js"></script>
4 </head>
5 <body id="body">
6
7 <input id="range1" type="range">
8
9 <p id="description"></p>
10 <div id="console"></div>
11 <div id="notifications"></div>
12
13 <script>
14
15     description("This tests that a basic range returns all the correct information for the mac platform.");
16     
17     var range = 0;
18     var valueChangeCount = 0;
19     function notificationCallback(notification) {
20         if (notification == "AXValueChanged") {
21            document.getElementById("notifications").innerHTML += "Successfully received " + notification + "<br>";
22            valueChangeCount++;
23         }
24
25         if (valueChangeCount == 2) {
26            range.removeNotificationListener();
27            window.layoutTestController.notifyDone();
28         }
29     }
30
31     if (window.accessibilityController) {
32         window.layoutTestController.waitUntilDone();
33
34         document.getElementById("range1").focus();
35         range = accessibilityController.focusedElement;
36         range.addNotificationListener(notificationCallback);
37
38         // Check that min/max/value return correct default values.
39         shouldBe("range.minValue", "0");
40         shouldBe("range.maxValue", "100");
41         shouldBe("range.intValue", "50");
42
43         // Check the value indicator returns a value.
44         var valueIndicator = range.childAtIndex(0);
45         shouldBe("valueIndicator.intValue", "50");
46         
47         // Check that incrementing/decrementing sends AXValueChange.
48         eventSender.keyDown("leftArrow");
49         shouldBe("range.intValue", "49");
50         shouldBe("valueIndicator.intValue", "49");
51
52         eventSender.keyDown("rightArrow");
53         shouldBe("range.intValue", "50");
54         shouldBe("valueIndicator.intValue", "50");
55
56         // Check that a hit test on the value indicator succeeds.
57         var hitTestIndicator = accessibilityController.elementAtPoint(range.x + range.width/2, range.y + range.height/2);
58         shouldBeTrue("valueIndicator.isEqual(hitTestIndicator)");
59
60         // Check that outside the indicator returns the slider.
61         var hitTestRange = accessibilityController.elementAtPoint(range.x + 1, range.y + range.height/2);
62         shouldBeTrue("range.isEqual(hitTestRange)");
63     }
64
65 </script>
66
67 <script src="../../../fast/js/resources/js-test-post.js"></script>
68 </body>
69 </html>