Merge "Update OpenImeWindowFromFixedOrientationAppTest" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
843f8c3211
@@ -23,16 +23,16 @@ import android.view.Surface
|
|||||||
import android.view.WindowManagerPolicyConstants
|
import android.view.WindowManagerPolicyConstants
|
||||||
import androidx.test.filters.FlakyTest
|
import androidx.test.filters.FlakyTest
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
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.FlickerBuilderProvider
|
||||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||||
import com.android.server.wm.flicker.FlickerTestParameter
|
import com.android.server.wm.flicker.FlickerTestParameter
|
||||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||||
import com.android.server.wm.flicker.annotation.Group2
|
import com.android.server.wm.flicker.annotation.Group2
|
||||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
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.ImeAppAutoFocusHelper
|
||||||
import com.android.server.wm.flicker.helpers.setRotation
|
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.navBarWindowIsVisible
|
||||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||||
@@ -43,7 +43,8 @@ import org.junit.runners.MethodSorters
|
|||||||
import org.junit.runners.Parameterized
|
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`
|
* To run this test: `atest FlickerTests:OpenImeWindowFromFixedOrientationAppTest`
|
||||||
*/
|
*/
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
@@ -53,24 +54,31 @@ import org.junit.runners.Parameterized
|
|||||||
@Group2
|
@Group2
|
||||||
class OpenImeWindowFromFixedOrientationAppTest(private val testSpec: FlickerTestParameter) {
|
class OpenImeWindowFromFixedOrientationAppTest(private val testSpec: FlickerTestParameter) {
|
||||||
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||||
private val fixedOrientationApp = FixedOrientationAppHelper(instrumentation)
|
|
||||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||||
|
private val taplInstrumentation = LauncherInstrumentation()
|
||||||
|
|
||||||
@FlickerBuilderProvider
|
@FlickerBuilderProvider
|
||||||
fun buildFlicker(): FlickerBuilder {
|
fun buildFlicker(): FlickerBuilder {
|
||||||
return FlickerBuilder(instrumentation).apply {
|
return FlickerBuilder(instrumentation).apply {
|
||||||
setup {
|
setup {
|
||||||
|
test {
|
||||||
|
// Launch the activity with expecting IME will be shown.
|
||||||
|
imeTestApp.launchViaIntent(wmHelper)
|
||||||
|
}
|
||||||
eachRun {
|
eachRun {
|
||||||
fixedOrientationApp.launchViaIntent(wmHelper)
|
// Swiping out the IME activity to home.
|
||||||
this.setRotation(Surface.ROTATION_90)
|
taplInstrumentation.goHome()
|
||||||
|
wmHelper.waitForHomeActivityVisible()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
transitions {
|
transitions {
|
||||||
|
// Bring the exist IME activity to the front in landscape mode device rotation.
|
||||||
|
setRotation(Surface.ROTATION_90)
|
||||||
imeTestApp.launchViaIntent(wmHelper)
|
imeTestApp.launchViaIntent(wmHelper)
|
||||||
}
|
}
|
||||||
teardown {
|
teardown {
|
||||||
test {
|
test {
|
||||||
fixedOrientationApp.exit(wmHelper)
|
imeTestApp.exit(wmHelper)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +98,7 @@ class OpenImeWindowFromFixedOrientationAppTest(private val testSpec: FlickerTest
|
|||||||
|
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@Test
|
@Test
|
||||||
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
|
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerPositionEnd()
|
||||||
|
|
||||||
@FlakyTest(bugId = 206753786)
|
@FlakyTest(bugId = 206753786)
|
||||||
fun statusBarLayerRotatesScales() = testSpec.statusBarLayerRotatesScales()
|
fun statusBarLayerRotatesScales() = testSpec.statusBarLayerRotatesScales()
|
||||||
@@ -112,7 +120,7 @@ class OpenImeWindowFromFixedOrientationAppTest(private val testSpec: FlickerTest
|
|||||||
return FlickerTestParameterFactory.getInstance()
|
return FlickerTestParameterFactory.getInstance()
|
||||||
.getConfigNonRotationTests(
|
.getConfigNonRotationTests(
|
||||||
repetitions = 3,
|
repetitions = 3,
|
||||||
supportedRotations = listOf(Surface.ROTATION_0),
|
supportedRotations = listOf(Surface.ROTATION_90),
|
||||||
supportedNavigationModes = listOf(
|
supportedNavigationModes = listOf(
|
||||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
android:theme="@style/CutoutShortEdges"
|
android:theme="@style/CutoutShortEdges"
|
||||||
android:taskAffinity="com.android.server.wm.flicker.testapp.ImeActivityAutoFocus"
|
android:taskAffinity="com.android.server.wm.flicker.testapp.ImeActivityAutoFocus"
|
||||||
android:windowSoftInputMode="stateVisible"
|
android:windowSoftInputMode="stateVisible"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
android:label="ImeAppAutoFocus"
|
android:label="ImeAppAutoFocus"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
Reference in New Issue
Block a user