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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java

Issue 191133003: In tests call ImeAdapter from UI thread only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java
index 7c359623f58998c01b393a79af3c369ac7d69aee..7cdbd89b0596d830cd63d286464249a4afa500b6 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/input/InsertionHandleTest.java
@@ -27,6 +27,9 @@ import org.chromium.content.browser.test.util.TestTouchUtils;
import org.chromium.content.browser.test.util.TouchCommon;
import org.chromium.content_shell_apk.ContentShellTestBase;
+/**
+ * Tests the insertion handle that allows users to paste text.
+ */
public class InsertionHandleTest extends ContentShellTestBase {
private static final String META_DISABLE_ZOOM =
"<meta name=\"viewport\" content=\"" +
@@ -71,7 +74,7 @@ public class InsertionHandleTest extends ContentShellTestBase {
// The TestInputMethodManagerWrapper intercepts showSoftInput so that a keyboard is never
// brought up.
- getImeAdapter().setInputMethodManagerWrapper(
+ getContentViewCore().getImeAdapterForTest().setInputMethodManagerWrapper(
new TestInputMethodManagerWrapper(getContentViewCore()));
}
@@ -82,7 +85,7 @@ public class InsertionHandleTest extends ContentShellTestBase {
clickNodeToShowInsertionHandle(TEXTAREA_ID);
// Unselecting should cause the handle to disappear.
- getImeAdapter().unselect();
+ unselectOnMainSync();
assertTrue(waitForHandleShowingEquals(false));
}
@@ -362,6 +365,15 @@ public class InsertionHandleTest extends ContentShellTestBase {
});
}
+ private void unselectOnMainSync() {
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ getContentViewCore().getImeAdapterForTest().unselect();
+ }
+ });
+ }
+
private int getSelectionStart() {
return Selection.getSelectionStart(getEditable());
}
@@ -383,8 +395,4 @@ public class InsertionHandleTest extends ContentShellTestBase {
(ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
clipMgr.setPrimaryClip(ClipData.newPlainText(null, text));
}
-
- private ImeAdapter getImeAdapter() {
- return getContentViewCore().getImeAdapterForTest();
- }
}
« no previous file with comments | « content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698