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

Unified Diff: cc/input/scrollbar_animation_controller_unittest.cc

Issue 2735603002: Call delay_show Cancel in ScrollbarAnimationControlller::Show (Closed)
Patch Set: rebase Created 3 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
« 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_unittest.cc
diff --git a/cc/input/scrollbar_animation_controller_unittest.cc b/cc/input/scrollbar_animation_controller_unittest.cc
index c8ee16ecf75143394872b5a4edbb8c9e92bda832..3d0855e65e1adeedc1842b264b4b39454ce6c77e 100644
--- a/cc/input/scrollbar_animation_controller_unittest.cc
+++ b/cc/input/scrollbar_animation_controller_unittest.cc
@@ -992,6 +992,7 @@ TEST_F(ScrollbarAnimationControllerAuraOverlayTest, BasicMouseHoverShow) {
// Play the delay animation.
client_.start_fade().Run();
+ EXPECT_TRUE(client_.start_fade().IsCancelled());
EXPECT_FALSE(scrollbar_controller_->ScrollbarsHidden());
}
@@ -1019,7 +1020,7 @@ TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
}
// Scrollbars should cancel delay show when mouse hover hidden scrollbar then
-// move out.
+// move out of scrollbar.
TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
MouseHoverThenOutShouldCancelShow) {
base::TimeTicks time;
@@ -1040,6 +1041,27 @@ TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
client_.start_fade().IsCancelled());
}
+// Scrollbars should cancel delay show when mouse hover hidden scrollbar then
+// move out of window.
+TEST_F(ScrollbarAnimationControllerAuraOverlayTest,
+ MouseHoverThenLeaveShouldCancelShow) {
+ base::TimeTicks time;
+ time += base::TimeDelta::FromSeconds(1);
+
+ // Move mouse over scrollbar.
+ scrollbar_controller_->DidMouseMoveNear(VERTICAL, 0);
+
+ // An show animation should have been enqueued.
+ EXPECT_FALSE(client_.start_fade().is_null());
+ EXPECT_FALSE(client_.start_fade().IsCancelled());
+ EXPECT_EQ(kShowDelay, client_.delay());
+
+ // Move mouse out of window,delay show should be canceled.
+ scrollbar_controller_->DidMouseLeave();
+ EXPECT_TRUE(client_.start_fade().is_null() ||
+ client_.start_fade().IsCancelled());
+}
+
class ScrollbarAnimationControllerAndroidTest
: public testing::Test,
public ScrollbarAnimationControllerClient {
« 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