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

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

Issue 2096003002: Fix crash when InkDropHostView::SetHasInkDrop() is called multiple times (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test 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
« no previous file with comments | « ui/views/animation/ink_drop_host_view.cc ('k') | ui/views/animation/test/ink_drop_host_view_test_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a9c8bccfbb399421a891820a3701cfe72ee5cba9..367239e74f801aa83d9f1c29180067f85b6813c6 100644
--- a/ui/views/animation/ink_drop_host_view_unittest.cc
+++ b/ui/views/animation/ink_drop_host_view_unittest.cc
@@ -57,5 +57,19 @@ 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) {
+ EXPECT_FALSE(test_api_.HasGestureHandler());
+
+ test_api_.SetHasInkDrop(true);
+ EXPECT_TRUE(test_api_.HasGestureHandler());
+
+ test_api_.SetHasInkDrop(true);
+ EXPECT_TRUE(test_api_.HasGestureHandler());
+
+ test_api_.SetHasInkDrop(false);
+ EXPECT_FALSE(test_api_.HasGestureHandler());
+}
+
} // namespace test
} // namespace views
« no previous file with comments | « ui/views/animation/ink_drop_host_view.cc ('k') | ui/views/animation/test/ink_drop_host_view_test_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698