| Index: content/public/android/javatests/src/org/chromium/content/browser/input/ReplicaInputConnectionTest.java
|
| diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/AdapterInputConnectionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ReplicaInputConnectionTest.java
|
| similarity index 86%
|
| rename from content/public/android/javatests/src/org/chromium/content/browser/input/AdapterInputConnectionTest.java
|
| rename to content/public/android/javatests/src/org/chromium/content/browser/input/ReplicaInputConnectionTest.java
|
| index 8ea6e17cd0f138d7612626cf179d67f3340960bf..349fdcd9cabbcffb0a6327e728dbbba31d488ee9 100644
|
| --- a/content/public/android/javatests/src/org/chromium/content/browser/input/AdapterInputConnectionTest.java
|
| +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ReplicaInputConnectionTest.java
|
| @@ -9,21 +9,23 @@ import android.os.IBinder;
|
| import android.os.ResultReceiver;
|
| import android.test.suitebuilder.annotation.MediumTest;
|
| import android.test.suitebuilder.annotation.SmallTest;
|
| +import android.text.Editable;
|
| import android.view.View;
|
| import android.view.inputmethod.EditorInfo;
|
|
|
| import org.chromium.base.test.util.Feature;
|
| -import org.chromium.content.browser.input.AdapterInputConnection.ImeState;
|
| +import org.chromium.content.browser.input.ReplicaInputConnection.ImeState;
|
| import org.chromium.content_shell_apk.ContentShellTestBase;
|
| +import org.chromium.ui.base.ime.TextInputType;
|
|
|
| import java.util.ArrayList;
|
|
|
| /**
|
| * Tests AdapterInputConnection class and its callbacks to ImeAdapter.
|
| */
|
| -public class AdapterInputConnectionTest extends ContentShellTestBase {
|
| +public class ReplicaInputConnectionTest extends ContentShellTestBase {
|
|
|
| - private AdapterInputConnection mConnection;
|
| + private ReplicaInputConnection mConnection;
|
| private TestInputMethodManagerWrapper mWrapper;
|
| private TestImeAdapter mImeAdapter;
|
|
|
| @@ -36,8 +38,10 @@ public class AdapterInputConnectionTest extends ContentShellTestBase {
|
| TestImeAdapterDelegate imeAdapterDelegate =
|
| new TestImeAdapterDelegate(getContentViewCore().getContainerView());
|
| mImeAdapter = new TestImeAdapter(mWrapper, imeAdapterDelegate);
|
| - mConnection = new AdapterInputConnection(
|
| - getContentViewCore().getContainerView(), mImeAdapter, 0, 0, new EditorInfo());
|
| + Editable editable = Editable.Factory.getInstance().newEditable("");
|
| + mConnection = new ReplicaInputConnection(getContentViewCore().getContainerView(),
|
| + mImeAdapter, new ReplicaInputConnection.ThreadManager(), editable,
|
| + TextInputType.TEXT, 0, new EditorInfo());
|
| }
|
|
|
| @SmallTest
|
| @@ -47,14 +51,14 @@ public class AdapterInputConnectionTest extends ContentShellTestBase {
|
| final String smiley = "\uD83D\uDE0A"; // multi character codepoint
|
|
|
| // No need to adjust length.
|
| - assertFalse(AdapterInputConnection.isIndexBetweenUtf16SurrogatePair("a", 0));
|
| - assertFalse(AdapterInputConnection.isIndexBetweenUtf16SurrogatePair(ga, 0));
|
| - assertFalse(AdapterInputConnection.isIndexBetweenUtf16SurrogatePair("aa", 1));
|
| - assertFalse(AdapterInputConnection.isIndexBetweenUtf16SurrogatePair("a" + smiley + "a", 1));
|
| + assertFalse(ReplicaInputConnection.isIndexBetweenUtf16SurrogatePair("a", 0));
|
| + assertFalse(ReplicaInputConnection.isIndexBetweenUtf16SurrogatePair(ga, 0));
|
| + assertFalse(ReplicaInputConnection.isIndexBetweenUtf16SurrogatePair("aa", 1));
|
| + assertFalse(ReplicaInputConnection.isIndexBetweenUtf16SurrogatePair("a" + smiley + "a", 1));
|
|
|
| // Needs to adjust length.
|
| - assertTrue(AdapterInputConnection.isIndexBetweenUtf16SurrogatePair(smiley, 1));
|
| - assertTrue(AdapterInputConnection.isIndexBetweenUtf16SurrogatePair(smiley + "a", 1));
|
| + assertTrue(ReplicaInputConnection.isIndexBetweenUtf16SurrogatePair(smiley, 1));
|
| + assertTrue(ReplicaInputConnection.isIndexBetweenUtf16SurrogatePair(smiley + "a", 1));
|
| }
|
|
|
| @MediumTest
|
|
|