Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / range / slider-mouse-events.html
bloba0dce8bee450b1592e1624ce016bbb40f8503a3b
1 <html>
2 <head>
3 <script>
4 function log(msg)
6 var res = document.getElementById('res');
7 res.innerHTML = res.innerHTML + msg + "<br>";
9 function test()
11 var slider = document.getElementById('slider');
12 if (window.testRunner) {
13 testRunner.dumpAsText();
14 eventSender.mouseMoveTo(slider.offsetLeft + 7, slider.offsetTop + 7);
15 eventSender.mouseDown();
16 log(slider.value)
17 eventSender.mouseMoveTo(slider.offsetLeft + 50, slider.offsetTop + 50);
18 eventSender.mouseUp();
19 log(slider.value)
21 // Try to click outside the slider thumb and drag.
22 eventSender.mouseMoveTo(slider.offsetLeft + 10, slider.offsetTop + 10);
23 eventSender.mouseDown();
24 log(slider.value)
25 eventSender.mouseMoveTo(slider.offsetLeft + 30, slider.offsetTop + 30);
26 eventSender.mouseUp();
27 log(slider.value)
30 </script>
31 </head>
32 <body onload="test()">
33 This tests that slider controls get mousedown, mousemove, input, and mouseup events and properly set its value.<br>
34 <input type="range" id="slider" onmousedown="log('mousedown')" onmouseup="log('mouseup')" onmousemove="log('mousemove')" oninput="log('input')" value=0 step=5>
35 <div id="res"></div>
36 </body>
37 </html>