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

Unified Diff: content/browser/web_contents/touch_editable_impl_aura_browsertest.cc

Issue 23823004: Re-enable TouchCursorInTextfieldTest with some fixes and logs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a TODO to remove logs Created 7 years, 3 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 | « no previous file | content/test/data/touch_selection.html » ('j') | content/test/data/touch_selection.html » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/touch_editable_impl_aura_browsertest.cc
diff --git a/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc b/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc
index 86b3698364d9dffecf68be8407e31b67a97b254b..fa2346e0a153ceb360f60aa7306fc18b3520a1dc 100644
--- a/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc
+++ b/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc
@@ -294,6 +294,7 @@ class TouchEditableImplAuraTest : public ContentBrowserTest {
EXPECT_TRUE(touch_editable->touch_selection_controller_.get());
}
+ // TODO(mohsen): Remove logs if the test showed no flakiness anymore.
void TestTouchCursorInTextfield() {
ASSERT_NO_FATAL_FAILURE(
StartTestWithPage("files/touch_selection.html"));
@@ -311,21 +312,28 @@ class TouchEditableImplAuraTest : public ContentBrowserTest {
aura::test::EventGenerator generator(content->GetRootWindow(), content);
gfx::Rect bounds = content->GetBoundsInRootWindow();
EXPECT_EQ(touch_editable->rwhva_, rwhva);
+
+ LOG(INFO) << "Focus the textfield.";
ExecuteSyncJSFunction(view_host, "focus_textfield()");
// Tap textfield
touch_editable->Reset();
+ LOG(INFO) << "Tap in the textfield.";
generator.GestureTapAt(gfx::Point(bounds.x() + 50, bounds.y() + 40));
+ LOG(INFO) << "Wait for tap-down ACK.";
touch_editable->WaitForGestureAck(); // Wait for Tap Down Ack
touch_editable->Reset();
+ LOG(INFO) << "Wait for tap ACK.";
touch_editable->WaitForGestureAck(); // Wait for Tap Ack.
+ LOG(INFO) << "Test the touch selection handle.";
// Check if cursor handle is showing.
ui::TouchSelectionController* controller =
touch_editable->touch_selection_controller_.get();
EXPECT_NE(ui::TEXT_INPUT_TYPE_NONE, touch_editable->text_input_type_);
EXPECT_TRUE(controller);
+ LOG(INFO) << "Test cursor position.";
scoped_ptr<base::Value> value =
content::ExecuteScriptAndGetValue(view_host, "get_cursor_position()");
int cursor_pos = -1;
@@ -333,14 +341,18 @@ class TouchEditableImplAuraTest : public ContentBrowserTest {
EXPECT_NE(-1, cursor_pos);
// Move the cursor handle.
+ LOG(INFO) << "Drag the touch selection handle to change its position.";
generator.GestureScrollSequence(
gfx::Point(50, 59),
gfx::Point(10, 59),
base::TimeDelta::FromMilliseconds(20),
1);
+ LOG(INFO) << "Wait for cursor position to change.";
+ touch_editable->WaitForSelectionChangeCallback();
+ LOG(INFO) << "Check cursor position is changed.";
EXPECT_TRUE(touch_editable->touch_selection_controller_.get());
- value = content::ExecuteScriptAndGetValue(
- view_host, "get_cursor_position()");
+ value = content::ExecuteScriptAndGetValue(view_host,
+ "get_cursor_position()");
int new_cursor_pos = -1;
value->GetAsInteger(&new_cursor_pos);
EXPECT_NE(-1, new_cursor_pos);
@@ -367,9 +379,8 @@ IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
TestTouchSelectionOnLongPress();
}
-// TODO(miu): Disabled test due to flakiness. http://crbug.com/235991
IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest,
- DISABLED_TouchCursorInTextfieldTest) {
+ TouchCursorInTextfieldTest) {
TestTouchCursorInTextfield();
}
« no previous file with comments | « no previous file | content/test/data/touch_selection.html » ('j') | content/test/data/touch_selection.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698