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

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

Issue 2020973002: Reland: Fix setComposingText with empty text when newCursorPosition != 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check the boundary in WebViewImpl instead of render_widget Created 4 years, 5 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
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 3a422176f6bc7d7761812ef566fc378d2f5fecc3..465aee593956a3f362dbe54cc106eefcc8b24a84 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
@@ -140,9 +140,6 @@ public class ImeTest extends ContentShellTestBase {
assertTextsAroundCursor("he", "", "llo");
}
yabinh 2016/07/06 11:53:55 I checked, and found it works for ReplicaInputConn
- // 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 testSetComposingTextForDifferentnewCursorPositions() throws Throwable {
@@ -191,6 +188,24 @@ public class ImeTest extends ContentShellTestBase {
@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 {
setComposingText("h", 1);
waitAndVerifyUpdateSelection(0, 1, 1, 0, 1);

Powered by Google App Engine
This is Rietveld 408576698