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

Unified Diff: cc/input/scrollbar_animation_controller_thinning_unittest.cc

Issue 2688503003: Add FadeOut delay animation to MouseLeave (Closed)
Patch Set: update comment Created 3 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
« no previous file with comments | « cc/input/scrollbar_animation_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/scrollbar_animation_controller_thinning_unittest.cc
diff --git a/cc/input/scrollbar_animation_controller_thinning_unittest.cc b/cc/input/scrollbar_animation_controller_thinning_unittest.cc
index 384dbf244b096b98179faadbf722f162e1aa54f0..f238b8b986b051de542409b8bd8b1d02f898f090 100644
--- a/cc/input/scrollbar_animation_controller_thinning_unittest.cc
+++ b/cc/input/scrollbar_animation_controller_thinning_unittest.cc
@@ -946,5 +946,31 @@ TEST_F(ScrollbarAnimationControllerThinningTest,
EXPECT_EQ(kDelayBeforeStarting, client_.delay());
}
+// Ensure we have a delay fadeout animation after mouse leave without a mouse
+// move.
+TEST_F(ScrollbarAnimationControllerThinningTest, MouseLeaveFadeOut) {
+ base::TimeTicks time;
+ time += base::TimeDelta::FromSeconds(1);
+
+ // Move mouse near scrollbar.
+ scrollbar_controller_->DidMouseMoveNear(VERTICAL, 1);
+
+ // Scroll to make the scrollbars visible.
+ scrollbar_controller_->DidScrollBegin();
+ scrollbar_controller_->DidScrollUpdate(false);
+ scrollbar_controller_->DidScrollEnd();
+
+ // Should not have delay fadeout animation.
+ EXPECT_TRUE(client_.start_fade().is_null() ||
+ client_.start_fade().IsCancelled());
+
+ // Mouse leave.
+ scrollbar_controller_->DidMouseLeave();
+
+ // An animation should have been enqueued.
+ EXPECT_FALSE(client_.start_fade().is_null());
+ EXPECT_EQ(kDelayBeforeStarting, client_.delay());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/input/scrollbar_animation_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698