Merge "Update ReOpenImeWindowTest to be in gestural nav mode" into sc-dev am: 6949bcfce7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15152030 Change-Id: Ic04940751ca0f9312544cff0677687324457a4cf
This commit is contained in:
@@ -21,6 +21,22 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
|||||||
|
|
||||||
const val IME_WINDOW_TITLE = "InputMethod"
|
const val IME_WINDOW_TITLE = "InputMethod"
|
||||||
|
|
||||||
|
fun FlickerTestParameter.imeLayerIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||||
|
if (rotatesScreen) {
|
||||||
|
assertLayers {
|
||||||
|
this.isVisible(IME_WINDOW_TITLE)
|
||||||
|
.then()
|
||||||
|
.isInvisible(IME_WINDOW_TITLE)
|
||||||
|
.then()
|
||||||
|
.isVisible(IME_WINDOW_TITLE)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
assertLayers {
|
||||||
|
this.isVisible(IME_WINDOW_TITLE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun FlickerTestParameter.imeLayerBecomesVisible() {
|
fun FlickerTestParameter.imeLayerBecomesVisible() {
|
||||||
assertLayers {
|
assertLayers {
|
||||||
this.isInvisible(IME_WINDOW_TITLE)
|
this.isInvisible(IME_WINDOW_TITLE)
|
||||||
@@ -49,6 +65,22 @@ fun FlickerTestParameter.imeAppWindowIsAlwaysVisible(testApp: IAppHelper) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun FlickerTestParameter.imeWindowIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||||
|
if (rotatesScreen) {
|
||||||
|
assertWm {
|
||||||
|
this.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||||
|
.then()
|
||||||
|
.hidesNonAppWindow(IME_WINDOW_TITLE)
|
||||||
|
.then()
|
||||||
|
.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
assertWm {
|
||||||
|
this.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun FlickerTestParameter.imeWindowBecomesVisible() {
|
fun FlickerTestParameter.imeWindowBecomesVisible() {
|
||||||
assertWm {
|
assertWm {
|
||||||
this.hidesNonAppWindow(IME_WINDOW_TITLE)
|
this.hidesNonAppWindow(IME_WINDOW_TITLE)
|
||||||
@@ -65,6 +97,25 @@ fun FlickerTestParameter.imeWindowBecomesInvisible() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun FlickerTestParameter.imeAppWindowIsAlwaysVisible(
|
||||||
|
testApp: IAppHelper,
|
||||||
|
rotatesScreen: Boolean = false
|
||||||
|
) {
|
||||||
|
if (rotatesScreen) {
|
||||||
|
assertWm {
|
||||||
|
this.showsAppWindow(testApp.getPackage())
|
||||||
|
.then()
|
||||||
|
.hidesAppWindow(testApp.getPackage())
|
||||||
|
.then()
|
||||||
|
.showsAppWindow(testApp.getPackage())
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
assertWm {
|
||||||
|
this.showsAppWindow(testApp.getPackage())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun FlickerTestParameter.imeAppWindowBecomesVisible(windowName: String) {
|
fun FlickerTestParameter.imeAppWindowBecomesVisible(windowName: String) {
|
||||||
assertWm {
|
assertWm {
|
||||||
this.hidesAppWindow(windowName)
|
this.hidesAppWindow(windowName)
|
||||||
|
|||||||
@@ -112,12 +112,11 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
|||||||
|
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@Test
|
@Test
|
||||||
fun imeWindowBecomesVisible() = testSpec.imeWindowBecomesVisible()
|
fun imeWindowIsAlwaysVisible() = testSpec.imeWindowIsAlwaysVisible(true)
|
||||||
|
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@Test
|
@Test
|
||||||
fun imeAppWindowBecomesVisible() =
|
fun imeAppWindowIsAlwaysVisible() = testSpec.imeAppWindowIsAlwaysVisible(testApp, true)
|
||||||
testSpec.imeAppWindowBecomesVisible(testAppComponentName.className)
|
|
||||||
|
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@Test
|
@Test
|
||||||
@@ -135,7 +134,7 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
|||||||
|
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@Test
|
@Test
|
||||||
fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible()
|
fun imeLayerIsAlwaysVisible() = testSpec.imeLayerIsAlwaysVisible(true)
|
||||||
|
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@Test
|
@Test
|
||||||
@@ -171,7 +170,7 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
|||||||
repetitions = 1,
|
repetitions = 1,
|
||||||
supportedRotations = listOf(Surface.ROTATION_0),
|
supportedRotations = listOf(Surface.ROTATION_0),
|
||||||
supportedNavigationModes = listOf(
|
supportedNavigationModes = listOf(
|
||||||
WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY
|
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user