| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../../resources/js-test.js"></script> | |
| 3 <style> | |
| 4 body { | |
| 5 height: 2000px; | |
| 6 width: 2000px; | |
| 7 } | |
| 8 </style> | |
| 9 | |
| 10 <script> | |
| 11 window.jsTestIsAsync = true; | |
| 12 | |
| 13 description("This test ensures that consecutive mouse wheel ticks scroll\ | |
| 14 to the right offset. The main purpose of this test is to ensure that\ | |
| 15 smooth scrolling on the compositor works as intended (tested via\ | |
| 16 virtual suite virtual/threaded/)."); | |
| 17 | |
| 18 function runTest() { | |
| 19 if (!window.eventSender || !window.internals) { | |
| 20 finishJSTest(); | |
| 21 return; | |
| 22 } | |
| 23 | |
| 24 // Turn on smooth scrolling. | |
| 25 internals.settings.setScrollAnimatorEnabled(true); | |
| 26 | |
| 27 eventSender.mouseMoveTo(20, 20); | |
| 28 // Scroll down 3 ticks. | |
| 29 eventSender.mouseScrollBy(0, -1); | |
| 30 eventSender.mouseScrollBy(0, -1); | |
| 31 eventSender.mouseScrollBy(0, -1); | |
| 32 // Scroll right 3 ticks. | |
| 33 eventSender.mouseScrollBy(-1, 0); | |
| 34 eventSender.mouseScrollBy(-1, 0); | |
| 35 eventSender.mouseScrollBy(-1, 0); | |
| 36 // Undo 1 tick in each direction. | |
| 37 eventSender.mouseScrollBy(0, 1); | |
| 38 eventSender.mouseScrollBy(1, 0); | |
| 39 | |
| 40 // 40px per tick. | |
| 41 shouldBecomeEqual("document.scrollingElement.scrollTop == 80 && " + | |
| 42 "document.scrollingElement.scrollLeft == 80", "true", finishJSTest); | |
| 43 } | |
| 44 </script> | |
| 45 | |
| 46 <body onload="runTest()"></body> | |
| OLD | NEW |