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

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: Remove usage of setTimeout from the layout test 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script>
3 function log(msg) {
4 document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
skobes 2015/11/20 00:10:17 If you include ../../resources/js-test.js you can
ananta 2015/11/20 01:17:34 Done.
ananta 2015/11/20 01:17:34 Done.
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 testRunner.layoutAndPaintAsyncThen(
25 function() {
skobes 2015/11/20 00:10:17 more concisely: testRunner.layoutAndPaintAsyncTh
ananta 2015/11/20 01:17:34 Done.
ananta 2015/11/20 01:17:34 Done.
26 autoscrollTestPart2();
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(
43 function() {
44 testFailed();
skobes 2015/11/20 00:10:17 It's confusing to call testFailed here. Can you h
ananta 2015/11/20 01:17:34 Done.
ananta 2015/11/20 01:17:34 Done.
45 });;
46 }
47
48 function testFailed() {
49 log("FAILED : the autoscroll has failed !");
50 if (window.testRunner) {
51 testRunner.notifyDone();
52 }
53 }
54
55 function testCompleted() {
56 log("PASSED : the autoscroll has worked !");
57 if (window.testRunner)
58 testRunner.notifyDone();
59 }
60 </script>
61
62 <body onload="test()">
63 <p>Test for <a href="http://crbug.com/336373">bug 336373</a>.</p>
64 <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>
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">
wkorman 2015/11/19 22:13:55 A meta question -- based on the CL description, th
ananta 2015/11/19 22:32:01 I could not reproduce this reliably with just an o
skobes 2015/11/20 00:10:17 It would be nice to understand why the iframe is r
ananta 2015/11/20 01:17:34 For the non iframe case the autoscroll is stopped
67 </iframe>
68 </div>
69
70 <button id="testCompletedButton" type="button" onclick="testCompleted()"> Cl ick me </button>
71
72 <div id="console"> </div>
73 </body>
74 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698