Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / autoscroll-in-textfield.html
blobe396e55490b9b8a72b53d0a85e6e927d7d33e5b6
1 <html>
2 <head>
3 <script>
4 function log(msg)
6 document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
9 function test()
11 if (window.testRunner) {
12 testRunner.waitUntilDone();
13 testRunner.dumpAsText();
14 setTimeout(autoscrollTestPart1, 0);
18 function autoscrollTestPart1()
20 var input = document.getElementById('shortTextField');
21 if (window.eventSender) {
22 var x = input.offsetLeft + 7;
23 var y = input.offsetTop + 7;
24 eventSender.dragMode = false;
25 eventSender.mouseMoveTo(x, y);
26 eventSender.mouseDown();
27 eventSender.mouseMoveTo(x + 20, y);
28 eventSender.mouseMoveTo(x + 600, y);
30 setTimeout(autoscrollTestPart2, 100);
33 function autoscrollTestPart2()
35 if (window.eventSender)
36 eventSender.mouseUp();
38 var input = document.getElementById('shortTextField');
39 if (input.scrollLeft == 0)
40 log("FAILED the textfield should have been scrolled");
41 else
42 log("PASSED");
44 if (window.testRunner)
45 testRunner.notifyDone();
47 </script>
48 </head>
49 <body onload="test()">
50 <div id="console">
51 <input id="shortTextField" value="This text should be autoscrollable and if it doesn't then the test failed" size="25">
52 https://bugs.webkit.org/show_bug.cgi?id=20201 <br>
53 To do the test manually you have to try triggering the autoscroll by starting the dragging from within the text field and moving to the right. If the autoscroll occurs the test has PASSED.<br>
54 </div>
56 </body>
57 </html>