| Index: content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
|
| diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
|
| index c320ccdbbe1023f9fab00c6830592edeb1d0703b..764f078d22ea444a2f0827f31417b7749e5e8f80 100644
|
| --- a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
|
| +++ b/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
|
| @@ -13,6 +13,7 @@ import android.os.Handler;
|
| import android.os.Looper;
|
| import android.test.suitebuilder.annotation.MediumTest;
|
| import android.test.suitebuilder.annotation.SmallTest;
|
| +import android.text.InputType;
|
| import android.text.TextUtils;
|
| import android.util.Pair;
|
| import android.view.KeyEvent;
|
| @@ -1356,6 +1357,23 @@ public class ImeTest extends ContentShellTestBase {
|
| waitForEventLogs("keydown(229),input,keyup(229),selectionchange,selectionchange");
|
| }
|
|
|
| + @MediumTest
|
| + @Feature({"TextInput"})
|
| + @RetryOnFailure
|
| + public void testGetCursorCapsMode() throws Throwable {
|
| + commitText("Hello World", 1);
|
| + waitAndVerifyUpdateSelection(0, 11, 11, -1, -1);
|
| + assertEquals(0,
|
| + getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS));
|
| + setSelection(6, 6);
|
| + waitAndVerifyUpdateSelection(1, 6, 6, -1, -1);
|
| + assertEquals(InputType.TYPE_TEXT_FLAG_CAP_WORDS,
|
| + getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS));
|
| + commitText("\n", 1);
|
| + assertEquals(InputType.TYPE_TEXT_FLAG_CAP_WORDS,
|
| + getCursorCapsMode(InputType.TYPE_TEXT_FLAG_CAP_WORDS));
|
| + }
|
| +
|
| private void clearEventLogs() throws Exception {
|
| final String code = "clearEventLogs()";
|
| JavaScriptUtils.executeJavaScriptAndWaitForResult(
|
| @@ -1759,6 +1777,16 @@ public class ImeTest extends ContentShellTestBase {
|
| });
|
| }
|
|
|
| + private int getCursorCapsMode(final int reqModes) throws Throwable {
|
| + final ChromiumBaseInputConnection connection = mConnection;
|
| + return runBlockingOnImeThread(new Callable<Integer>() {
|
| + @Override
|
| + public Integer call() {
|
| + return connection.getCursorCapsMode(reqModes);
|
| + }
|
| + });
|
| + }
|
| +
|
| private void dispatchKeyEvent(final KeyEvent event) {
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
|
|