| 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 625ac9d8448802c47e6e588ecf985bc11a1a2733..b2224494e19ae4ad09b4dc7716394fece4cda7d7 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
|
| @@ -753,27 +753,26 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
|
| }
|
|
|
| /**
|
| - * Waits for the selection to be dissolved.
|
| + * Waits for the selection to be empty.
|
| * Use this method any time a test repeatedly establishes and dissolves a selection to ensure
|
| * that the selection has been completely dissolved before simulating the next selection event.
|
| * This is needed because the renderer's notification of a selection going away is async,
|
| * and a subsequent tap may think there's a current selection until it has been dissolved.
|
| */
|
| - private void waitForSelectionDissolved() throws InterruptedException {
|
| - CriteriaHelper.pollInstrumentationThread(new Criteria("Selection never dissolved.") {
|
| + private void waitForSelectionEmpty() throws InterruptedException {
|
| + CriteriaHelper.pollInstrumentationThread(new Criteria("Selection never empty.") {
|
| @Override
|
| public boolean isSatisfied() {
|
| - return !mSelectionController.isSelectionEstablished();
|
| + return mSelectionController.isSelectionEmpty();
|
| }
|
| }, TEST_TIMEOUT, DEFAULT_POLLING_INTERVAL);
|
| }
|
| -
|
| /**
|
| * Waits for the panel to close and then waits for the selection to dissolve.
|
| */
|
| - private void waitForPanelToCloseAndSelectionDissolved() throws InterruptedException {
|
| + private void waitForPanelToCloseAndSelectionEmpty() throws InterruptedException {
|
| waitForPanelToClose();
|
| - waitForSelectionDissolved();
|
| + waitForSelectionEmpty();
|
| }
|
|
|
| private void waitToPreventDoubleTapRecognition() throws InterruptedException {
|
| @@ -886,7 +885,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
|
| private void clickToExpandAndClosePanel() throws InterruptedException, TimeoutException {
|
| clickWordNode("states");
|
| tapBarToExpandAndClosePanel();
|
| - waitForSelectionDissolved();
|
| + waitForSelectionEmpty();
|
| }
|
|
|
| /**
|
| @@ -932,7 +931,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
|
| simulateTapSearch("search");
|
| waitForPanelToPeek();
|
| closePanel();
|
| - waitForPanelToCloseAndSelectionDissolved();
|
| + waitForPanelToCloseAndSelectionEmpty();
|
| }
|
|
|
| /**
|
| @@ -947,7 +946,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
|
| simulateLimitedTapSearch("search");
|
| waitForPanelToPeek();
|
| closePanel();
|
| - waitForPanelToCloseAndSelectionDissolved();
|
| + waitForPanelToCloseAndSelectionEmpty();
|
| }
|
|
|
| /**
|
| @@ -1255,7 +1254,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
|
| assertLoadedNoUrl(); // No load after long-press until opening panel.
|
| clickNode("question-mark");
|
| waitForGestureProcessing();
|
| - waitForPanelToCloseAndSelectionDissolved();
|
| + waitForPanelToCloseAndSelectionEmpty();
|
| assertNull(getSelectedText());
|
| assertLoadedNoUrl();
|
| }
|
| @@ -1339,7 +1338,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
|
| clickWordNode("states-far");
|
| waitForPanelToPeek();
|
| clickNode("button");
|
| - waitForPanelToCloseAndSelectionDissolved();
|
| + waitForPanelToCloseAndSelectionEmpty();
|
| }
|
|
|
| /**
|
| @@ -1819,7 +1818,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
|
|
|
| // Now we're at the limit, a tap should be ignored.
|
| clickNode("states");
|
| - waitForPanelToCloseAndSelectionDissolved();
|
| + waitForPanelToCloseAndSelectionEmpty();
|
| assertTapPromoCounterEnabledAt(2);
|
|
|
| // An open should disable the counter, but we need to use long-press (tap is now disabled).
|
| @@ -2050,7 +2049,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
|
| mPolicy.setTapLimitForUndecidedForTesting(PLENTY_OF_TAPS);
|
| for (int i = 0; i < 50; i++) {
|
| clickToTriggerPrefetch();
|
| - waitForSelectionDissolved();
|
| + waitForSelectionEmpty();
|
| assertSearchTermRequested();
|
| }
|
| }
|
|
|