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

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

Issue 2431493002: MD Buttons: Don't add layers for hidden -> hidden transitions. (Closed)
Patch Set: Additional test Created 4 years, 2 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 | « ui/views/animation/ink_drop_impl.cc ('k') | ui/views/animation/test/test_ink_drop_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b7c85dcf28b500ed309aefd24f3ed61341f0d440..5047ffc1f66bccd33dcfc57d09f5754c354a10f6 100644
--- a/ui/views/animation/ink_drop_impl_unittest.cc
+++ b/ui/views/animation/ink_drop_impl_unittest.cc
@@ -370,4 +370,17 @@ TEST_F(InkDropImplTest, HighlightCanCoexistWithSnapToActivatedRipple) {
EXPECT_TRUE(test_api_.IsHighlightFadingInOrVisible());
}
+// Test that (re-)hiding or un-hovering a hidden ink drop doesn't add layers.
+TEST_F(InkDropImplTest, AlwaysHiddenInkDropHasNoLayers) {
+ ink_drop_host_.set_should_show_highlight(true);
+
+ EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers_added());
+
+ ink_drop_.AnimateToState(InkDropState::HIDDEN);
+ EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers_added());
+
+ ink_drop_.SetHovered(false);
+ EXPECT_EQ(0, ink_drop_host_.num_ink_drop_layers_added());
+}
+
} // namespace views
« no previous file with comments | « ui/views/animation/ink_drop_impl.cc ('k') | ui/views/animation/test/test_ink_drop_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698