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

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: Rebased my patch 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 d5aabbb0a565a283bd030efc82afffd8e56a89fb..cfbd48ee6ac79f83ca7ca8c61d89f4662bb6cf69 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
@@ -652,4 +652,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.
+ 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