Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html b/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1b90c01a0257329f1e9f909dcc6b3e08f63c8c19 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/track-scroll.html |
| @@ -0,0 +1,47 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/js-test.js"></script> |
| +<style> |
| +body { |
| + height: 1800px; |
| +} |
| +</style> |
| +<body> |
| +<script> |
| +window.jsTestIsAsync = true; |
| + |
| +description("This test scrolls by clicking in the scrollbar track."); |
| + |
| +// Compute ScrollableArea::pageStep. |
| +var pageStep = innerHeight * 0.875; |
| +if (navigator.userAgent.indexOf("Mac OS X") >= 0) |
| + 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
|
| + |
| +onload = function() { |
| + if (!window.eventSender || !window.internals) { |
| + finishJSTest(); |
| + return; |
| + } |
| + |
| + // Turn on smooth scrolling. |
| + internals.settings.setScrollAnimatorEnabled(true); |
| + |
| + // Click in the vertical scrollbar track, below the thumb. |
| + eventSender.mouseMoveTo(790, 280); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| + |
| + // A second click should have no effect since we will be under the thumb |
| + // by the time the animation completes. |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| + |
| + shouldBecomeEqual("scrollY", "pageStep", function() { |
| + requestAnimationFrame(function() { |
| + // Make sure we stopped here. |
| + shouldBe("scrollY", "pageStep"); |
| + finishJSTest(); |
| + }); |
| + }); |
| +}; |
| +</script> |
| +</body> |