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

Unified Diff: content/browser/renderer_host/input/touch_selection_controller_unittest.cc

Issue 482723002: Do not hide the selection handles on tap event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit test Created 6 years, 4 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 | « content/browser/renderer_host/input/touch_selection_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/touch_selection_controller_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
index f14860c4891cb67ddc5996eac90ce5ba218e83b4..2c8215a1c8acded2aead17a2ea04833fd0bd007a 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
@@ -648,4 +648,23 @@ TEST_F(TouchSelectionControllerTest, TemporarilyHidden) {
EXPECT_TRUE(GetAndResetNeedsAnimate());
}
+TEST_F(TouchSelectionControllerTest, SelectionClearOnTap) {
+ gfx::RectF start_rect(5, 5, 0, 10);
+ gfx::RectF end_rect(50, 5, 0, 10);
+ bool visible = true;
+
+ controller().OnLongPressEvent();
+ ChangeSelection(start_rect, visible, end_rect, visible);
+
+ // Selection should not be cleared if the selection bounds have not changed
jdduke (slow) 2014/08/20 01:50:53 Nit: period at end of comments (line break if nece
raghu 2014/08/20 05:02:10 Done.
+ controller().OnTapEvent();
+ EXPECT_EQ(SELECTION_SHOWN, GetLastEventType());
+ EXPECT_EQ(start_rect.bottom_left(), GetLastEventAnchor());
+
+ controller().OnTapEvent();
+ ClearSelection();
+ EXPECT_EQ(SELECTION_CLEARED, GetLastEventType());
+ EXPECT_EQ(gfx::PointF(), GetLastEventAnchor());
+}
+
} // namespace content
« no previous file with comments | « content/browser/renderer_host/input/touch_selection_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698