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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html

Issue 1413493005: Update layout tests to work when smooth scrolling is enabled by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: worked on nit 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
Index: third_party/WebKit/LayoutTests/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html b/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html
index fd88b28434c5d2aeba8979a503b499888c8f4c51..2aa27f6a4e3a67381d17429c868583c0baf780bc 100644
--- a/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html
+++ b/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html
@@ -1,55 +1,40 @@
<html dir=rtl>
- <head>
- <script src="../../resources/js-test.js"></script>
- <script>
- function log(str)
- {
- var li = document.createElement("li");
- li.appendChild(document.createTextNode(str));
- var console = document.getElementById("console");
- console.appendChild(li);
- }
-
-
- if (window.testRunner) {
- testRunner.waitUntilDone();
- }
-
- function dispatchWheelEvent()
- {
- window.addEventListener("mousewheel", mousewheelHandler, false);
-
- window.scrollTo(-100, 100);
- if (window.eventSender) {
- eventSender.mouseMoveTo(100, 100);
- eventSender.continuousMouseScrollBy(-10, 0);
- eventSender.continuousMouseScrollBy(30, 0);
- eventSender.continuousMouseScrollBy(0, -10);
- eventSender.continuousMouseScrollBy(0, 30);
- }
-
- setTimeout('checkOffsets();', 100);
- }
-
- function checkOffsets()
- {
- log("window.scrollX: " + window.scrollX);
- log("window.scrollY: " + window.scrollY);
-
- if (window.testRunner)
- window.testRunner.notifyDone();
- }
-
- function mousewheelHandler(e)
- {
- }
- </script>
- </head>
-
- <body style="margin:0" onload="setTimeout('dispatchWheelEvent();', 100)">
-
- <div id="div" style="whitespace:nowrap; width: 4000px; height: 1000px; border: 1px solid red;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</div>
- <div id="console"></div>
- </body>
+<script src="../../resources/js-test.js"></script>
+<script>
+ var testScrolls = [
+ {x: -10, y: 0, expectedX: -90, expectedY: 100},
+ {x: 30, y: 0, expectedX: -120, expectedY: 100},
+ {x: 0, y: -10, expectedX: -120, expectedY: 110},
+ {x: 0, y: 30, expectedX: -120, expectedY: 80},
+ ];
+ var currentTest = -1;
+ window.jsTestIsAsync = true;
+
+ function startNextTestCase() {
+ currentTest++;
+ if (currentTest >= testScrolls.length) {
+ finishJSTest();
+ return;
+ }
+ var testCase = testScrolls[currentTest];
+ eventSender.mouseMoveTo(100, 100);
+ eventSender.continuousMouseScrollBy(testCase.x, testCase.y);
+ shouldBecomeEqual("window.scrollX == " + testCase.expectedX + " && " +
+ "window.scrollY == " + testCase.expectedY, "true", startNextTestCase);
+ }
+
+ window.onload = function() {
+ if (!window.testRunner)
+ return;
+ window.addEventListener("mousewheel", function (e){}, false);
+ window.scrollTo(-100, 100);
+ startNextTestCase();
+ }
+</script>
+
+<body style="margin:0">
+ <div id="div" style="whitespace:nowrap; width: 4000px; height: 1000px; border: 1px solid red;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</div>
+ <div id="console"></div>
+</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698