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

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

Issue 469483002: [Android] Route selection event updates to ContentViewClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup 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
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 1be382b5872126862217d817fc68fc3095bcdfae..6389c38a722b29282d5ee1de7dc8c867557c91eb 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
@@ -509,6 +509,7 @@ TEST_F(TouchSelectionControllerTest, SelectionDragged) {
gfx::PointF start_offset = start_rect.CenterPoint();
event = MockMotionEvent(MockMotionEvent::ACTION_MOVE, event_time, 0, 5);
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
+ EXPECT_EQ(SELECTION_DRAG_STARTED, GetLastEventType());
EXPECT_TRUE(GetAndResetSelectionMoved());
EXPECT_EQ(fixed_offset, GetLastSelectionStart());
EXPECT_EQ(start_offset + gfx::Vector2dF(0, 5), GetLastSelectionEnd());
@@ -527,6 +528,7 @@ TEST_F(TouchSelectionControllerTest, SelectionDragged) {
event = MockMotionEvent(MockMotionEvent::ACTION_UP, event_time, 10, 5);
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
+ EXPECT_EQ(SELECTION_DRAG_STOPPED, GetLastEventType());
EXPECT_FALSE(GetAndResetSelectionMoved());
// Once the drag is complete, no more touch events should be consumed until
@@ -554,6 +556,7 @@ TEST_F(TouchSelectionControllerTest, SelectionDraggedWithOverlap) {
MockMotionEvent::ACTION_DOWN, event_time, touch_down_x, 0);
SetDraggingEnabled(true);
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
+ EXPECT_EQ(SELECTION_DRAG_STARTED, GetLastEventType());
EXPECT_FALSE(GetAndResetSelectionMoved());
// Even though the ACTION_MOVE is over the start handle, it should continue
@@ -567,6 +570,7 @@ TEST_F(TouchSelectionControllerTest, SelectionDraggedWithOverlap) {
event = MockMotionEvent(MockMotionEvent::ACTION_UP, event_time, 0, 0);
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
+ EXPECT_EQ(SELECTION_DRAG_STOPPED, GetLastEventType());
EXPECT_FALSE(GetAndResetSelectionMoved());
}

Powered by Google App Engine
This is Rietveld 408576698