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

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

Issue 2574023002: [TTS] Rework a flaky test to use more robust methodology. (Closed)
Patch Set: Changed a waitForPanelToPeek to a comment. 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 79fb25a2031f5a46cce7330278271c270b49bd97..5f8438b6cde647659a3f77b013ac5b7b549d1635 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
@@ -2006,26 +2006,30 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
*/
@SmallTest
@Feature({"ContextualSearch"})
- @DisabledTest(message = "crbug.com/673684")
@RetryOnFailure
public void testPreventHandlingCurrentSelectionModification()
throws InterruptedException, TimeoutException {
- longPressNode("intelligence");
- waitForPanelToPeek();
+ simulateLongPressSearch("search");
// Dismiss the Contextual Search panel.
- scrollBasePage();
- assertPanelClosedOrUndefined();
- assertEquals("Intelligence", getSelectedText());
+ closePanel();
+ assertEquals("Search", getSelectedText());
// Simulate a selection change event and assert that the panel has not reappeared.
- mManager.onSelectionEvent(SelectionEventType.SELECTION_HANDLE_DRAG_STARTED, 333, 450);
- mManager.onSelectionEvent(SelectionEventType.SELECTION_HANDLE_DRAG_STOPPED, 303, 450);
+ ThreadUtils.runOnUiThreadBlocking(new Runnable() {
+ @Override
+ public void run() {
+ mManager.onSelectionEvent(
+ SelectionEventType.SELECTION_HANDLE_DRAG_STARTED, 333, 450);
+ mManager.onSelectionEvent(
+ SelectionEventType.SELECTION_HANDLE_DRAG_STOPPED, 303, 450);
+ }
+ });
assertPanelClosedOrUndefined();
// Select a different word and assert that the panel has appeared.
- longPressNode("states-far");
- waitForPanelToPeek();
+ simulateLongPressSearch("resolution");
+ // The simulateLongPressSearch call will verify that the panel peeks.
}
/**
« 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