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

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

Issue 2530843003: Introduce InsertIncrementalTextCommand to respect existing style for composition (Closed)
Patch Set: Address xiaochengh@'s review Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/editing/BUILD.gn » ('j') | 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 2c6b42e2334d0ba34f7d6e5f8f02d4438b173a74..f1bf4b6484f348d8f8e839717145bfcd4555819c 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
@@ -1261,37 +1261,41 @@ public class ImeTest extends ContentShellTestBase {
@MediumTest
@Feature({"TextInput"})
@RetryOnFailure
- public void testContentEditableEvents_SetComposingText() throws Throwable {
+ public void testContentEditableEvents_ComposingText() throws Throwable {
focusElementAndWaitForStateUpdate("contenteditable_event");
waitForEventLogs("selectionchange,selectionchange");
clearEventLogs();
- beginBatchEdit();
setComposingText("a", 1);
- finishComposingText();
- endBatchEdit();
- waitAndVerifyUpdateSelection(0, 1, 1, -1, -1);
-
- // TODO(changwan): reduce the number of selection changes
+ waitAndVerifyUpdateSelection(0, 1, 1, 0, 1);
+ // TODO(changwan): reduce the number of selection changes.
waitForEventLogs("keydown(229),compositionstart(),compositionupdate(a),input,keyup(229),"
- + "compositionupdate(a),input,compositionend(a),selectionchange,selectionchange,"
- + "selectionchange,selectionchange,selectionchange");
+ + "selectionchange,selectionchange");
+ clearEventLogs();
+
+ finishComposingText();
+ waitAndVerifyUpdateSelection(1, 1, 1, -1, -1);
+ // TODO(changwan): reduce the number of selection changes.
+ waitForEventLogs(
+ "compositionupdate(a),input,compositionend(a),selectionchange,selectionchange");
}
@MediumTest
@Feature({"TextInput"})
@RetryOnFailure
- public void testInputTextEvents_SetComposingText() throws Throwable {
- beginBatchEdit();
+ public void testInputTextEvents_ComposingText() throws Throwable {
setComposingText("a", 1);
- finishComposingText();
- endBatchEdit();
- waitAndVerifyUpdateSelection(0, 1, 1, -1, -1);
-
- // TODO(changwan): reduce the number of selection changes
+ waitAndVerifyUpdateSelection(0, 1, 1, 0, 1);
+ // TODO(changwan): reduce the number of selection changes.
waitForEventLogs("keydown(229),compositionstart(),compositionupdate(a),"
- + "input,keyup(229),compositionupdate(a),input,compositionend(a),selectionchange,"
- + "selectionchange,selectionchange,selectionchange,selectionchange");
+ + "input,keyup(229),selectionchange,selectionchange");
+ clearEventLogs();
+
+ finishComposingText();
+ waitAndVerifyUpdateSelection(1, 1, 1, -1, -1);
+ // TODO(changwan): reduce the number of selection changes.
+ waitForEventLogs("compositionupdate(a),input,compositionend(a),selectionchange,"
+ + "selectionchange,selectionchange");
}
@MediumTest
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698