OLD | NEW |
1 <html dir=rtl style="-webkit-writing-mode:vertical-lr"> | 1 <html dir=rtl style="-webkit-writing-mode:vertical-lr"> |
2 <head> | |
3 <script src="../../resources/js-test.js"></script> | |
4 <script> | |
5 | 2 |
6 function log(str) | 3 <script src="../../resources/js-test.js"></script> |
7 { | 4 <script> |
8 var li = document.createElement("li"); | 5 var testScrolls = [ |
9 li.appendChild(document.createTextNode(str)); | 6 {x: -10, y: 0, expectedX: 110, expectedY: -100}, |
10 var console = document.getElementById("console"); | 7 {x: 30, y: 0, expectedX: 80, expectedY: -100}, |
11 console.appendChild(li); | 8 {x: 0, y: -10, expectedX: 80, expectedY: -90}, |
12 } | 9 {x: 0, y: 30, expectedX: 80, expectedY: -120}, |
13 | 10 ]; |
14 if (window.testRunner) { | 11 var currentTest = -1; |
15 testRunner.waitUntilDone(); | 12 window.jsTestIsAsync = true; |
16 } | |
17 | 13 |
18 function dispatchWheelEvent() | 14 function startNextTestCase() { |
19 { | 15 currentTest++; |
20 window.addEventListener("mousewheel", mousewheelHandler, false); | 16 if (currentTest >= testScrolls.length) { |
| 17 finishJSTest(); |
| 18 return; |
| 19 } |
| 20 var testCase = testScrolls[currentTest]; |
| 21 eventSender.mouseMoveTo(100, 100); |
| 22 eventSender.continuousMouseScrollBy(testCase.x, testCase.y); |
| 23 shouldBecomeEqual("window.scrollX == " + testCase.expectedX + " && " + |
| 24 "window.scrollY == " + testCase.expectedY, "true", startNextTestCase
); |
| 25 } |
21 | 26 |
22 window.scrollTo(100, -100); | 27 window.onload = function() { |
23 if (window.eventSender) { | 28 if (!window.testRunner) |
24 eventSender.mouseMoveTo(100, 100); | 29 return; |
25 eventSender.continuousMouseScrollBy(-10, 0); | 30 window.addEventListener("mousewheel", function (e){}, false); |
26 eventSender.continuousMouseScrollBy(30, 0); | 31 window.scrollTo(100, -100); |
27 eventSender.continuousMouseScrollBy(0, -10); | 32 startNextTestCase(); |
28 eventSender.continuousMouseScrollBy(0, 30); | 33 } |
29 } | 34 </script> |
30 | 35 |
31 setTimeout('checkOffsets();', 100); | 36 <body style="margin:0"> |
32 } | |
33 | 37 |
34 function checkOffsets() | 38 <div id="div" style="whitespace:nowrap; width: 4000px; height: 1000px; borde
r: 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 cillu
m dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proiden
t, sunt in culpa qui officia deserunt mollit anim id est laborum."</div> |
35 { | 39 <div id="console"></div> |
36 log("window.scrollX: " + window.scrollX); | 40 </body> |
37 log("window.scrollY: " + window.scrollY); | |
38 | |
39 if (window.testRunner) | |
40 window.testRunner.notifyDone(); | |
41 } | |
42 | |
43 function mousewheelHandler(e) | |
44 { | |
45 } | |
46 </script> | |
47 </head> | |
48 | |
49 <body style="margin:0" onload="setTimeout('dispatchWheelEvent();', 100)"> | |
50 | |
51 <div id="div" style="whitespace:nowrap; width: 4000px; height: 1000px; b
order: 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 m
inim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea com
modo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse c
illum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non pro
ident, sunt in culpa qui officia deserunt mollit anim id est laborum."</div> | |
52 <div id="console"></div> | |
53 </body> | |
54 </html> | 41 </html> |
OLD | NEW |