| 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();
|
| - }
|
| }
|
|
|