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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/panScroll-click-hyperlink.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/events/panScroll-click-hyperlink.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/panScroll-click-hyperlink.html b/third_party/WebKit/LayoutTests/fast/events/panScroll-click-hyperlink.html
deleted file mode 100644
index fba6022bd6c9b2e7254216cdb6f743bf4eb57944..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/events/panScroll-click-hyperlink.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-<script>
-window.jsTestIsAsync = true;
-if (window.testRunner)
- testRunner.waitUntilDone()
-
-var LeftMouseButton = 0;
-var MiddleMouseButton = 1;
-
-var testContainer;
-var didClickLink1 = false;
-
-window.onload = function()
-{
- testContainer = document.getElementById("test-container");
- if (window.testRunner)
- document.body.removeChild(document.getElementById("manual-instructions"));
- runTest();
-}
-
-function checkIfClickedLink1AndFinish()
-{
- if (didClickLink1)
- testFailed("Link 1 was clicked, but shouldn't have been.");
- else
- testPassed("Link 1 wasn't clicked.");
- finished();
-}
-
-function runTest()
-{
- if (!window.eventSender)
- return;
-
- eventSender.mouseMoveTo(testContainer.offsetLeft + 10, testContainer.offsetTop + 10);
- eventSender.mouseDown(MiddleMouseButton);
- eventSender.mouseUp(MiddleMouseButton);
- eventSender.mouseMoveTo(testContainer.offsetLeft + 10, testContainer.offsetTop + testContainer.offsetHeight);
- setTimeout(clickHyperlinksIfScrolledToBottomOtherwiseFail, 500); // 500ms should be reasonable to scroll to the bottom of the <div>.
-}
-
-function finished()
-{
- document.body.removeChild(document.getElementById("test-container"));
- finishJSTest();
-}
-
-function clickHyperlinksIfScrolledToBottomOtherwiseFail()
-{
- var didScrollToBottom = testContainer.scrollTop === testContainer.scrollHeight - testContainer.clientHeight;
- if (!didScrollToBottom) {
- testFailed("either pan scrolling is disabled or this platform doesn't support pan scrolling.");
- finished();
- return;
- }
-
- if (!window.eventSender)
- return;
-
- var firstLinkBoundingBox = document.getElementById("firstLink").getBoundingClientRect();
- var secondLinkBoundingBox = document.getElementById("secondLink").getBoundingClientRect();
- eventSender.mouseMoveTo(firstLinkBoundingBox.left + 10, firstLinkBoundingBox.top);
- eventSender.mouseDown(LeftMouseButton);
- eventSender.mouseUp(LeftMouseButton);
- eventSender.leapForward(100);
- eventSender.mouseMoveTo(secondLinkBoundingBox.left + 10, secondLinkBoundingBox.top);
- eventSender.mouseDown(LeftMouseButton);
- eventSender.mouseUp(LeftMouseButton);
-}
-</script>
-</head>
-<body>
-<p id="description"></p>
-<ol id="manual-instructions">
- <li>Middle-click inside the &lt;div&gt; with the red border below.</li>
- <li>Move the mouse such that you scroll the &lt;div&gt; until you see the hyperlinks &quot;Link 1&quot; and &quot;Link 2&quot;.</li>
- <li>Left-click the hyperlink &quot;Link 1&quot;.</li>
- <li>Left-click the hyperlink &quot;Link 2&quot;.</li>
-</ol>
-<div id="test-container" style="width:500px; height:100px; overflow:auto; border:2px solid red; padding:0px">
- <div id="dummy" style="height:200px"><!-- dummy element to overflow test-container --></div>
- <a id="firstLink" href="#" onclick="didClickLink1=true">Link 1</a> <a id="secondLink" href="#" onclick="checkIfClickedLink1AndFinish()">Link 2</a>
-</div>
-<div id="console"></div>
-<script>
- description("This test can be used to verify that clicking on a hyperlink is ignored when in pan scroll mode. <br/>" +
- "Note, this test is expected to fail on the Apple Mac and Chromium Mac port since they don't support pan scrolling.");
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698