blob: 248c0366bc9774b9944b242b282cb089a23010ea [file] [log] [blame]
<!DOCTYPE html>
<p>This test verifies that updating the slider for an input element with type=range fires a change event.</p>
<!-- See bug 84674 -->
<input id="slider" type="range" min="0" max="3" value="0"></input>
<pre id="console"></pre>
<script src="../../resources/js-test.js"></script>
var receivedChangeEvent = false;
var slider;
function onChange(e)
testPassed('Change event fired.');
receivedChangeEvent = true;
shouldBeEqualToString("slider.value", "0");
window.onload = function()
if (!window.testRunner)
slider = document.getElementById("slider");
slider.addEventListener("change", onChange);
// Programmatically changing an input value should not fire a change event.
slider.value = 1;
// Changing back to original value should fire a change event.
var x = slider.offsetLeft + 1;
var y = slider.offsetTop + slider.clientHeight / 2;
eventSender.mouseMoveTo(x, y);
if (!receivedChangeEvent)
testFailed('Change event not fired.');