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

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: added layout test 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 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
19 function finishTest() {
20 requestAnimationFrame(function() {
21 // Check that main thread scrolling reason is removed.
22 shouldBe("internals.mainThreadScrollingReasons(document)" +
23 ".localeCompare('')", "0");
skobes 2016/02/05 19:31:43 Curious, why do you need localeCompare instead of
ymalik 2016/02/06 21:49:05 No good reason. Just remembered comparing strings
24 finishJSTest();
25 });
26 }
27
28 onload = function() {
29 if (!window.eventSender || !window.internals) {
30 debug("This test requires window.eventSender.")
31 finishJSTest();
32 return;
33 }
34 internals.settings.setScrollAnimatorEnabled(true);
35
36 // Scroll 1 ticks down.
37 eventSender.mouseMoveTo(20, 20);
38 eventSender.mouseScrollBy(0, -1);
39
40 requestAnimationFrame(function() {
41 // Check that main thread scrolling reason is added.
42 shouldBe("internals.mainThreadScrollingReasons(document)" +
43 ".localeCompare(ANIMATING_TEXT)", "0");
44 shouldBecomeEqual("document.scrollingElement.scrollTop == 40",
45 "true", finishTest);
46 });
47 };
48
49 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698