Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: third_party/WebKit/LayoutTests/fast/events/autoscroll-scrollable-iframe-div.html

Issue 1461473002: Ensure that the auto scroll state in the AutoscrollController is cleared if the scroll operation cl… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add layouttests Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/autoscroll-scrollable-iframe-div-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2aaeeaaf8aa39a79ca53bda07fbe7008d052a282
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-scrollable-iframe-div.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<script>
+function log(msg) {
+ document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
+}
+
+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) {
+ 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);
+ // Should avoid setTimeout and do the second part of the scroll test in a better way.
+ setTimeout(autoscrollTestPart2, 100);
wkorman 2015/11/19 19:06:44 Did you try doing another layoutAndPaintAsyncThen(
ananta 2015/11/19 20:30:31 Done.
+ }
+ });
+ }
+}
+
+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();
+ 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.
+}
+
+function testFailed() {
+ if (window.testRunner) {
+ 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.
+ testRunner.notifyDone();
+ }
+}
+
+function testCompleted() {
+ log("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>
+
+ <div id="console"> </div>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/autoscroll-scrollable-iframe-div-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698