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

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

Issue 1358263002: [Android] Support double-tap selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix contextual search Created 5 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
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 3b63c6a0be254ac6226467e08dcde3df7b878077..601ee01d4cb14b230b33202b20eff7fa8a6db0f7 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
@@ -22,6 +22,7 @@ import android.test.suitebuilder.annotation.SmallTest;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
+import android.view.ViewConfiguration;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CommandLineFlags;
@@ -1031,11 +1032,18 @@ public class ContextualSearchManagerTest extends ChromeActivityTestCaseBase<Chro
clickWordNode("states");
assertEquals("States", getSelectedText());
waitForPanelToPeekAndAssert();
+ // Avoid issues with double-tap detection by ensuring sequential taps
+ // aren't treated as such. Double-tapping can also select words much as
+ // longpress, in turn showing the pins and preventing contextual tap
+ // refinement from nearby taps. The double-tap timeout is sufficiently
+ // short that this shouldn't conflict with tap refinement by the user.
+ Thread.sleep(ViewConfiguration.getDoubleTapTimeout());
// Because sequential taps never hide the bar, we we can't wait for it to peek.
// Instead we use clickNode (which doesn't wait) instead of clickWordNode and wait
// for the selection to change.
clickNode("states-near");
waitForSelectionToBe("StatesNear");
+ Thread.sleep(ViewConfiguration.getDoubleTapTimeout());
clickNode("states");
waitForSelectionToBe("States");
}

Powered by Google App Engine
This is Rietveld 408576698