Chromium Code Reviews| 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 5060dee3914b61e7c98f8783b280fba9481be12f..3575d995d7ee19c9b340890e0981afa893064436 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 |
| @@ -709,30 +709,6 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
| assertNull(getSelectedText()); |
| } |
| - /** |
| - * Waits for the selection to be dissolved. |
| - * 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.") { |
| - @Override |
| - public boolean isSatisfied() { |
| - return !mSelectionController.isSelectionEstablished(); |
| - } |
| - }, TEST_TIMEOUT, DEFAULT_POLLING_INTERVAL); |
| - } |
| - |
| - /** |
| - * Waits for the panel to close and then waits for the selection to dissolve. |
| - */ |
| - private void waitForPanelToCloseAndSelectionDissolved() throws InterruptedException { |
| - waitForPanelToClose(); |
| - waitForSelectionDissolved(); |
| - } |
| - |
| private void waitToPreventDoubleTapRecognition() throws InterruptedException { |
| // Avoid issues with double-tap detection by ensuring sequential taps |
| // aren't treated as such. Double-tapping can also select words much as |
| @@ -843,7 +819,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
| private void clickToExpandAndClosePanel() throws InterruptedException, TimeoutException { |
| clickWordNode("states"); |
| tapBarToExpandAndClosePanel(); |
| - waitForSelectionDissolved(); |
| + waitForPanelToClose(); |
|
Donn Denman
2016/10/07 22:10:03
Please remove this line. This isn't needed since
amaralp
2016/10/14 00:53:07
Changed from waitForSelectionDissolved() to waitFo
|
| } |
| /** |
| @@ -889,7 +865,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
| simulateTapSearch("search"); |
| waitForPanelToPeek(); |
| closePanel(); |
| - waitForPanelToCloseAndSelectionDissolved(); |
| + waitForPanelToClose(); |
| } |
| /** |
| @@ -904,7 +880,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
| simulateLimitedTapSearch("search"); |
| waitForPanelToPeek(); |
| closePanel(); |
| - waitForPanelToCloseAndSelectionDissolved(); |
| + waitForPanelToClose(); |
| } |
| /** |
| @@ -1214,7 +1190,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
| assertLoadedNoUrl(); // No load after long-press until opening panel. |
| clickNode("question-mark"); |
| waitForGestureProcessing(); |
| - waitForPanelToCloseAndSelectionDissolved(); |
| + waitForPanelToClose(); |
| assertNull(getSelectedText()); |
| assertLoadedNoUrl(); |
| } |
| @@ -1302,7 +1278,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
| clickWordNode("states-far"); |
| waitForPanelToPeek(); |
| clickNode("button"); |
| - waitForPanelToCloseAndSelectionDissolved(); |
| + waitForPanelToClose(); |
| } |
| /** |
| @@ -1799,7 +1775,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
| // Now we're at the limit, a tap should be ignored. |
| clickNode("states"); |
| - waitForPanelToCloseAndSelectionDissolved(); |
| + waitForPanelToClose(); |
| assertTapPromoCounterEnabledAt(2); |
| // An open should disable the counter, but we need to use long-press (tap is now disabled). |
| @@ -2029,7 +2005,7 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro |
| mPolicy.setTapLimitForUndecidedForTesting(PLENTY_OF_TAPS); |
| for (int i = 0; i < 50; i++) { |
| clickToTriggerPrefetch(); |
| - waitForSelectionDissolved(); |
| + waitForPanelToClose(); |
|
Donn Denman
2016/10/07 22:10:03
Also please remove this line. This isn't needed s
amaralp
2016/10/14 00:53:07
Changed from waitForSelectionDissolved() to waitFo
|
| assertSearchTermRequested(); |
| } |
| } |