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

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

Issue 2001843002: Use ink drop hover for focus states on toolbar buttons and location (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback and add test Created 4 years, 7 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_impl_unittest.cc
diff --git a/ui/views/animation/ink_drop_impl_unittest.cc b/ui/views/animation/ink_drop_impl_unittest.cc
index ef480e051c74826e78e2530f1a1d299283d53f28..afaf0809ff2cc8ca695d4f7be2cb388f58ea43d9 100644
--- a/ui/views/animation/ink_drop_impl_unittest.cc
+++ b/ui/views/animation/ink_drop_impl_unittest.cc
@@ -62,6 +62,30 @@ TEST_F(InkDropImplTest, SetHoveredIsFadingInOrVisible) {
EXPECT_FALSE(test_api_.IsHoverFadingInOrVisible());
}
+TEST_F(InkDropImplTest, FocusAndHoverAtSameTime) {
+ ink_drop_host_.set_should_show_hover(true);
+ EXPECT_FALSE(test_api_.IsHoverFadingInOrVisible());
+
+ ink_drop_.SetFocused(true);
+ EXPECT_TRUE(test_api_.IsHoverFadingInOrVisible());
+
+ test_api_.CompleteAnimations();
+ ink_drop_.SetHovered(false);
+ EXPECT_TRUE(test_api_.IsHoverFadingInOrVisible());
+
+ test_api_.CompleteAnimations();
+ ink_drop_.SetHovered(true);
+ EXPECT_TRUE(test_api_.IsHoverFadingInOrVisible());
+
+ test_api_.CompleteAnimations();
+ ink_drop_.SetFocused(false);
+ EXPECT_TRUE(test_api_.IsHoverFadingInOrVisible());
+
+ test_api_.CompleteAnimations();
+ ink_drop_.SetHovered(false);
+ EXPECT_FALSE(test_api_.IsHoverFadingInOrVisible());
+}
+
TEST_F(InkDropImplTest, HoverDoesntFadeInAfterAnimationIfHoverNotSet) {
ink_drop_host_.set_should_show_hover(true);
ink_drop_.SetHovered(false);

Powered by Google App Engine
This is Rietveld 408576698