| 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>
|
|
|