Index: third_party/WebKit/LayoutTests/fast/events/autoscroll-scrollable-iframe-div.html |
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-scrollable-iframe-div.html b/third_party/WebKit/LayoutTests/fast/events/autoscroll-scrollable-iframe-div.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4f81b02d57175ba80f54422716ef319fd6673357 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-scrollable-iframe-div.html |
@@ -0,0 +1,72 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/js-test.js"> </script> |
+<script> |
+var button_was_clicked = false; |
+ |
+function test() { |
+ if (window.testRunner) { |
+ testRunner.waitUntilDone(); |
+ testRunner.dumpAsText(); |
+ testRunner.layoutAndPaintAsyncThen( |
+ function() { |
+ var iframe = document.getElementById('ScrollIFrame'); |
+ var iframeDocument = iframe.contentDocument; |
+ var textInIFrame = iframeDocument.getElementById('textInFrame'); |
+ if (window.eventSender) { |
+ debug("Starting Autoscroll test on iframe"); |
+ testRunner.layoutAndPaintAsyncThen( |
+ function() { |
+ var x = iframe.offsetLeft + textInIFrame.offsetLeft + 7; |
+ var y = iframe.offsetTop + textInIFrame.offsetTop + 7; |
+ eventSender.dragMode = false; |
+ eventSender.mouseMoveTo(x, y); |
+ eventSender.mouseDown(1); |
+ eventSender.mouseMoveTo(x + 220, y + 220); |
+ eventSender.mouseUp(1); |
+ testRunner.layoutAndPaintAsyncThen(autoscrollTestPart2); |
+ }); |
+ } |
+ }); |
+ } |
+} |
+ |
+function autoscrollTestPart2() { |
+ if (!window.eventSender) |
+ return; |
+ var testCompleted = document.getElementById("testCompletedButton"); |
+ var h = testCompleted.offsetTop - document.scrollingElement.scrollTop + 10; |
+ eventSender.dragMode = false; |
+ eventSender.mouseMoveTo(20, testCompleted.offsetTop); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ testRunner.runAfterLayoutAndPaint(checkButtonClicked); |
+} |
+ |
+function checkButtonClicked() { |
+ if (!button_was_clicked) { |
+ debug("FAILED : the autoscroll has failed !"); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ } |
+} |
+ |
+function testCompleted() { |
+ button_was_clicked = true; |
+ debug("PASSED : the autoscroll has worked !"); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+} |
+</script> |
+ |
+<body onload="test()"> |
+ <p>Test for <a href="http://crbug.com/336373">bug 336373</a>.</p> |
+ <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 occurs once the cursor leaves the bounds of the box it will remain stuck in the panning state.</p> |
+ |
+ <div id="ScrollableIFrameDiv" style="height: 100px; width: 100px"> |
+ <iframe id="ScrollIFrame" src="resources/iframe-with-overflow-scrollable-div.html" style="height: 100px; width: 100px"> |
+ </iframe> |
+ </div> |
+ |
+ <button id="testCompletedButton" type="button" onclick="testCompleted()"> Click me </button> |
+</body> |
+</html> |