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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/wheelevent-in-vertical-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-vertical-scrollbar-in-rtl.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html b/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html
index 86465755930c552ac099b6bc700e6f53281ff7ab..ada7d4a13cd631f175af47ddd6af47d9a59b1e58 100644
--- a/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html
+++ b/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html
@@ -1,54 +1,41 @@
<html dir=rtl style="-webkit-writing-mode:vertical-lr">
- <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: 110, expectedY: -100},
+ {x: 30, y: 0, expectedX: 80, expectedY: -100},
+ {x: 0, y: -10, expectedX: 80, expectedY: -90},
+ {x: 0, y: 30, expectedX: 80, expectedY: -120},
+ ];
+ 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