OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../../resources/js-test.js"></script> | |
3 <style> | |
4 body { | |
5 height: 1800px; | |
6 } | |
7 </style> | |
8 <body> | |
9 <script> | |
10 window.jsTestIsAsync = true; | |
11 | |
12 description("This test scrolls by clicking in the scrollbar track."); | |
13 | |
14 // Compute ScrollableArea::pageStep. | |
15 var pageStep = innerHeight * 0.875; | |
16 if (navigator.userAgent.indexOf("Mac OS X") >= 0) | |
17 pageStep = Math.max(pageStep, innerHeight - 40); | |
jbroman
2016/01/19 22:39:12
Unfortunate to have this hard-coded in a layout te
skobes
2016/01/19 23:44:14
In theory we could expose it through window.intern
| |
18 | |
19 onload = function() { | |
20 if (!window.eventSender || !window.internals) { | |
21 finishJSTest(); | |
22 return; | |
23 } | |
24 | |
25 // Turn on smooth scrolling. | |
26 internals.settings.setScrollAnimatorEnabled(true); | |
27 | |
28 // Click in the vertical scrollbar track, below the thumb. | |
29 eventSender.mouseMoveTo(790, 280); | |
30 eventSender.mouseDown(); | |
31 eventSender.mouseUp(); | |
32 | |
33 // A second click should have no effect since we will be under the thumb | |
34 // by the time the animation completes. | |
35 eventSender.mouseDown(); | |
36 eventSender.mouseUp(); | |
37 | |
38 shouldBecomeEqual("scrollY", "pageStep", function() { | |
39 requestAnimationFrame(function() { | |
40 // Make sure we stopped here. | |
41 shouldBe("scrollY", "pageStep"); | |
42 finishJSTest(); | |
43 }); | |
44 }); | |
45 }; | |
46 </script> | |
47 </body> | |
OLD | NEW |