6 <p>This test verifies that updating the slider for an input element with type=range fires a change event.
</p>
9 <input id=
"slider" type=
"range" min=
"0" max=
"3" value=
"0"></input>
10 <pre id=
"console"></pre>
11 <script src=
"../../resources/js-test.js"></script>
13 var receivedChangeEvent
= false;
18 testPassed('Change event fired.');
19 receivedChangeEvent
= true;
20 shouldBeEqualToString("slider.value", "0");
23 window
.onload = function()
25 if (!window
.testRunner
)
28 slider
= document
.getElementById("slider");
29 slider
.addEventListener("change", onChange
);
31 // Programmatically changing an input value should not fire a change event.
34 // Changing back to original value should fire a change event.
35 var x
= slider
.offsetLeft
+ 1;
36 var y
= slider
.offsetTop
+ slider
.clientHeight
/ 2;
38 eventSender
.mouseMoveTo(x
, y
);
39 eventSender
.mouseDown();
40 eventSender
.mouseUp();
42 if (!receivedChangeEvent
)
43 testFailed('Change event not fired.');