OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEven
t"> | 4 <link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEven
t"> |
5 <script src="../js/resources/js-test-pre.js"></script> | 5 <script src="../js/resources/js-test-pre.js"></script> |
6 <script> | 6 <script> |
7 var deltaX = 10; | 7 var deltaX = 10; |
8 var deltaY = 120; | 8 var deltaY = 120; |
9 | 9 |
10 var testDiv; | 10 var testDiv; |
(...skipping 14 matching lines...) Expand all Loading... |
25 eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5); | 25 eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5); |
26 eventSender.mouseScrollBy(deltaX, deltaY); | 26 eventSender.mouseScrollBy(deltaX, deltaY); |
27 } else { | 27 } else { |
28 debug("FAIL: This test requires window.eventSender."); | 28 debug("FAIL: This test requires window.eventSender."); |
29 finishJSTest(); | 29 finishJSTest(); |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 var testEvent; | 33 var testEvent; |
34 var tickMultiplier = 120; | 34 var tickMultiplier = 120; |
35 var expectedDeltaX = deltaX * tickMultiplier; | 35 var expectedDeltaX = -deltaX * tickMultiplier; |
36 var expectedDeltaY = deltaY * tickMultiplier; | 36 var expectedDeltaY = -deltaY * tickMultiplier; |
37 function wheelHandler(e) { | 37 function wheelHandler(e) { |
38 testEvent = e; | 38 testEvent = e; |
39 shouldBe("testEvent.__proto__", "WheelEvent.prototype"); | 39 shouldBe("testEvent.__proto__", "WheelEvent.prototype"); |
40 shouldBe("testEvent.__proto__.__proto__", "MouseEvent.prototype"); | 40 shouldBe("testEvent.__proto__.__proto__", "MouseEvent.prototype"); |
41 shouldBe("testEvent.deltaX", "expectedDeltaX"); | 41 shouldBe("testEvent.deltaX", "expectedDeltaX"); |
42 shouldBe("testEvent.deltaY", "expectedDeltaY"); | 42 shouldBe("testEvent.deltaY", "expectedDeltaY"); |
43 shouldBe("testEvent.deltaZ", "0"); | 43 shouldBe("testEvent.deltaZ", "0"); |
44 shouldBe("testEvent.deltaMode", "WheelEvent.DOM_DELTA_PIXEL") | 44 shouldBe("testEvent.deltaMode", "WheelEvent.DOM_DELTA_PIXEL") |
45 | 45 |
46 testDiv.removeEventListener("wheel", wheelHandler); | 46 testDiv.removeEventListener("wheel", wheelHandler); |
(...skipping 17 matching lines...) Expand all Loading... |
64 </span> | 64 </span> |
65 <script> | 65 <script> |
66 description("Tests the basic functionality of the standard wheel event"); | 66 description("Tests the basic functionality of the standard wheel event"); |
67 window.jsTestIsAsync = true; | 67 window.jsTestIsAsync = true; |
68 | 68 |
69 runTest(); | 69 runTest(); |
70 </script> | 70 </script> |
71 <script src="../js/resources/js-test-post.js"></script> | 71 <script src="../js/resources/js-test-post.js"></script> |
72 </body> | 72 </body> |
73 </html> | 73 </html> |
OLD | NEW |