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

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

Issue 132913007: hide the input method window when the user is done typing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 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/AdapterInputConnection.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/AdapterInputConnectionTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/input/AdapterInputConnectionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/input/AdapterInputConnectionTest.java
index 9dcce92d8072259dc004439dc0256de4ee284a4c..9321bc5cab9e160a1aece35fe7f18ee2430d2b1c 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/input/AdapterInputConnectionTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/input/AdapterInputConnectionTest.java
@@ -78,6 +78,32 @@ public class AdapterInputConnectionTest extends ContentShellTestBase {
mWrapper.verifyUpdateSelectionCall(0, 4, 4, 0 ,4);
}
+ @MediumTest
+ @Feature({"TextInput", "Main"})
+ public void testDismissInputMethodWindowAfterFinishingTyping() throws Throwable {
+ assertEquals(false, mWrapper.isHidden());
+
+ mConnection.performEditorAction(EditorInfo.IME_ACTION_NEXT);
+ assertEquals(false, mWrapper.isHidden());
+ mWrapper.showSoftInput(null, 0, null);
+
+ mConnection.performEditorAction(EditorInfo.IME_ACTION_SEND);
+ assertEquals(false, mWrapper.isHidden());
+ mWrapper.showSoftInput(null, 0, null);
+
+ mConnection.performEditorAction(EditorInfo.IME_ACTION_GO);
+ assertEquals(true, mWrapper.isHidden());
+ mWrapper.showSoftInput(null, 0, null);
+
+ mConnection.performEditorAction(EditorInfo.IME_ACTION_DONE);
+ assertEquals(true, mWrapper.isHidden());
+ mWrapper.showSoftInput(null, 0, null);
+
+ mConnection.performEditorAction(EditorInfo.IME_ACTION_SEARCH);
+ assertEquals(true, mWrapper.isHidden());
+ mWrapper.showSoftInput(null, 0, null);
+ }
+
private static class TestImeAdapter extends ImeAdapter {
public TestImeAdapter(InputMethodManagerWrapper wrapper, ImeAdapterDelegate embedder) {
super(wrapper, embedder);
@@ -86,6 +112,7 @@ public class AdapterInputConnectionTest extends ContentShellTestBase {
private static class TestInputMethodManagerWrapper extends InputMethodManagerWrapper {
private final ArrayList<ImeState> mUpdates = new ArrayList<ImeState>();
+ private boolean hidden = false;
public TestInputMethodManagerWrapper(Context context) {
super(context);
@@ -95,7 +122,9 @@ public class AdapterInputConnectionTest extends ContentShellTestBase {
public void restartInput(View view) {}
@Override
- public void showSoftInput(View view, int flags, ResultReceiver resultReceiver) {}
+ public void showSoftInput(View view, int flags, ResultReceiver resultReceiver) {
+ hidden = false;
+ }
@Override
public boolean isActive(View view) {
@@ -105,6 +134,7 @@ public class AdapterInputConnectionTest extends ContentShellTestBase {
@Override
public boolean hideSoftInputFromWindow(IBinder windowToken, int flags,
ResultReceiver resultReceiver) {
+ hidden = true;
return true;
}
@@ -127,6 +157,10 @@ public class AdapterInputConnectionTest extends ContentShellTestBase {
state.compositionStart);
assertEquals("Composition end did not match", compositionEnd, state.compositionEnd);
}
+
+ public boolean isHidden() {
+ return hidden;
+ }
}
private static class TestImeAdapterDelegate implements ImeAdapterDelegate {
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698