diff options
| author | 2022-05-30 15:49:41 +0000 | |
|---|---|---|
| committer | 2022-05-30 15:49:41 +0000 | |
| commit | 843f8c3211a77dacda3653cee03e849d48bae33a (patch) | |
| tree | 61ecf30d066e1c0055dda1433c3cacc6da904b46 | |
| parent | df428426224f8d2461817fed551b3476bf171a6b (diff) | |
| parent | 703f9b894887b206840148dcef24f3f525e845d3 (diff) | |
Merge "Update OpenImeWindowFromFixedOrientationAppTest" into tm-qpr-dev
| -rw-r--r-- | tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt | 26 | ||||
| -rw-r--r-- | tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml | 1 |
2 files changed, 18 insertions, 9 deletions
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt index 78aea1f1fb17..933a3a0458ee 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt @@ -23,16 +23,16 @@ import android.view.Surface import android.view.WindowManagerPolicyConstants import androidx.test.filters.FlakyTest import androidx.test.platform.app.InstrumentationRegistry +import com.android.launcher3.tapl.LauncherInstrumentation import com.android.server.wm.flicker.FlickerBuilderProvider import com.android.server.wm.flicker.FlickerParametersRunnerFactory import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.Group2 import com.android.server.wm.flicker.dsl.FlickerBuilder -import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper import com.android.server.wm.flicker.helpers.setRotation -import com.android.server.wm.flicker.navBarLayerRotatesAndScales +import com.android.server.wm.flicker.navBarLayerPositionEnd import com.android.server.wm.flicker.navBarWindowIsVisible import com.android.server.wm.flicker.statusBarLayerRotatesScales import com.android.server.wm.flicker.statusBarWindowIsVisible @@ -43,7 +43,8 @@ import org.junit.runners.MethodSorters import org.junit.runners.Parameterized /** - * Test IME window layer will become visible when switching from the fixed orientation activity. + * Test IME window layer will become visible when switching from the fixed orientation activity + * (e.g. Launcher activity). * To run this test: `atest FlickerTests:OpenImeWindowFromFixedOrientationAppTest` */ @RequiresDevice @@ -53,24 +54,31 @@ import org.junit.runners.Parameterized @Group2 class OpenImeWindowFromFixedOrientationAppTest(private val testSpec: FlickerTestParameter) { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() - private val fixedOrientationApp = FixedOrientationAppHelper(instrumentation) private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation) + private val taplInstrumentation = LauncherInstrumentation() @FlickerBuilderProvider fun buildFlicker(): FlickerBuilder { return FlickerBuilder(instrumentation).apply { setup { + test { + // Launch the activity with expecting IME will be shown. + imeTestApp.launchViaIntent(wmHelper) + } eachRun { - fixedOrientationApp.launchViaIntent(wmHelper) - this.setRotation(Surface.ROTATION_90) + // Swiping out the IME activity to home. + taplInstrumentation.goHome() + wmHelper.waitForHomeActivityVisible() } } transitions { + // Bring the exist IME activity to the front in landscape mode device rotation. + setRotation(Surface.ROTATION_90) imeTestApp.launchViaIntent(wmHelper) } teardown { test { - fixedOrientationApp.exit(wmHelper) + imeTestApp.exit(wmHelper) } } } @@ -90,7 +98,7 @@ class OpenImeWindowFromFixedOrientationAppTest(private val testSpec: FlickerTest @Presubmit @Test - fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales() + fun navBarLayerRotatesAndScales() = testSpec.navBarLayerPositionEnd() @FlakyTest(bugId = 206753786) fun statusBarLayerRotatesScales() = testSpec.statusBarLayerRotatesScales() @@ -112,7 +120,7 @@ class OpenImeWindowFromFixedOrientationAppTest(private val testSpec: FlickerTest return FlickerTestParameterFactory.getInstance() .getConfigNonRotationTests( repetitions = 3, - supportedRotations = listOf(Surface.ROTATION_0), + supportedRotations = listOf(Surface.ROTATION_90), supportedNavigationModes = listOf( WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY ) diff --git a/tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml b/tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml index 43aa4b151548..3e2130dc480f 100644 --- a/tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml +++ b/tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml @@ -45,6 +45,7 @@ android:theme="@style/CutoutShortEdges" android:taskAffinity="com.android.server.wm.flicker.testapp.ImeActivityAutoFocus" android:windowSoftInputMode="stateVisible" + android:configChanges="orientation|screenSize" android:label="ImeAppAutoFocus" android:exported="true"> <intent-filter> |