OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
4 <script> | 4 <script> |
5 window.jsTestIsAsync = true; | 5 window.jsTestIsAsync = true; |
6 var expectedScrollTop = 200; | 6 var expectedScrollTop = 200; |
7 var expectedScrollLeft = 100; | 7 var expectedScrollLeft = 100; |
8 var event; | 8 var event; |
9 var div; | 9 var div; |
10 | 10 |
11 function runTest() | 11 function runTest() |
12 { | 12 { |
13 var overflowElement = document.getElementById("overflow"); | 13 var overflowElement = document.getElementById("overflow"); |
14 if (overflowElement) { | 14 if (overflowElement) { |
15 overflowElement.addEventListener("mousewheel", mousewheelHan
dler, false); | 15 overflowElement.addEventListener("mousewheel", mousewheelHan
dler, false); |
16 | 16 |
17 // EventSender uses 40px per tick. | 17 // EventSender uses 40px per tick. |
18 eventSender.mouseMoveTo(overflowElement.offsetLeft + 5, over
flowElement.offsetTop + 5); | 18 eventSender.mouseMoveTo(overflowElement.offsetLeft + 5, over
flowElement.offsetTop + 5); |
19 eventSender.mouseScrollBy(-2.5, -5); | 19 eventSender.mouseScrollBy(-2.5, -5, false, true, 0, true, "p
haseBegan"); |
20 } | 20 } |
21 | 21 |
22 div = document.getElementById("overflow"); | 22 div = document.getElementById("overflow"); |
23 shouldBecomeEqual("div.scrollTop == window.expectedScrollTop &&
" + | 23 shouldBecomeEqual("div.scrollTop == window.expectedScrollTop &&
" + |
24 "div.scrollLeft == window.expectedScrollLeft", "true", finis
hJSTest); | 24 "div.scrollLeft == window.expectedScrollLeft", "true", finis
hJSTest); |
25 } | 25 } |
26 | 26 |
27 function mousewheelHandler(e) | 27 function mousewheelHandler(e) |
28 { | 28 { |
29 event = e; | 29 event = e; |
(...skipping 12 matching lines...) Expand all Loading... |
42 | 42 |
43 <body style="margin:0" onload="runTest()"> | 43 <body style="margin:0" onload="runTest()"> |
44 <div id="overflow" style="border:2px solid black;overflow:auto;height:20
0px;width:200px;"> | 44 <div id="overflow" style="border:2px solid black;overflow:auto;height:20
0px;width:200px;"> |
45 <div style="background-color:red;height:200px;width:400px;"></div> | 45 <div style="background-color:red;height:200px;width:400px;"></div> |
46 <div style="background-color:green;height:200px;width:400px;"></div> | 46 <div style="background-color:green;height:200px;width:400px;"></div> |
47 <div style="background-color:red;height:200px;width:400px;"></div> | 47 <div style="background-color:red;height:200px;width:400px;"></div> |
48 </div> | 48 </div> |
49 <div id="console"></div> | 49 <div id="console"></div> |
50 </body> | 50 </body> |
51 </html> | 51 </html> |
OLD | NEW |