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 f2e37c29eebb31345ed0afe4b296c470b9a13d48..0b9135b900a58787f91801ee7910e9ea313d3f94 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 |
@@ -188,6 +188,27 @@ public class ImeTest extends ContentShellTestBase { |
waitAndVerifyUpdateSelection(10, 8, 8, 2, 6); |
} |
+ // When newCursorPosition != 1, setComposingText doesn't work for ReplicaInputConnection |
+ // because there is a bug in BaseInputConnection. |
+ @CommandLineFlags.Add("enable-features=ImeThread") |
+ @SmallTest |
+ @Feature({"TextInput", "Main"}) |
+ public void testSetComposingTextWithEmptyText() throws Throwable { |
+ commitText("hello", 1); |
+ waitAndVerifyUpdateSelection(0, 5, 5, -1, -1); |
+ |
+ setComposingText("AB", 1); |
+ waitAndVerifyUpdateSelection(1, 7, 7, 5, 7); |
+ |
+ // With previous composition. |
+ setComposingText("", -3); |
+ waitAndVerifyUpdateSelection(2, 2, 2, -1, -1); |
+ |
+ // Without previous composition. |
+ setComposingText("", 3); |
+ waitAndVerifyUpdateSelection(3, 4, 4, -1, -1); |
+ } |
+ |
@SmallTest |
@Feature({"TextInput", "Main"}) |
public void testCommitWhileComposingText() throws Throwable { |