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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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>
OLDNEW
« 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