OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script> | |
3 function log(msg) { | |
4 document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); | |
5 } | |
6 | |
7 function test() { | |
8 if (window.testRunner) { | |
9 testRunner.waitUntilDone(); | |
10 testRunner.dumpAsText(); | |
11 testRunner.layoutAndPaintAsyncThen( | |
12 function() { | |
13 var iframe = document.getElementById('ScrollIFrame'); | |
14 var iframeDocument = iframe.contentDocument; | |
15 var textInIFrame = iframeDocument.getElementById('textInFrame'); | |
16 if (window.eventSender) { | |
17 var x = iframe.offsetLeft + textInIFrame.offsetLeft + 7; | |
18 var y = iframe.offsetTop + textInIFrame.offsetTop + 7; | |
19 eventSender.dragMode = false; | |
20 eventSender.mouseMoveTo(x, y); | |
21 eventSender.mouseDown(1); | |
22 eventSender.mouseMoveTo(x + 220, y + 220); | |
23 eventSender.mouseUp(1); | |
24 // Should avoid setTimeout and do the second part of the scro ll test in a better way. | |
25 setTimeout(autoscrollTestPart2, 100); | |
wkorman
2015/11/19 19:06:44
Did you try doing another layoutAndPaintAsyncThen(
ananta
2015/11/19 20:30:31
Done.
| |
26 } | |
27 }); | |
28 } | |
29 } | |
30 | |
31 function autoscrollTestPart2() { | |
32 if (!window.eventSender) | |
33 return; | |
34 var testCompleted = document.getElementById("testCompletedButton"); | |
35 var h = testCompleted.offsetTop - document.scrollingElement.scrollTop + 10; | |
36 eventSender.dragMode = false; | |
37 eventSender.mouseMoveTo(20, testCompleted.offsetTop); | |
38 eventSender.mouseDown(); | |
39 eventSender.mouseUp(); | |
40 setTimeout(testFailed, 100); | |
wkorman
2015/11/19 19:06:44
And try layoutAndPaintAsyncThen() here as well. Or
ananta
2015/11/19 20:30:31
Done.
| |
41 } | |
42 | |
43 function testFailed() { | |
44 if (window.testRunner) { | |
45 log("FAILED : the autoscroll has failed !"); | |
wkorman
2015/11/19 19:06:44
This only logs FAILED if testrunner exists, but be
ananta
2015/11/19 20:30:31
Done.
| |
46 testRunner.notifyDone(); | |
47 } | |
48 } | |
49 | |
50 function testCompleted() { | |
51 log("PASSED : the autoscroll has worked !"); | |
52 if (window.testRunner) | |
53 testRunner.notifyDone(); | |
54 } | |
55 </script> | |
56 | |
57 <body onload="test()"> | |
58 <p>Test for <a href="http://crbug.com/336373">bug 336373</a>.</p> | |
59 <p>To test manually, hold the middle mouse button on the box with scrollbars and scroll by dragging the mouse outside the bounds of the box. If the bug occu rs once the cursor leaves the bounds of the box it will remain stuck in the pann ing state.</p> | |
60 <div id="ScrollableIFrameDiv" style="height: 100px; width: 100px"> | |
61 <iframe id="ScrollIFrame" src="resources/iframe-with-overflow-scrollable -div.html" style="height: 100px; width: 100px"> | |
62 </iframe> | |
63 </div> | |
64 | |
65 <button id="testCompletedButton" type="button" onclick="testCompleted()"> Cl ick me </button> | |
66 | |
67 <div id="console"> </div> | |
68 </body> | |
69 </html> | |
OLD | NEW |