DumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testR...
[WebKit-https.git] / LayoutTests / fast / events / platform-wheelevent-paging-y-in-non-scrolling-div.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 pixelsPerWheelTick = 40;
10             var event;
11             var div;
12
13             if (window.testRunner)
14                 testRunner.waitUntilDone();
15
16             function dispatchWheelEvent()
17             {
18                 var overflowElement = document.getElementById("overflow");
19                 if (overflowElement)
20                     overflowElement.addEventListener("mousewheel", mousewheelHandler, false);
21
22                 if (window.eventSender) {
23                     eventSender.mouseMoveTo(100, 110);
24                     eventSender.continuousMouseScrollBy(-window.givenScrollLeft, -window.givenScrollTop, true);
25                 }
26
27                 setTimeout('checkOffsets();', 100);
28             }
29
30             function checkOffsets()
31             {
32                 div = document.getElementById("overflow");
33                 shouldBe("div.scrollTop", "window.expectedScrollTop");
34                 shouldBe("div.scrollLeft", "window.expectedScrollLeft");
35
36                 if (window.testRunner)
37                     window.testRunner.notifyDone();
38             }
39
40             function mousewheelHandler(e)
41             {
42                 event = e;
43                 shouldBe("event.wheelDeltaY", "window.givenScrollTop*-3");
44                 shouldBe("event.wheelDeltaX", "0");
45
46                 if (e.wheelDeltaY)
47                     shouldBe("event.wheelDelta", "window.givenScrollTop*-3");
48                 else
49                     shouldBe("event.wheelDelta", "0");
50             }
51         </script>
52     </head>
53
54     <body style="margin:0" onload="setTimeout('dispatchWheelEvent();', 100)">
55         <div id="overflow" style="border:2px solid black;overflow:auto;white-space:nowrap;height:200px;width:200px;">
56         <div style="height:185px;width:600px;">
57           <div style="border:0px;background-color:red;height:181px;width:300px;display:inline-block;"></div>
58           <div style="border:0px;background-color:green;height:181px;width:300px;display:inline-block;"></div>
59         </div>
60         </div>
61         <div id="console"></div>
62     </body>
63 </html>