9c465ebfa6c25ef565a44695d0e64b4516651797
[WebKit-https.git] / LayoutTests / platform / mac-wk2 / tiled-drawing / scrolling / root-overflow-with-mousewheel.html
1 <html>
2 <head>
3 <style>
4 html {
5     height: 2000px;
6     overflow: scroll;
7 }
8 </style>
9
10 <script>
11 function checkForScroll()
12 {
13     var pageScrollPositionAfter = document.body.scrollTop;
14     var finishLog = document.getElementById("finishLog");
15     if (pageScrollPositionAfter > 50)
16         finishLog.innerHTML = "Success!";
17     else
18         finishLog.innerHTML = "Failure. Try running the test manually. If this proves to be flakey, and we might have to skip it.";
19     testRunner.notifyDone();
20 }
21
22 function scrollTest()
23 {
24     eventSender.mouseMoveTo(50, 50);
25     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
26     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
27     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
28     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
29     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
30     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
31     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
32     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
33     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
34     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
35     eventSender.callAfterScrollingCompletes(checkForScroll);
36 }
37
38 function onLoad() {
39     window.addEventListener('mousewheel', function() { }, false);
40
41     if (window.eventSender) {
42         testRunner.dumpAsText();
43         testRunner.waitUntilDone();
44         eventSender.monitorWheelEvents();
45         setTimeout(scrollTest, 0);
46     }
47 }
48 </script>
49 </head>
50
51 <body onload="onLoad();">
52     <pre id="finishLog">This test passes if you can scroll the page.</pre>
53 </body>
54 </html>