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

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

Issue 848223003: [IME] Use proper const in ImeAdaptor for autocomplete, updating tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put back import java.lang.CharSequence (presubmit was wrong). Created 5 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 50828fd363dadbb85b436e87b5161d1a5541647a..339ce61933d0b87efc40eb14caad076db9d8d603 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
@@ -45,6 +45,8 @@ public class ImeTest extends ContentShellTestBase {
+ "<input id=\"input_text\" type=\"text\" /><br/>"
+ "<input id=\"input_radio\" type=\"radio\" style=\"width:50px;height:50px\" />"
+ "<br/><textarea id=\"textarea\" rows=\"4\" cols=\"20\"></textarea>"
+ + "<br/><textarea id=\"textarea2\" rows=\"4\" cols=\"20\" autocomplete=\"off\">"
+ + "</textarea>"
+ "<br/><p><span id=\"plain_text\">This is Plain Text One</span></p>"
+ "</form></body></html>");
private static final int COMPOSITION_KEY_CODE = 229;
@@ -700,13 +702,14 @@ public class ImeTest extends ContentShellTestBase {
@SmallTest
@Feature({"TextInput", "Main"})
public void testTransitionsWhileComposingText() throws Throwable {
- DOMUtils.focusNode(mWebContents, "textarea");
+ DOMUtils.focusNode(mWebContents, "textarea"); // Default with autocomplete="on"
assertWaitForKeyboardStatus(true);
mConnection = (TestAdapterInputConnection) getAdapterInputConnection();
waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 0, "", 0, 0, -1, -1);
// H
+ // Since autocomplete="on" by default, COMPOSITION_KEY_CODE is emitted as key code
expectUpdateStateCall(mConnection);
setComposingText(mConnection, "h", 1);
assertEquals(COMPOSITION_KEY_CODE, mImeAdapter.mLastSyntheticKeyCode);
@@ -721,6 +724,30 @@ public class ImeTest extends ContentShellTestBase {
}
@SmallTest
+ @Feature({"TextInput", "Main"})
+ public void testTransitionsWhileEmittingKeyCode() throws Throwable {
+ DOMUtils.focusNode(mWebContents, "textarea2"); // autocomplete="off"
+ assertWaitForKeyboardStatus(true);
+
+ mConnection = (TestAdapterInputConnection) getAdapterInputConnection();
+ waitAndVerifyEditableCallback(mConnection.mImeUpdateQueue, 0, "", 0, 0, -1, -1);
+
+ // H
+ // Since autocomplete="off", regular key codes are emitted.
+ expectUpdateStateCall(mConnection);
+ setComposingText(mConnection, "h", 1);
+ assertEquals(KeyEvent.KEYCODE_H, mImeAdapter.mLastSyntheticKeyCode);
+
+ // Simulate switch of input fields.
+ finishComposingText(mConnection);
+
+ // H
+ expectUpdateStateCall(mConnection);
+ setComposingText(mConnection, "h", 1);
+ assertEquals(KeyEvent.KEYCODE_H, mImeAdapter.mLastSyntheticKeyCode);
+ }
+
+ @SmallTest
@Feature({"TextInput"})
public void testPastePopupShowOnLongPress() throws Throwable {
commitText(mConnection, "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