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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java

Issue 2211353002: [TTS] Gather surrounding text on Tap before any UX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated instrumentation tests to remove tapBasePageToClosePanel and just call closePanel instead. Created 4 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 | « chrome/android/java_sources.gni ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
index 19b5518832d6535fa6a0f4f8bb7cc218c580cd4f..9e5ff39a7e1aac5bc3334053e7c3cbe3a825c8a7 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
@@ -802,22 +802,6 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
}
/**
- * Taps the base page near the top.
- */
- private void tapBasePageToClosePanel() throws InterruptedException {
- // TODO(pedrosimonetti): This is not reliable. Find a better approach.
- // We use the far right side (x == 0.9f) to prevent simulating a tap on top of an
- // existing long-press selection (the pins are a tap target). This might not work on RTL.
- // We are using y == 0.35f because otherwise it will fail for long press cases.
- // It might be better to get the position of the Panel and tap just about outside
- // the Panel. I suspect some Flaky tests are caused by this problem (ones involving
- // long press and trying to close with the bar peeking, with a long press selection
- // established).
- tapBasePage(0.9f, 0.35f);
- waitForPanelToClose();
- }
-
- /**
* Taps the base page at the given x, y position.
*/
private void tapBasePage(float x, float y) {
Theresa 2016/09/12 22:59:19 Is this being used anywhere anymore?
Donn Denman 2016/09/14 00:18:22 Removed. Also consolidated to methods just below.
@@ -841,7 +825,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
*/
private void tapBarToExpandAndClosePanel() throws InterruptedException {
tapPeekingBarToExpandAndAssert();
- tapBasePageToClosePanel();
+ closePanel();
}
/**
@@ -1101,8 +1085,8 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertLoadedNormalPriorityUrl();
assertEquals(1, mFakeServer.getLoadedUrlCount());
- // tap the base page to close.
- tapBasePageToClosePanel();
+ // close the panel.
+ closePanel();
assertEquals(1, mFakeServer.getLoadedUrlCount());
assertNoContentViewCore();
}
@@ -1706,7 +1690,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
pressAppMenuKey();
assertAppMenuVisibility(false);
- tapBasePageToClosePanel();
+ closePanel();
pressAppMenuKey();
assertAppMenuVisibility(true);
@@ -1882,7 +1866,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
longPressNode("states");
assertEquals(0, observer.hideCount);
- tapBasePageToClosePanel();
+ closePanel();
assertEquals(1, observer.hideCount);
}
@@ -1899,7 +1883,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
clickWordNode("states");
assertEquals(0, observer.hideCount);
- tapBasePageToClosePanel();
+ closePanel();
assertEquals(1, observer.hideCount);
}
@@ -2115,7 +2099,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertFalse(mPanel.isPeekPromoVisible());
// After closing the Panel the Promo should still be invisible.
- tapBasePageToClosePanel();
+ closePanel();
assertFalse(mPanel.isPeekPromoVisible());
// Click elsewhere to clear the selection.
@@ -2148,7 +2132,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertContentViewCoreVisible();
// Closing the Panel should destroy the Content.
- tapBasePageToClosePanel();
+ closePanel();
assertNoContentViewCore();
}
@@ -2171,7 +2155,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertContentViewCoreVisible();
// Closing the Panel should destroy the Content.
- tapBasePageToClosePanel();
+ closePanel();
assertNoContentViewCore();
}
@@ -2205,7 +2189,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertEquals(1, mFakeServer.getLoadedUrlCount());
// Closing the Panel should destroy the Content.
- tapBasePageToClosePanel();
+ closePanel();
assertNoContentViewCore();
assertEquals(1, mFakeServer.getLoadedUrlCount());
}
@@ -2241,7 +2225,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertEquals(1, mFakeServer.getLoadedUrlCount());
// Closing the Panel should destroy the Content.
- tapBasePageToClosePanel();
+ closePanel();
assertNoContentViewCore();
assertEquals(1, mFakeServer.getLoadedUrlCount());
}
@@ -2279,7 +2263,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertNotSame(cvc2, cvc3);
// Closing the Panel should destroy the Content.
- tapBasePageToClosePanel();
+ closePanel();
assertNoContentViewCore();
assertEquals(3, mFakeServer.getLoadedUrlCount());
}
@@ -2325,7 +2309,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertNotSame(cvc1, cvc2);
// Closing the Panel should destroy the Content.
- tapBasePageToClosePanel();
+ closePanel();
assertNoContentViewCore();
assertEquals(2, mFakeServer.getLoadedUrlCount());
}
@@ -2378,7 +2362,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
String url = mFakeServer.getLoadedUrl();
// Close the Panel without seeing the Content.
- tapBasePageToClosePanel();
+ closePanel();
// Now check that the URL has been removed from history.
assertTrue(mFakeServer.hasRemovedUrl(url));
@@ -2401,7 +2385,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
tapPeekingBarToExpandAndAssert();
// Close the Panel.
- tapBasePageToClosePanel();
+ closePanel();
// Now check that the URL has not been removed from history, since the Content was seen.
assertFalse(mFakeServer.hasRemovedUrl(url));
@@ -2435,7 +2419,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
assertNotSame(url2, url3);
// Close the Panel without seeing any Content.
- tapBasePageToClosePanel();
+ closePanel();
// Now check that all three URLs have been removed from history.
assertEquals(3, mFakeServer.getLoadedUrlCount());
@@ -2569,7 +2553,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
mManager.getContextualSearchPanel().getPanelHeightFromState(PanelState.EXPANDED));
// Tap the base page and assert that the panel is closed.
- tapBasePageToClosePanel();
+ closePanel();
}
/**
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698