Loading tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppAutoFocusHelper.kt +14 −1 Original line number Diff line number Diff line Loading @@ -19,8 +19,21 @@ package com.android.server.wm.flicker.helpers import android.app.Instrumentation import androidx.test.uiautomator.UiDevice class ImeAppAutoFocusHelper(instr: Instrumentation) : ImeAppHelper(instr, "ImeAppAutoFocus") { class ImeAppAutoFocusHelper @JvmOverloads constructor( instr: Instrumentation, private val rotation: Int, private val imePackageName: String = IME_PACKAGE ) : ImeAppHelper(instr, "ImeAppAutoFocus") { override fun openIME(device: UiDevice) { // do nothing (the app is focused automatically) } override fun open() { val expectedPackage = if (rotation.isRotated()) { imePackageName } else { packageName } launcherStrategy.launch(appName, expectedPackage) } } tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -61,10 +61,11 @@ class CloseImeAutoOpenWindowToAppTest( @JvmStatic fun getParams(): List<Array<Any>> { val instrumentation = InstrumentationRegistry.getInstrumentation() val testApp = ImeAppAutoFocusHelper(instrumentation) return FlickerTestRunnerFactory(instrumentation) .buildTest { configuration -> val testApp = ImeAppAutoFocusHelper(instrumentation, configuration.startRotation) withTag { buildTestTag("imeToAppAutoOpen", testApp, configuration) } repeat { configuration.repetitions } setup { Loading tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -61,10 +61,11 @@ class CloseImeAutoOpenWindowToHomeTest( @JvmStatic fun getParams(): List<Array<Any>> { val instrumentation = InstrumentationRegistry.getInstrumentation() val testApp = ImeAppAutoFocusHelper(instrumentation) return FlickerTestRunnerFactory(instrumentation) .buildTest { configuration -> val testApp = ImeAppAutoFocusHelper(instrumentation, configuration.startRotation) withTestName { buildTestTag("imeToHomeAutoOpen", testApp, configuration) } Loading tests/FlickerTests/src/com/android/server/wm/flicker/ime/ReOpenImeWindowTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -66,11 +66,12 @@ class ReOpenImeWindowTest( @JvmStatic fun getParams(): List<Array<Any>> { val instrumentation = InstrumentationRegistry.getInstrumentation() val testApp = ImeAppAutoFocusHelper(instrumentation) val testAppComponentName = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME return FlickerTestRunnerFactory(instrumentation, repetitions = 5) .buildTest { configuration -> val testApp = ImeAppAutoFocusHelper(instrumentation, configuration.startRotation) withTestName { buildTestTag("reOpenImeAutoFocus", testApp, configuration) } repeat { configuration.repetitions } setup { Loading Loading
tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppAutoFocusHelper.kt +14 −1 Original line number Diff line number Diff line Loading @@ -19,8 +19,21 @@ package com.android.server.wm.flicker.helpers import android.app.Instrumentation import androidx.test.uiautomator.UiDevice class ImeAppAutoFocusHelper(instr: Instrumentation) : ImeAppHelper(instr, "ImeAppAutoFocus") { class ImeAppAutoFocusHelper @JvmOverloads constructor( instr: Instrumentation, private val rotation: Int, private val imePackageName: String = IME_PACKAGE ) : ImeAppHelper(instr, "ImeAppAutoFocus") { override fun openIME(device: UiDevice) { // do nothing (the app is focused automatically) } override fun open() { val expectedPackage = if (rotation.isRotated()) { imePackageName } else { packageName } launcherStrategy.launch(appName, expectedPackage) } }
tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -61,10 +61,11 @@ class CloseImeAutoOpenWindowToAppTest( @JvmStatic fun getParams(): List<Array<Any>> { val instrumentation = InstrumentationRegistry.getInstrumentation() val testApp = ImeAppAutoFocusHelper(instrumentation) return FlickerTestRunnerFactory(instrumentation) .buildTest { configuration -> val testApp = ImeAppAutoFocusHelper(instrumentation, configuration.startRotation) withTag { buildTestTag("imeToAppAutoOpen", testApp, configuration) } repeat { configuration.repetitions } setup { Loading
tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -61,10 +61,11 @@ class CloseImeAutoOpenWindowToHomeTest( @JvmStatic fun getParams(): List<Array<Any>> { val instrumentation = InstrumentationRegistry.getInstrumentation() val testApp = ImeAppAutoFocusHelper(instrumentation) return FlickerTestRunnerFactory(instrumentation) .buildTest { configuration -> val testApp = ImeAppAutoFocusHelper(instrumentation, configuration.startRotation) withTestName { buildTestTag("imeToHomeAutoOpen", testApp, configuration) } Loading
tests/FlickerTests/src/com/android/server/wm/flicker/ime/ReOpenImeWindowTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -66,11 +66,12 @@ class ReOpenImeWindowTest( @JvmStatic fun getParams(): List<Array<Any>> { val instrumentation = InstrumentationRegistry.getInstrumentation() val testApp = ImeAppAutoFocusHelper(instrumentation) val testAppComponentName = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME return FlickerTestRunnerFactory(instrumentation, repetitions = 5) .buildTest { configuration -> val testApp = ImeAppAutoFocusHelper(instrumentation, configuration.startRotation) withTestName { buildTestTag("reOpenImeAutoFocus", testApp, configuration) } repeat { configuration.repetitions } setup { Loading