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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/panScroll-modal-scrollable-iframe-div.html

Issue 2289213002: Implement Middle Click Autoscroll on all platforms not just Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into panscroll Created 4 years, 3 months 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 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.mouseUp(1);
25 eventSender.mouseMoveTo(x + 220, y + 220);
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, h);
40 // This click exits the pan scroll mode.
41 eventSender.mouseDown();
42 eventSender.mouseUp();
43 // This click actually clicks the button.
44 eventSender.mouseDown();
45 eventSender.mouseUp();
46 testRunner.runAfterLayoutAndPaint(checkButtonClicked);
47 }
48
49 function checkButtonClicked() {
50 if (!button_was_clicked) {
51 debug("FAILED : the autoscroll has failed !");
52 if (window.testRunner)
53 testRunner.notifyDone();
54 }
55 }
56
57 function testCompleted() {
58 button_was_clicked = true;
59 debug("PASSED : the autoscroll has worked !");
60 if (window.testRunner)
61 testRunner.notifyDone();
62 }
63 </script>
64
65 <body onload="test()">
66 <p>Test for <a href="http://crbug.com/336373">bug 336373</a>.</p>
67 <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>
68
69 <div id="ScrollableIFrameDiv" style="height: 100px; width: 100px">
70 <iframe id="ScrollIFrame" src="resources/iframe-with-overflow-scrollable -div.html" style="height: 100px; width: 100px">
71 </iframe>
72 </div>
73
74 <button id="testCompletedButton" type="button" onclick="testCompleted()"> Cl ick me </button>
75 </body>
76 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698