Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4b94223 authored by Tracy Zhou's avatar Tracy Zhou Committed by Automerger Merge Worker
Browse files

Merge "Update ReOpenImeWindowTest to be in gestural nav mode" into sc-dev am:...

Merge "Update ReOpenImeWindowTest to be in gestural nav mode" into sc-dev am: 6949bcfc am: c0f6b90e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15152030

Change-Id: Ifc46e559b8bf6a0204e1ac8039c2f265e5cad82c
parents c26e3979 c0f6b90e
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
@@ -21,6 +21,22 @@ import com.android.server.wm.flicker.FlickerTestParameter

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() {
    assertLayers {
        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() {
    assertWm {
        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) {
    assertWm {
        this.hidesAppWindow(windowName)
+4 −5
Original line number Diff line number Diff line
@@ -112,12 +112,11 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {

    @Presubmit
    @Test
    fun imeWindowBecomesVisible() = testSpec.imeWindowBecomesVisible()
    fun imeWindowIsAlwaysVisible() = testSpec.imeWindowIsAlwaysVisible(true)

    @Presubmit
    @Test
    fun imeAppWindowBecomesVisible() =
        testSpec.imeAppWindowBecomesVisible(testAppComponentName.className)
    fun imeAppWindowIsAlwaysVisible() = testSpec.imeAppWindowIsAlwaysVisible(testApp, true)

    @Presubmit
    @Test
@@ -135,7 +134,7 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {

    @Presubmit
    @Test
    fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible()
    fun imeLayerIsAlwaysVisible() = testSpec.imeLayerIsAlwaysVisible(true)

    @Presubmit
    @Test
@@ -171,7 +170,7 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
                    repetitions = 1,
                    supportedRotations = listOf(Surface.ROTATION_0),
                    supportedNavigationModes = listOf(
                        WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY
                        WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
                    )
                )
        }