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

Unified Diff: third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll-interrupted.html

Issue 1678713002: Correctly handle cancelling compositor animations initiated from main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll-interrupted.html
diff --git a/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll-interrupted.html b/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll-interrupted.html
new file mode 100644
index 0000000000000000000000000000000000000000..99395051c70ae74920a013f3f9dce5dae311110e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/scroll-behavior/smooth-scroll/mousewheel-scroll-interrupted.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+ body {
+ height: 2000px;
+ width: 2000px;
+ }
+</style>
+
+<script>
+window.jsTestIsAsync = true;
+
+description("This test ensures that input driven user scrolls get cancelled\
+ by non-input driven scrolls.");
+
+function runTest() {
+ if (document.scrollingElement.scrollTop == 0) {
+ requestAnimationFrame(runTest);
+ } else {
+ // Programmatic scroll should cancel smooth scroll.
+ document.scrollingElement.scrollBy({top: 1, behavior: "smooth"});
+ shouldBecomeEqual("document.scrollingElement.scrollTop < 40 && " +
ajuma 2016/02/08 15:05:34 Won't this condition be true the first time it's c
ymalik 2016/02/08 18:41:23 Yes. I added some expectations to check that we're
+ "document.scrollingElement.scrollLeft == 0", "true", finishJSTest);
+ }
+}
+
+onload = function() {
+ if (!window.eventSender || !window.internals) {
+ finishJSTest();
+ return;
+ }
+
+ // Turn on smooth scrolling.
+ internals.settings.setScrollAnimatorEnabled(true);
+
+ document.scrollingElement.scrollTop = 0;
+
+ // Scroll down 1 tick (40px).
+ eventSender.mouseMoveTo(20, 20);
+ eventSender.mouseScrollBy(0, -1);
+
+ requestAnimationFrame(runTest);
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698