Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1044)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll-interrupted.html

Issue 1678713002: Correctly handle cancelling compositor animations initiated from main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 input driven user scrolls get cancelled\
14 by non-input driven scrolls.");
15
16 function runTest() {
17 if (document.scrollingElement.scrollTop == 0) {
18 requestAnimationFrame(runTest);
19 } else {
20 // Programmatic scroll should cancel smooth scroll.
21 document.scrollingElement.scrollBy({top: 1, behavior: "smooth"});
22 shouldBecomeEqual("document.scrollingElement.scrollTop < 40 && " +
ajuma 2016/02/08 15:05:34 Won't this condition be true the first time it's c
ymalik 2016/02/08 18:41:23 Yes. I added some expectations to check that we're
23 "document.scrollingElement.scrollLeft == 0", "true", finishJSTest);
24 }
25 }
26
27 onload = function() {
28 if (!window.eventSender || !window.internals) {
29 finishJSTest();
30 return;
31 }
32
33 // Turn on smooth scrolling.
34 internals.settings.setScrollAnimatorEnabled(true);
35
36 document.scrollingElement.scrollTop = 0;
37
38 // Scroll down 1 tick (40px).
39 eventSender.mouseMoveTo(20, 20);
40 eventSender.mouseScrollBy(0, -1);
41
42 requestAnimationFrame(runTest);
43 }
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698