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

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

Issue 312293002: Paste popup is positioning properly during content scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Unittest failure issues. Created 6 years, 5 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 dee5c98764c3c0130f07a42760ebc3d945e7d1db..d90ee755c52649748b13eb97130d7fbbdaa8f221 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_unittest.cc
@@ -91,6 +91,7 @@ class TouchSelectionControllerTest : public testing::Test,
gfx::RectF(),
TOUCH_HANDLE_ORIENTATION_UNDEFINED,
false);
+ controller().HideAndDisallowShowingAutomatically();
jdduke (slow) 2014/08/02 13:11:12 This is not OK, you just completely changed the se
AKVT 2014/08/02 13:16:53 Without this even after calling clearSelection() E
jdduke (slow) 2014/08/02 14:23:00 Which test? If a drag is in-progress the "clearing
AKVT 2014/08/04 13:45:32 Corrected the source code to counter measure the c
}
void ClearInsertion() { ClearSelection(); }
@@ -320,6 +321,7 @@ TEST_F(TouchSelectionControllerTest, InsertionDragged) {
// The touch sequence should not be handled if insertion is not active.
MockMotionEvent event(MockMotionEvent::ACTION_DOWN, event_time, 0, 0);
EXPECT_FALSE(controller().WillHandleTouchEvent(event));
+ EXPECT_EQ(SELECTION_CLEARED, GetLastEventType());
jdduke (slow) 2014/08/02 13:11:12 No need to check this it's just confusing.
AKVT 2014/08/04 13:45:32 Done.
float line_height = 10.f;
gfx::RectF start_rect(10, 0, 0, line_height);
@@ -374,7 +376,8 @@ TEST_F(TouchSelectionControllerTest, InsertionTapped) {
MockMotionEvent event(MockMotionEvent::ACTION_DOWN, event_time, 0, 0);
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
- EXPECT_EQ(INSERTION_SHOWN, GetLastEventType());
+ //TODO(AKV): this test case has to be modified once crbug.com/394093 is fixed.
+ EXPECT_EQ(INSERTION_DRAG_STARTED, GetLastEventType());
event = MockMotionEvent(MockMotionEvent::ACTION_UP, event_time, 0, 0);
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
@@ -394,7 +397,7 @@ TEST_F(TouchSelectionControllerTest, InsertionTapped) {
0,
0);
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
- EXPECT_EQ(INSERTION_SHOWN, GetLastEventType());
+ EXPECT_EQ(INSERTION_DRAG_STARTED, GetLastEventType());
// Reset the insertion.
ClearInsertion();
@@ -407,7 +410,7 @@ TEST_F(TouchSelectionControllerTest, InsertionTapped) {
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
event = MockMotionEvent(MockMotionEvent::ACTION_CANCEL, event_time, 0, 0);
EXPECT_TRUE(controller().WillHandleTouchEvent(event));
- EXPECT_EQ(INSERTION_SHOWN, GetLastEventType());
+ EXPECT_EQ(INSERTION_DRAG_STARTED, GetLastEventType());
}
TEST_F(TouchSelectionControllerTest, SelectionBasic) {

Powered by Google App Engine
This is Rietveld 408576698