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

Side by Side Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor.html

Issue 1801753002: First programmatic smooth scroll should run on the compositor if it can (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bot compile error 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 the first programmatic smooth scroll " +
14 "doesn't always run on the main thread (see crbug.com/592799).");
15
16 // From ScrollAnimatorCompositorCoordinator::RunState
17 var RUNNING_ON_COMPOSITOR = "RunningOnCompositor";
18
19 function runTest() {
20 if (document.scrollingElement.scrollTop == 0) {
21 requestAnimationFrame(runTest);
22 } else {
23 // Check that initiated by main thread and running on the compositor.
24 shouldBe("internals.getProgrammaticScrollAnimationState(document)",
25 "RUNNING_ON_COMPOSITOR")
26 shouldBecomeEqual("document.scrollingElement.scrollTop == 500",
27 "true", finishJSTest);
28 }
29 }
30
31 onload = function() {
32 if (!window.internals) {
33 debug("This test requires window.internals.");
34 finishJSTest();
35 return;
36 }
37
38 document.scrollingElement.scrollTop = 0;
39
40 window.scrollBy({top: 500, behavior: "smooth"});
41
42 runTest();
43 };
44
45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698