[iOS Sim] Layout Test scrollingcoordinator/ios/ui-scroll-fixed.html is a flaky failure
[WebKit-https.git] / LayoutTests / fast / events / platform-wheelevent-paging-y-in-non-scrolling-page.html
1 <html>
2     <head>
3         <script src="../../resources/js-test-pre.js"></script>
4         <script>
5             var givenScrollTop = 2;
6             var givenScrollLeft = 0;
7             var expectedScrollTop = 0;
8             var expectedScrollLeft = 0;
9             var event;
10             var div;
11
12             if (window.testRunner)
13                 testRunner.waitUntilDone();
14
15             function dispatchWheelEvent()
16             {
17                 document.body.addEventListener("mousewheel", mousewheelHandler, false);
18
19                 if (window.eventSender) {
20                     eventSender.mouseMoveTo(100, 110);
21                     eventSender.continuousMouseScrollBy(-window.givenScrollLeft, -window.givenScrollTop, true);
22                 }
23
24                 setTimeout('checkOffsets();', 100);
25             }
26
27             function checkOffsets()
28             {
29                 shouldBe("document.scrollingElement.scrollTop", "window.expectedScrollTop");
30                 shouldBe("document.scrollingElement.scrollLeft", "window.expectedScrollLeft");
31
32                 if (window.testRunner)
33                     window.testRunner.notifyDone();
34             }
35
36             function mousewheelHandler(e)
37             {
38                                 event = e;
39                                 shouldBe("event.wheelDeltaY", "window.givenScrollTop * -3");
40                                 shouldBe("event.wheelDeltaX", "0");
41
42                                 if (e.wheelDeltaY)
43                                         shouldBe("event.wheelDelta", "window.givenScrollTop * -3");
44                                 else
45                                         shouldBe("event.wheelDelta", "0");
46             }
47         </script>
48     </head>
49
50     <body style="margin:0" onload="setTimeout('dispatchWheelEvent();', 100)">
51         <div style="height:200px;width:2400px">
52           <div style="background-color:red;height:200px;width:1200px;position:relative;left:0px;top:0px"></div>
53           <div style="background-color:green;height:200px;width:1200px;position:relative;left:1200px;top:-200px"></div>
54         </div>
55         <div style="height:200px;width:2400px">
56           <div style="background-color:blue;height:200px;width:1200px;position:relative;left:0px;top:0px"></div>
57           <div style="background-color:yellow;height:200px;width:1200px;position:relative;left:1200px;top:-200px"></div>
58         </div>
59         <div id="console"></div>
60     </body>
61 </html>