OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"> </script> |
| 3 <script> |
| 4 var button_was_clicked = false; |
| 5 |
| 6 function test() { |
| 7 if (window.testRunner) { |
| 8 testRunner.waitUntilDone(); |
| 9 testRunner.dumpAsText(); |
| 10 testRunner.layoutAndPaintAsyncThen( |
| 11 function() { |
| 12 var iframe = document.getElementById('ScrollIFrame'); |
| 13 var iframeDocument = iframe.contentDocument; |
| 14 var textInIFrame = iframeDocument.getElementById('textInFrame'); |
| 15 if (window.eventSender) { |
| 16 debug("Starting Autoscroll test on iframe"); |
| 17 testRunner.layoutAndPaintAsyncThen( |
| 18 function() { |
| 19 var x = iframe.offsetLeft + textInIFrame.offsetLeft
+ 7; |
| 20 var y = iframe.offsetTop + textInIFrame.offsetTop +
7; |
| 21 eventSender.dragMode = false; |
| 22 eventSender.mouseMoveTo(x, y); |
| 23 eventSender.mouseDown(1); |
| 24 eventSender.mouseMoveTo(x + 220, y + 220); |
| 25 eventSender.mouseUp(1); |
| 26 testRunner.layoutAndPaintAsyncThen(autoscrollTestPar
t2); |
| 27 }); |
| 28 } |
| 29 }); |
| 30 } |
| 31 } |
| 32 |
| 33 function autoscrollTestPart2() { |
| 34 if (!window.eventSender) |
| 35 return; |
| 36 var testCompleted = document.getElementById("testCompletedButton"); |
| 37 var h = testCompleted.offsetTop - document.scrollingElement.scrollTop + 10; |
| 38 eventSender.dragMode = false; |
| 39 eventSender.mouseMoveTo(20, testCompleted.offsetTop); |
| 40 eventSender.mouseDown(); |
| 41 eventSender.mouseUp(); |
| 42 testRunner.runAfterLayoutAndPaint(checkButtonClicked); |
| 43 } |
| 44 |
| 45 function checkButtonClicked() { |
| 46 if (!button_was_clicked) { |
| 47 debug("FAILED : the autoscroll has failed !"); |
| 48 if (window.testRunner) |
| 49 testRunner.notifyDone(); |
| 50 } |
| 51 } |
| 52 |
| 53 function testCompleted() { |
| 54 button_was_clicked = true; |
| 55 debug("PASSED : the autoscroll has worked !"); |
| 56 if (window.testRunner) |
| 57 testRunner.notifyDone(); |
| 58 } |
| 59 </script> |
| 60 |
| 61 <body onload="test()"> |
| 62 <p>Test for <a href="http://crbug.com/336373">bug 336373</a>.</p> |
| 63 <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> |
| 64 |
| 65 <div id="ScrollableIFrameDiv" style="height: 100px; width: 100px"> |
| 66 <iframe id="ScrollIFrame" src="resources/iframe-with-overflow-scrollable
-div.html" style="height: 100px; width: 100px"> |
| 67 </iframe> |
| 68 </div> |
| 69 |
| 70 <button id="testCompletedButton" type="button" onclick="testCompleted()"> Cl
ick me </button> |
| 71 </body> |
| 72 </html> |
OLD | NEW |