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

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

Issue 2250783002: Allow InkDropRipple to co-exist with highlight (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: w/o dbg code Created 4 years, 3 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 14c549a9f37e11d5fb68d5f54cfd3afe03b3fc38..68cbd9f92f41bbfa58f1ab39d05c2172d9df42e8 100644
--- a/ui/views/animation/ink_drop_impl_unittest.cc
+++ b/ui/views/animation/ink_drop_impl_unittest.cc
@@ -294,6 +294,7 @@ TEST_F(InkDropImplTest, FocusHighlightComesBackImmediatelyAfterAction) {
ink_drop_.AnimateToState(InkDropState::ACTION_PENDING);
EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers());
+ EXPECT_FALSE(test_api_.IsHighlightFadingInOrVisible());
ink_drop_.AnimateToState(InkDropState::ACTION_TRIGGERED);
EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers());
@@ -307,4 +308,28 @@ TEST_F(InkDropImplTest, FocusHighlightComesBackImmediatelyAfterAction) {
EXPECT_TRUE(test_api_.IsHighlightFadingInOrVisible());
}
+TEST_F(InkDropImplTest, HighlightCanCoexistWithRipple) {
bruthig 2016/09/08 15:56:04 Can you add a similar test for SnapToActivated()?
Evan Stade 2016/09/08 19:17:32 Done.
+ ink_drop_host_.set_should_show_highlight(true);
+ ink_drop_host_.set_ripple_overrides_highlight(false);
+
+ EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers());
+
+ ink_drop_.SetHovered(true);
+ EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers());
+
+ ink_drop_.AnimateToState(InkDropState::ACTION_PENDING);
+ EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers());
+ EXPECT_TRUE(test_api_.IsHighlightFadingInOrVisible());
+
+ ink_drop_.AnimateToState(InkDropState::ACTION_TRIGGERED);
+ EXPECT_EQ(1, ink_drop_host_.num_ink_drop_layers());
+ EXPECT_TRUE(test_api_.IsHighlightFadingInOrVisible());
+
+ test_api_.CompleteAnimations();
+
+ // Nothing to fade in because the highlight has always been visible.
+ EXPECT_FALSE(task_runner_->HasPendingTask());
+ EXPECT_TRUE(test_api_.IsHighlightFadingInOrVisible());
+}
+
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698