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 |