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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor.html
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor.html b/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor.html
new file mode 100644
index 0000000000000000000000000000000000000000..0393b40cec6be15f41788ae4ea17e66468fd4bfd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<script src="../../../../resources/js-test.js"></script>
+<style>
+body {
+ width: 2000px;
+ height: 2000px;
+}
+</style>
+
+<script>
+var jsTestIsAsync = true;
+
+description("This test verifies that the first programmatic smooth scroll " +
+ "doesn't always run on the main thread (see crbug.com/592799).");
+
+// From ScrollAnimatorCompositorCoordinator::RunState
+var RUNNING_ON_COMPOSITOR = "RunningOnCompositor";
+
+function runTest() {
+ if (document.scrollingElement.scrollTop == 0) {
+ requestAnimationFrame(runTest);
+ } else {
+ // Check that initiated by main thread and running on the compositor.
+ shouldBe("internals.getProgrammaticScrollAnimationState(document)",
+ "RUNNING_ON_COMPOSITOR")
+ shouldBecomeEqual("document.scrollingElement.scrollTop == 500",
+ "true", finishJSTest);
+ }
+}
+
+onload = function() {
+ if (!window.internals) {
+ debug("This test requires window.internals.");
+ finishJSTest();
+ return;
+ }
+
+ document.scrollingElement.scrollTop = 0;
+
+ window.scrollBy({top: 500, behavior: "smooth"});
+
+ runTest();
+};
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698