Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/hidpi/static/mousewheel-scroll-amount.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll.html b/third_party/WebKit/LayoutTests/fast/hidpi/static/mousewheel-scroll-amount.html |
| similarity index 55% |
| copy from third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll.html |
| copy to third_party/WebKit/LayoutTests/fast/hidpi/static/mousewheel-scroll-amount.html |
| index 222d0844487550356b5c05e49a43b4a7f3546c00..f5371e65ea849ea7a50844d2574637747cd50337 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll.html |
| +++ b/third_party/WebKit/LayoutTests/fast/hidpi/static/mousewheel-scroll-amount.html |
| @@ -1,6 +1,6 @@ |
| -<!DOCTYPE html> |
| +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../../resources/js-test.js"></script> |
| -<style> |
| +<style type="text/css"> |
| body { |
| height: 2000px; |
| width: 2000px; |
| @@ -9,11 +9,9 @@ |
| <script> |
| window.jsTestIsAsync = true; |
| + var dpr = window.devicePixelRatio; |
| - description("This test ensures that consecutive mouse wheel ticks scroll\ |
| - to the right offset. The main purpose of this test is to ensure that\ |
| - smooth scrolling on the compositor works as intended (tested via\ |
| - virtual suite virtual/threaded/)."); |
| + description("This test ensures that mouse wheel ticks scrolls the right amount pixels in high dpi mode."); |
|
tdresser
2016/03/03 16:21:51
scrolls the right amount pixels ->
scrolls the ri
oshima
2016/03/03 17:00:44
Done.
|
| function testDiagonalScroll() { |
| // Reset |
| @@ -21,17 +19,16 @@ |
| document.scrollingElement.scrollLeft = 0; |
| eventSender.mouseMoveTo(20, 20); |
| - // Scroll 3 ticks diagonally. |
| - eventSender.mouseScrollBy(-3, -3); |
| - // Undo 2 ticks in each direction. |
| - eventSender.mouseScrollBy(2, 2); |
| - // 40px per tick. |
| - shouldBecomeEqual("document.scrollingElement.scrollTop == 40 && " + |
| - "document.scrollingElement.scrollLeft == 40", "true", finishJSTest); |
| + // 1 tick should move 40px. |
| + eventSender.mouseScrollBy(-2 * dpr, -2 * dpr); |
| + |
| + shouldBecomeEqual("document.scrollingElement.scrollTop == 80 && " + |
| + "document.scrollingElement.scrollLeft == 80", "true", finishJSTest); |
| } |
| function runTest() { |
| if (!window.eventSender || !window.internals) { |
| + debug("This test requires window.eventSender and window.internals."); |
| finishJSTest(); |
| return; |
| } |
| @@ -40,19 +37,12 @@ |
| internals.settings.setScrollAnimatorEnabled(true); |
| eventSender.mouseMoveTo(20, 20); |
| - // Scroll down 3 ticks. |
| - eventSender.mouseScrollBy(0, -1); |
| - eventSender.mouseScrollBy(0, -2); |
| - // Scroll right 3 ticks. |
| - eventSender.mouseScrollBy(-1, 0); |
| - eventSender.mouseScrollBy(-2, 0); |
| - // Undo 1 tick in each direction. |
| - eventSender.mouseScrollBy(0, 1); |
| - eventSender.mouseScrollBy(1, 0); |
| + // 1 tick should move 40px. |
| + eventSender.mouseScrollBy(-dpr, -dpr); |
| // 40px per tick. |
| - shouldBecomeEqual("document.scrollingElement.scrollTop == 80 && " + |
| - "document.scrollingElement.scrollLeft == 80", "true", testDiagonalScroll); |
| + shouldBecomeEqual("document.scrollingElement.scrollTop == 40 && " + |
| + "document.scrollingElement.scrollLeft == 40", "true", testDiagonalScroll); |
| } |
| </script> |