Loading services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidManifest.xml +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.inputmethod.imetests"> package="com.android.inputmethodservice"> <!-- Permissions required for granting and logging --> <uses-permission android:name="android.permission.LOG_COMPAT_CHANGE"/> Loading @@ -33,7 +33,7 @@ </application> <!-- The "targetPackage" reference the instruments APK package, which is the SimpleTestIme.apk, while the test package is "com.android.inputmethod.imetests" (FrameworksImeTests.apk).--> while the test package is "com.android.inputmethodservice" (FrameworksImeTests.apk).--> <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="com.android.apps.inputmethod.simpleime" Loading services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidTest.xml +4 −3 Original line number Diff line number Diff line Loading @@ -34,14 +34,15 @@ <option name="test-tag" value="FrameworksImeTests" /> <test class="com.android.tradefed.testtype.AndroidJUnitTest" > <option name="package" value="com.android.inputmethod.imetests" /> <option name="package" value="com.android.inputmethodservice" /> <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" /> <option name="hidden-api-checks" value="false"/> </test> <!-- Collect the files in the dump directory for debugging --> <!-- Collect output of DumpOnFailure --> <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector"> <option name="directory-keys" value="/sdcard/FrameworksImeTests/" /> <option name="directory-keys" value="/data/user/0/com.android.apps.inputmethod.simpleime/files" /> <option name="collect-on-run-ended-only" value="true" /> <option name="clean-up" value="true" /> </metrics_collector> </configuration> services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/InputMethodServiceTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import android.os.RemoteException; import android.platform.test.annotations.RequiresFlagsEnabled; import android.platform.test.flag.junit.DeviceFlagsValueProvider; import android.provider.Settings; import android.server.wm.DumpOnFailure; import android.server.wm.WindowManagerStateHelper; import android.util.Log; import android.view.View; Loading Loading @@ -123,6 +124,9 @@ public class InputMethodServiceTest { @Rule public final TestName mName = new TestName(); @Rule public final DumpOnFailure mDumpOnFailure = new DumpOnFailure(); private Instrumentation mInstrumentation; private UiDevice mUiDevice; private InputMethodManager mImm; Loading Loading @@ -1284,8 +1288,13 @@ public class InputMethodServiceTest { @NonNull private UiObject2 getUiObject(@NonNull BySelector bySelector) { final var preScreenshot = mInstrumentation.getUiAutomation().takeScreenshot(); mDumpOnFailure.dumpOnFailure("pre-getUiObject", preScreenshot); final var uiObject = mUiDevice.wait(Until.findObject(bySelector), TIMEOUT_MS); assertWithMessage("UiObject with " + bySelector + " was found").that(uiObject).isNotNull(); mInstrumentation.waitForIdleSync(); final var postScreenshot = mInstrumentation.getUiAutomation().takeScreenshot(); mDumpOnFailure.dumpOnFailure("post-getUiObject", postScreenshot); assertWithMessage("UiObject with " + bySelector + " was found").that(uiObject).isNull(); return uiObject; } Loading Loading
services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidManifest.xml +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.inputmethod.imetests"> package="com.android.inputmethodservice"> <!-- Permissions required for granting and logging --> <uses-permission android:name="android.permission.LOG_COMPAT_CHANGE"/> Loading @@ -33,7 +33,7 @@ </application> <!-- The "targetPackage" reference the instruments APK package, which is the SimpleTestIme.apk, while the test package is "com.android.inputmethod.imetests" (FrameworksImeTests.apk).--> while the test package is "com.android.inputmethodservice" (FrameworksImeTests.apk).--> <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="com.android.apps.inputmethod.simpleime" Loading
services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/AndroidTest.xml +4 −3 Original line number Diff line number Diff line Loading @@ -34,14 +34,15 @@ <option name="test-tag" value="FrameworksImeTests" /> <test class="com.android.tradefed.testtype.AndroidJUnitTest" > <option name="package" value="com.android.inputmethod.imetests" /> <option name="package" value="com.android.inputmethodservice" /> <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" /> <option name="hidden-api-checks" value="false"/> </test> <!-- Collect the files in the dump directory for debugging --> <!-- Collect output of DumpOnFailure --> <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector"> <option name="directory-keys" value="/sdcard/FrameworksImeTests/" /> <option name="directory-keys" value="/data/user/0/com.android.apps.inputmethod.simpleime/files" /> <option name="collect-on-run-ended-only" value="true" /> <option name="clean-up" value="true" /> </metrics_collector> </configuration>
services/tests/InputMethodSystemServerTests/src/com/android/inputmethodservice/InputMethodServiceTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import android.os.RemoteException; import android.platform.test.annotations.RequiresFlagsEnabled; import android.platform.test.flag.junit.DeviceFlagsValueProvider; import android.provider.Settings; import android.server.wm.DumpOnFailure; import android.server.wm.WindowManagerStateHelper; import android.util.Log; import android.view.View; Loading Loading @@ -123,6 +124,9 @@ public class InputMethodServiceTest { @Rule public final TestName mName = new TestName(); @Rule public final DumpOnFailure mDumpOnFailure = new DumpOnFailure(); private Instrumentation mInstrumentation; private UiDevice mUiDevice; private InputMethodManager mImm; Loading Loading @@ -1284,8 +1288,13 @@ public class InputMethodServiceTest { @NonNull private UiObject2 getUiObject(@NonNull BySelector bySelector) { final var preScreenshot = mInstrumentation.getUiAutomation().takeScreenshot(); mDumpOnFailure.dumpOnFailure("pre-getUiObject", preScreenshot); final var uiObject = mUiDevice.wait(Until.findObject(bySelector), TIMEOUT_MS); assertWithMessage("UiObject with " + bySelector + " was found").that(uiObject).isNotNull(); mInstrumentation.waitForIdleSync(); final var postScreenshot = mInstrumentation.getUiAutomation().takeScreenshot(); mDumpOnFailure.dumpOnFailure("post-getUiObject", postScreenshot); assertWithMessage("UiObject with " + bySelector + " was found").that(uiObject).isNull(); return uiObject; } Loading