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

Unified Diff: ui/views/animation/ink_drop_animation_controller_impl_unittest.cc

Issue 1757993004: Added ink drop hover/ripple to menu hosting bookmark buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sky@ & varkha@ comments. 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: ui/views/animation/ink_drop_animation_controller_impl_unittest.cc
diff --git a/ui/views/animation/ink_drop_animation_controller_impl_unittest.cc b/ui/views/animation/ink_drop_animation_controller_impl_unittest.cc
index 633c332d6833d983404b9e7e3e0f6b59b8613c6e..4f98549e0ffe18aa75f87c6903eecf84192a9d57 100644
--- a/ui/views/animation/ink_drop_animation_controller_impl_unittest.cc
+++ b/ui/views/animation/ink_drop_animation_controller_impl_unittest.cc
@@ -70,8 +70,19 @@ TEST_F(InkDropAnimationControllerImplTest, SetHoveredIsFadingInOrVisible) {
}
TEST_F(InkDropAnimationControllerImplTest,
- HoveredStateAfterHoverTimerFiresWhenHostIsHovered) {
+ HoverDoesntFadeInAfterAnimationIfHoverNotSet) {
ink_drop_host_.set_should_show_hover(true);
+ ink_drop_animation_controller_.SetHovered(false);
+ ink_drop_animation_controller_.AnimateToState(InkDropState::QUICK_ACTION);
+
+ EXPECT_FALSE(task_runner_->HasPendingTask());
+ EXPECT_FALSE(is_hover_fading_in_or_visible());
+}
+
+TEST_F(InkDropAnimationControllerImplTest,
+ HoverFadesInAfterAnimationWhenHostIsHovered) {
+ ink_drop_host_.set_should_show_hover(true);
+ ink_drop_animation_controller_.SetHovered(true);
ink_drop_animation_controller_.AnimateToState(InkDropState::QUICK_ACTION);
EXPECT_TRUE(task_runner_->HasPendingTask());
@@ -82,8 +93,9 @@ TEST_F(InkDropAnimationControllerImplTest,
}
TEST_F(InkDropAnimationControllerImplTest,
- HoveredStateAfterHoverTimerFiresWhenHostIsNotHovered) {
+ HoverDoesntFadeInAfterAnimationWhenHostIsNotHovered) {
ink_drop_host_.set_should_show_hover(false);
+ ink_drop_animation_controller_.SetHovered(true);
ink_drop_animation_controller_.AnimateToState(InkDropState::QUICK_ACTION);
EXPECT_TRUE(task_runner_->HasPendingTask());
@@ -115,4 +127,15 @@ TEST_F(InkDropAnimationControllerImplTest,
EXPECT_FALSE(hover());
}
+TEST_F(InkDropAnimationControllerImplTest, HoverFadesOutOnSnapToActivated) {
+ ink_drop_host_.set_should_show_hover(true);
+ ink_drop_animation_controller_.SetHovered(true);
+
+ EXPECT_TRUE(is_hover_fading_in_or_visible());
+
+ ink_drop_animation_controller_.SnapToActivated();
+
+ EXPECT_FALSE(is_hover_fading_in_or_visible());
+}
+
} // namespace views
« no previous file with comments | « ui/views/animation/ink_drop_animation_controller_impl.cc ('k') | ui/views/animation/ink_drop_animation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698