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 5276a36b54d305ec8d10d4514e8f973bed56ee94..f2e39bc43361a7c87a250353376c0f83daaf74f9 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 |
@@ -147,6 +147,24 @@ public class ImeTest extends ContentShellTestBase { |
} |
@SmallTest |
+ @Feature({"TextInput", "Main"}) |
+ public void testCommitEnterKeyWhileComposingText() throws Throwable { |
+ focusElementAndWaitForStateUpdate("textarea"); |
+ |
+ setComposingText("hello", 1); |
+ waitAndVerifyStatesAndCalls(0, "hello", 5, 5, 0, 5); |
+ |
+ // Cancel the current composition and replace it with enter. |
+ commitText("\n", 1); |
+ // The second new line is not a user visible/editable one, it is a side-effect of Blink |
+ // using <br> internally. This only happens when \n is at the end. |
+ waitAndVerifyStatesAndCalls(1, "\n\n", 1, 1, -1, -1); |
+ |
+ commitText("world", 1); |
+ waitAndVerifyStatesAndCalls(2, "\nworld", 6, 6, -1, -1); |
+ } |
+ |
+ @SmallTest |
@Feature({"TextInput"}) |
public void testImeCopy() throws Exception { |
commitText("hello", 1); |