summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/tests/InputMethodSystemServerTests/Android.bp1
-rw-r--r--services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/InputMethodServiceTest.java10
-rw-r--r--services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/src/com/android/apps/inputmethod/simpleime/testing/TestActivity.java2
3 files changed, 4 insertions, 9 deletions
diff --git a/services/tests/InputMethodSystemServerTests/Android.bp b/services/tests/InputMethodSystemServerTests/Android.bp
index de5f6ac0bf1e..ae9a34efc222 100644
--- a/services/tests/InputMethodSystemServerTests/Android.bp
+++ b/services/tests/InputMethodSystemServerTests/Android.bp
@@ -110,6 +110,7 @@ android_test {
"androidx.test.espresso.core",
"androidx.test.ext.truth",
"androidx.test.runner",
+ "cts-input-lib",
"cts-wm-util",
"frameworks-base-testutils",
"mockito-target-extended-minus-junit4",
diff --git a/services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/InputMethodServiceTest.java b/services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/InputMethodServiceTest.java
index 8a52d46f9f0a..a103b0583eac 100644
--- a/services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/InputMethodServiceTest.java
+++ b/services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/InputMethodServiceTest.java
@@ -19,6 +19,7 @@ package com.android.inputmethodservice;
import static android.view.WindowInsets.Type.captionBar;
import static com.android.compatibility.common.util.SystemUtil.eventually;
+import static com.android.cts.input.injectinputinprocess.InjectInputInProcessKt.clickOnViewCenter;
import static com.android.internal.inputmethod.InputMethodNavButtonFlags.IME_DRAWS_IME_NAV_BAR;
import static com.android.internal.inputmethod.InputMethodNavButtonFlags.SHOW_IME_SWITCHER_WHEN_IME_IS_SHOWN;
@@ -77,7 +78,6 @@ public class InputMethodServiceTest {
private static final String TAG = "SimpleIMSTest";
private static final String INPUT_METHOD_SERVICE_NAME = ".SimpleInputMethodService";
- private static final String EDIT_TEXT_DESC = "Input box";
private static final String INPUT_METHOD_NAV_BACK_ID =
"android:id/input_method_nav_back";
private static final String INPUT_METHOD_NAV_IME_SWITCHER_ID =
@@ -168,7 +168,7 @@ public class InputMethodServiceTest {
// Performs click on EditText to bring up the IME.
Log.i(TAG, "Click on EditText");
verifyInputViewStatus(
- this::clickOnEditText,
+ () -> clickOnViewCenter(mActivity.getEditText()),
true /* expected */,
true /* inputViewStarted */);
assertWithMessage("IME is shown").that(mInputMethodService.isInputViewShown()).isTrue();
@@ -1260,10 +1260,4 @@ public class InputMethodServiceTest {
controller.hide(captionBar());
}
}
-
- private void clickOnEditText() {
- // Find the editText and click it.
- getUiObject(By.desc(EDIT_TEXT_DESC)).click();
- mInstrumentation.waitForIdleSync();
- }
}
diff --git a/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/src/com/android/apps/inputmethod/simpleime/testing/TestActivity.java b/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/src/com/android/apps/inputmethod/simpleime/testing/TestActivity.java
index 5a73ed5b25e1..eadbac3ca74b 100644
--- a/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/src/com/android/apps/inputmethod/simpleime/testing/TestActivity.java
+++ b/services/tests/InputMethodSystemServerTests/test-apps/SimpleTestIme/src/com/android/apps/inputmethod/simpleime/testing/TestActivity.java
@@ -75,7 +75,7 @@ public final class TestActivity extends Activity {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
final var rootView = new LinearLayout(this);
mEditText = new EditText(this);
- mEditText.setContentDescription("Input box");
+ mEditText.setHint("editText");
rootView.addView(mEditText, new LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT));
rootView.setFitsSystemWindows(true);
setContentView(rootView);