3 <script src="../../../fast/js/resources/js-test-pre.js"></script>
7 <input id="range1" type="range">
9 <p id="description"></p>
10 <div id="console"></div>
11 <div id="notifications"></div>
15 description("This tests that a basic range returns all the correct information for the mac platform.");
18 var valueChangeCount = 0;
19 function notificationCallback(notification) {
20 if (notification == "AXValueChanged") {
21 document.getElementById("notifications").innerHTML += "Successfully received " + notification + "<br>";
25 if (valueChangeCount == 2) {
26 range.removeNotificationListener();
27 window.layoutTestController.notifyDone();
31 if (window.accessibilityController) {
32 window.layoutTestController.waitUntilDone();
34 document.getElementById("range1").focus();
35 range = accessibilityController.focusedElement;
36 range.addNotificationListener(notificationCallback);
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");
43 // Check the value indicator returns a value.
44 var valueIndicator = range.childAtIndex(0);
45 shouldBe("valueIndicator.intValue", "50");
47 // Check that incrementing/decrementing sends AXValueChange.
48 eventSender.keyDown("leftArrow");
49 shouldBe("range.intValue", "49");
50 shouldBe("valueIndicator.intValue", "49");
52 eventSender.keyDown("rightArrow");
53 shouldBe("range.intValue", "50");
54 shouldBe("valueIndicator.intValue", "50");
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)");
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)");
67 <script src="../../../fast/js/resources/js-test-post.js"></script>