Chromium Code Reviews| 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 { |