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

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

Issue 2010803005: Add events tests for inputText in IME test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 f2e37c29eebb31345ed0afe4b296c470b9a13d48..36bf4f3cf967741b021b2715f490e3fbc744c4c0 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
@@ -1118,6 +1118,8 @@ public class ImeTest extends ContentShellTestBase {
@Feature({"TextInput"})
public void testContentEditableEvents_SetComposingText() throws Throwable {
focusElementAndWaitForStateUpdate("contenteditable_event");
+ waitForEventLogs("selectionchange,selectionchange,selectionchange");
+
beginBatchEdit();
setComposingText("a", 1);
finishComposingText();
@@ -1133,14 +1135,79 @@ public class ImeTest extends ContentShellTestBase {
@MediumTest
@Feature({"TextInput"})
+ public void testInputTextEvents_SetComposingText() throws Throwable {
+ waitForEventLogs("selectionchange");
+
Changwan Ryu 2016/05/26 07:38:09 why don't you clear logs after waiting here? Also,
+ beginBatchEdit();
+ setComposingText("a", 1);
+ finishComposingText();
+ endBatchEdit();
+ waitAndVerifyUpdateSelection(0, 1, 1, -1, -1);
+
+ // TODO(changwan): reduce the number of selection changes
+ waitForEventLogs("selectionchange,keydown(229),compositionstart(),compositionupdate(a),"
+ + "input,keyup(229),compositionupdate(a),input,compositionend(a),selectionchange,"
+ + "selectionchange,selectionchange,selectionchange,selectionchange");
+ }
+
+ @MediumTest
+ @Feature({"TextInput"})
public void testContentEditableEvents_CommitText() throws Throwable {
focusElementAndWaitForStateUpdate("contenteditable_event");
+ waitForEventLogs("selectionchange,selectionchange,selectionchange");
+
+ commitText("a", 1);
+ waitAndVerifyUpdateSelection(0, 1, 1, -1, -1);
+
+ // TODO(changwan): reduce the number of selection changes
+ waitForEventLogs("selectionchange,selectionchange,selectionchange,keydown(229),input,"
+ + "keyup(229),selectionchange");
+ }
+
+ @MediumTest
+ @Feature({"TextInput"})
+ public void testInputTextEvents_CommitText() throws Throwable {
+ waitForEventLogs("selectionchange");
+
+ commitText("a", 1);
+ waitAndVerifyUpdateSelection(0, 1, 1, -1, -1);
+
+ // TODO(changwan): reduce the number of selection changes
+ waitForEventLogs("selectionchange,keydown(229),input,keyup(229),selectionchange");
+ }
+
+ @MediumTest
+ @Feature({"TextInput"})
+ public void testContentEditableEvents_DeleteSurroundingText() throws Throwable {
+ focusElementAndWaitForStateUpdate("contenteditable_event");
+ waitForEventLogs("selectionchange,selectionchange,selectionchange");
+
commitText("a", 1);
waitAndVerifyUpdateSelection(0, 1, 1, -1, -1);
// TODO(changwan): reduce the number of selection changes
waitForEventLogs("selectionchange,selectionchange,selectionchange,keydown(229),input,"
+ "keyup(229),selectionchange");
+
+ deleteSurroundingText(1, 0);
+ waitForEventLogs("selectionchange,selectionchange,selectionchange,keydown(229),input,"
+ + "keyup(229),selectionchange,keydown(229),input,keyup(229)");
+ }
+
+ @MediumTest
+ @Feature({"TextInput"})
+ public void testInputTextEvents_DeleteSurroundingText() throws Throwable {
+ waitForEventLogs("selectionchange");
+
+ commitText("a", 1);
+ waitAndVerifyUpdateSelection(0, 1, 1, -1, -1);
+
+ // TODO(changwan): reduce the number of selection changes
+ waitForEventLogs("selectionchange,keydown(229),input,keyup(229),selectionchange");
+
+ deleteSurroundingText(1, 0);
+ waitForEventLogs("selectionchange,keydown(229),input,keyup(229),selectionchange,"
+ + "keydown(229),input,keyup(229)");
}
private void waitForEventLogs(String expectedLogs) throws Throwable {
« no previous file with comments | « no previous file | content/test/data/android/input/input_forms.html » ('j') | content/test/data/android/input/input_forms.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698