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

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

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Changed SetHasInkDrop to SetInkDropMode Created 4 years, 6 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_host_view_unittest.cc
diff --git a/ui/views/animation/ink_drop_host_view_unittest.cc b/ui/views/animation/ink_drop_host_view_unittest.cc
index 367239e74f801aa83d9f1c29180067f85b6813c6..e0393cd3014fa3a4182a0ee79bbffdef6658678f 100644
--- a/ui/views/animation/ink_drop_host_view_unittest.cc
+++ b/ui/views/animation/ink_drop_host_view_unittest.cc
@@ -15,6 +15,9 @@
namespace views {
namespace test {
+namespace {
+using InkDropMode = InkDropHostViewTestApi::InkDropMode;
+}
class InkDropHostViewTest : public testing::Test {
public:
@@ -57,17 +60,21 @@ TEST_F(InkDropHostViewTest, GetInkDropCenterBasedOnLastEventForLocatedEvent) {
EXPECT_EQ(gfx::Point(5, 6), test_api_.GetInkDropCenterBasedOnLastEvent());
}
-// Verifies that SetHasInkDrop() sets up gesture handling properly.
-TEST_F(InkDropHostViewTest, SetHasInkDropGestureHandler) {
+// Verifies that SetInkDropMode() sets up gesture handling properly.
+TEST_F(InkDropHostViewTest, SetInkDropModeGestureHandler) {
+ EXPECT_FALSE(test_api_.HasGestureHandler());
+
+ test_api_.SetInkDropMode(InkDropMode::INK_DROP_WITHOUT_GESTURE_HANDLING);
EXPECT_FALSE(test_api_.HasGestureHandler());
- test_api_.SetHasInkDrop(true);
+ test_api_.SetInkDropMode(InkDropMode::INK_DROP_WITH_GESTURE_HANDLING);
EXPECT_TRUE(test_api_.HasGestureHandler());
- test_api_.SetHasInkDrop(true);
+ // Enabling gesture handler the second time should just work (no crash).
+ test_api_.SetInkDropMode(InkDropMode::INK_DROP_WITH_GESTURE_HANDLING);
EXPECT_TRUE(test_api_.HasGestureHandler());
- test_api_.SetHasInkDrop(false);
+ test_api_.SetInkDropMode(InkDropMode::NO_INK_DROP);
EXPECT_FALSE(test_api_.HasGestureHandler());
}

Powered by Google App Engine
This is Rietveld 408576698