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

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

Issue 1583283008: Convert commitText("\n") to synthetic Enter key press. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 4 years, 11 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java ('k') | no next file » | 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 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);
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698