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

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

Issue 1847583003: Fix setComposingText when newCursorPosition != 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix setComposingText when newCursorPosition < 1 Created 4 years, 9 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 d8c1eafd3d0bd5bfcd57611609f6201e431798f5..4d8de34c6beab5d3be35cc6a588fe2ae5239e854 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
@@ -104,6 +104,42 @@ public class ImeTest extends ContentShellTestBase {
resetAllStates();
}
+ @SmallTest
+ @Feature({"TextInput", "Main"})
+ public void testSetComposingTextWhennewCursorPositionsChanges() throws Throwable {
Changwan Ryu 2016/04/01 00:37:26 WhenNewCursorPositionChanges --> This sounds as i
yabinh 2016/04/01 04:14:17 Acknowledged.
+ // setcomposingText doesn't work for ReplicaInputConnection because there are bugs in
+ // BaseInputConnection.
Changwan Ryu 2016/04/01 00:37:26 1. s/there are bugs/there is a bug 2. casing error
yabinh 2016/04/01 04:14:17 Acknowledged.
+ if (!usingReplicaInputConnection()) {
+ // after composing text
Changwan Ryu 2016/04/01 00:37:26 this doesn't deliver enough context. what is after
yabinh 2016/04/01 04:14:17 Acknowledged.
+ setComposingText("a", 1);
+ waitAndVerifyUpdateSelection(0, 1, 1, 0, 1);
+
+ finishComposingText();
Changwan Ryu 2016/04/01 00:37:26 probably you don't need to finish composing text e
yabinh 2016/04/01 04:14:17 Acknowledged.
+ waitAndVerifyUpdateSelection(1, 1, 1, -1, -1);
+
+ // before composing text
+ setComposingText("b", 0);
+ waitAndVerifyUpdateSelection(2, 1, 1, 1, 2);
+
+ finishComposingText();
+ waitAndVerifyUpdateSelection(3, 1, 1, -1, -1);
+
+ // to left boundary
Changwan Ryu 2016/04/01 00:37:26 could you make it more clear, e.g. The new positio
yabinh 2016/04/01 04:14:17 Acknowledged.
+ setComposingText("c", -1);
+ waitAndVerifyUpdateSelection(4, 0, 0, 1, 2);
+
+ finishComposingText();
+ waitAndVerifyUpdateSelection(5, 0, 0, -1, -1);
+
+ // exceed left boundary
+ setComposingText("d", -10);
+ waitAndVerifyUpdateSelection(6, 0, 0, 0, 1);
+
+ finishComposingText();
+ waitAndVerifyUpdateSelection(7, 0, 0, -1, -1);
+ }
+ }
+
@MediumTest
@Feature({"TextInput", "Main"})
public void testKeyboardDismissedAfterClickingGo() throws Throwable {

Powered by Google App Engine
This is Rietveld 408576698