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

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

Issue 2349383004: Implement ThreadedInputConnection#getCursorCapsMode() (Closed)
Patch Set: Created 4 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.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/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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698