Move /platform/ios-simulator/accessibility tests to accessibility/ios-simulator/
[WebKit-https.git] / LayoutTests / tiled-drawing / scrolling / overflow-scroll-zero-delta-wheel-events.html
1 <html>
2 <head>
3 <style>
4 #scrolly {
5     height: 400px;
6     width: 200px;
7     border: 1px solid blue;
8
9     overflow-x: hidden;
10     overflow-y: auto;
11 }
12
13 #content {
14     height: 2000px;
15 }
16 </style>
17
18 <script src="../../resources/js-test-pre.js"></script>
19 <script>
20
21 var deltaOfZero = false;
22
23 function checkForZero()
24 {
25     if (deltaOfZero)
26         testFailed("Wheel events with zero delta were sent to the DOM. ");
27     else
28         testPassed("Wheel events with delta of zero were not sent to the DOM.");
29
30     testRunner.notifyDone();
31 }
32
33 function didScroll(event) {
34     if (event.wheelDeltaX == 0 && event.wheelDeltaY == 0)
35         deltaOfZero = true;
36 }
37
38 function scrollTest()
39 {
40     var startPosX = 100;
41     var startPosY = 100;
42     eventSender.mouseMoveTo(startPosX, startPosY);
43     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
44     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
45     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
46     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
47     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
48     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
49     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
50     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
51     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
52     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
53     eventSender.callAfterScrollingCompletes(checkForZero);
54 }
55
56 function setUp() {
57     var scrolly = document.getElementById("scrolly");
58     scrolly.addEventListener("mousewheel", didScroll);
59
60     if (window.eventSender) {
61         testRunner.dumpAsText();
62         testRunner.waitUntilDone();
63
64         eventSender.monitorWheelEvents();
65         setTimeout(scrollTest, 0);
66     }
67 }
68 </script>
69 </head>
70
71 <body onload="setUp();">
72
73 <div id="scrolly">
74     <div id="content"></div>
75 </div>
76 </body>
77 </html>
78