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

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

Issue 2559003002: [TTS] Fix testLongPressSwipeExpand flakiness. (Closed)
Patch Set: Created 4 years 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 | no next file » | 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 f4dfdbe4169b85215ebc5019ba437d160df3527b..a108f0c85a045b253d261c792f38947de0a193d8 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
@@ -1135,34 +1135,24 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
/**
* Tests swiping the overlay open, after an initial long-press that activates the peeking card,
* followed by closing the panel.
+ * This test also verifies that we don't create any {@link ContentViewCore} or load any URL
+ * until the panel is opened.
*/
@SmallTest
@Feature({"ContextualSearch"})
@Restriction(ChromeRestriction.RESTRICTION_TYPE_PHONE)
public void testLongPressSwipeExpand() throws InterruptedException, TimeoutException {
- longPressNode("intelligence");
+ simulateLongPressSearch("search");
assertNoContentViewCore();
-
- // TODO(pedrosimonetti): Long press does not resolve so we shouldn't be faking one.
- // Consider changing the fake server to create a fake response automatically,
- // when one is requested by the Manager.
-
- // Fake a search term resolution response.
- fakeResponse(false, 200, "Intelligence", "United States Intelligence", "alternate-term",
- false);
- assertContainsParameters("Intelligence", "alternate-term");
-
- waitForPanelToPeek();
assertLoadedNoUrl();
- assertNoContentViewCore();
- flingPanelUp();
- waitForPanelToExpand();
+
+ tapPeekingBarToExpandAndAssert();
assertContentViewCoreCreated();
assertLoadedNormalPriorityUrl();
assertEquals(1, mFakeServer.getLoadedUrlCount());
// tap the base page to close.
- tapBasePageToClosePanel();
+ closePanel();
assertEquals(1, mFakeServer.getLoadedUrlCount());
assertNoContentViewCore();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698