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..1d55a8b566c931924394921f4e83a0e9ffede73e 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,43 @@ |
<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 = []; |
+ 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 mousewheelHandler(e){}, false); |
skobes
2015/11/06 22:30:23
Function name (mousewheelHandler) is not needed.
ymalik
2015/11/07 04:22:27
Done.
|
+ |
+ window.scrollTo(-100, 100); |
+ testScrolls = [ |
skobes
2015/11/06 22:30:23
This can be moved to the declaration of testScroll
ymalik
2015/11/07 04:22:27
Done.
|
+ {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}, |
+ ]; |
+ 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> |