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

Side by Side Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/main-thread-scrolling-reason-added.html

Issue 1648293003: Fix smooth scroll jump when switching scroll handling between MT and CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: skip irrelevant test on mac Created 4 years, 9 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 width: 2000px;
6 height: 2000px;
7 }
8 </style>
9
10 <script>
11 var jsTestIsAsync = true;
12
13 description("This test verifies that smooth scrolls initiated on the main " +
14 "thread add the appropriate main thread scrolling reason.");
15
16 // From ScrollingCoordinator::mainThreadScrollingReasonsAsText.
17 var ANIMATING_TEXT = 'Animating scroll on main thread';
18 var RUNNING_ON_COMPOSITOR = 2;
19
20 function finishTest() {
21 requestAnimationFrame(function() {
22 // Check that main thread scrolling reason is removed.
23 shouldBeTrue("internals.mainThreadScrollingReasons(document) == ''");
24 finishJSTest();
25 });
26 }
27
28 function runTest() {
29 if (document.scrollingElement.scrollTop == 0) {
30 requestAnimationFrame(runTest);
31 } else {
32 // Check that initiated by main thread and running on the compositor.
33 shouldBeTrue("internals.getScrollAnimationState(document) " +
34 "== RUNNING_ON_COMPOSITOR");
35 // Check that main thread scrolling reason is added.
36 shouldBeTrue("internals.mainThreadScrollingReasons(document) " +
37 "== ANIMATING_TEXT");
38 shouldBecomeEqual("document.scrollingElement.scrollTop == 40",
39 "true", finishTest);
40 }
41 }
42
43 onload = function() {
44 if (!window.eventSender || !window.internals) {
45 debug("This test requires window.eventSender.")
46 finishJSTest();
47 return;
48 }
49 internals.settings.setScrollAnimatorEnabled(true);
50
51 document.scrollingElement.scrollTop = 0;
52
53 // Scroll 1 ticks down.
54 eventSender.mouseMoveTo(20, 20);
55 eventSender.mouseScrollBy(0, -1);
56 runTest();
57 };
58
59 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698