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

Commit 527e407e authored by Antonella Dellanzo's avatar Antonella Dellanzo Committed by Android (Google) Code Review
Browse files

Merge "Fix NavBar & StatusBar layer always visible assertion"

parents fdaa8875 a1d07a8c
Loading
Loading
Loading
Loading
+26 −4
Original line number Diff line number Diff line
@@ -77,21 +77,43 @@ fun LayersAssertion.noUncoveredRegions(

@JvmOverloads
fun LayersAssertion.navBarLayerIsAlwaysVisible(
    rotatesScreen: Boolean = false,
    bugId: Int = 0,
    enabled: Boolean = bugId == 0
) {
    if (rotatesScreen) {
        all("navBarLayerIsAlwaysVisible", enabled, bugId) {
            this.showsLayer(NAVIGATION_BAR_WINDOW_TITLE)
                    .then()
                    .hidesLayer(NAVIGATION_BAR_WINDOW_TITLE)
                    .then()
                    .showsLayer(NAVIGATION_BAR_WINDOW_TITLE)
        }
    } else {
        all("navBarLayerIsAlwaysVisible", enabled, bugId) {
            this.showsLayer(NAVIGATION_BAR_WINDOW_TITLE)
        }
    }
}

@JvmOverloads
fun LayersAssertion.statusBarLayerIsAlwaysVisible(
    rotatesScreen: Boolean = false,
    bugId: Int = 0,
    enabled: Boolean = bugId == 0
) {
    if (rotatesScreen) {
        all("statusBarLayerIsAlwaysVisible", enabled, bugId) {
            this.showsLayer(STATUS_BAR_WINDOW_TITLE)
                    .then()
                    hidesLayer(STATUS_BAR_WINDOW_TITLE)
                    .then()
                    .showsLayer(STATUS_BAR_WINDOW_TITLE)
        }
    } else {
        all("statusBarLayerIsAlwaysVisible", enabled, bugId) {
            this.showsLayer(STATUS_BAR_WINDOW_TITLE)
        }
    }
}

+5 −3
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import org.junit.runners.Parameterized

/**
 * Test IME window closing back to app window transitions.
 * To run this test: `atest FlickerTests:CloseImeWindowToAppTest`
 * To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToHomeTest`
 */
@Presubmit
@RequiresDevice
@@ -94,14 +94,16 @@ class CloseImeAutoOpenWindowToHomeTest(
                        }

                        layersTrace {
                            navBarLayerIsAlwaysVisible(bugId = 140855415)
                            statusBarLayerIsAlwaysVisible(bugId = 140855415)
                            noUncoveredRegions(configuration.startRotation, Surface.ROTATION_0,
                                allStates = false)
                            navBarLayerRotatesAndScales(configuration.startRotation,
                                Surface.ROTATION_0, bugId = 140855415)
                            statusBarLayerRotatesScales(configuration.startRotation,
                                Surface.ROTATION_0)
                            navBarLayerIsAlwaysVisible(configuration.startRotation !=
                                    Surface.ROTATION_0)
                            statusBarLayerIsAlwaysVisible(configuration.startRotation !=
                                    Surface.ROTATION_0)
                            imeLayerBecomesInvisible(bugId = 141458352)
                            imeAppLayerBecomesInvisible(testApp, bugId = 153739621)
                        }
+4 −2
Original line number Diff line number Diff line
@@ -100,14 +100,16 @@ class CloseImeWindowToHomeTest(
                        }

                        layersTrace {
                            navBarLayerIsAlwaysVisible(bugId = 140855415)
                            statusBarLayerIsAlwaysVisible(bugId = 140855415)
                            noUncoveredRegions(configuration.startRotation,
                                Surface.ROTATION_0, allStates = false)
                            navBarLayerRotatesAndScales(configuration.startRotation,
                                Surface.ROTATION_0, bugId = 140855415)
                            statusBarLayerRotatesScales(configuration.startRotation,
                                Surface.ROTATION_0)
                            navBarLayerIsAlwaysVisible(configuration.startRotation !=
                                    Surface.ROTATION_0)
                            statusBarLayerIsAlwaysVisible(configuration.startRotation !=
                                    Surface.ROTATION_0)
                            imeLayerBecomesInvisible(bugId = 153739621)
                            imeAppLayerBecomesInvisible(testApp, bugId = 153739621)
                        }
+6 −3
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ class OpenAppColdTest(
                        windowManagerTrace {
                            navBarWindowIsAlwaysVisible()
                            statusBarWindowIsAlwaysVisible()

                            appWindowReplacesLauncherAsTopWindow(testApp)
                            wallpaperWindowBecomesInvisible()
                        }
@@ -99,9 +100,11 @@ class OpenAppColdTest(
                                configuration.endRotation)
                            statusBarLayerRotatesScales(Surface.ROTATION_0,
                                configuration.endRotation)
                            navBarLayerIsAlwaysVisible(
                                enabled = configuration.endRotation == Surface.ROTATION_0)
                            statusBarLayerIsAlwaysVisible(enabled = false)
                            navBarLayerIsAlwaysVisible(Surface.ROTATION_0 !=
                                    configuration.endRotation)
                            statusBarLayerIsAlwaysVisible(Surface.ROTATION_0 !=
                                    configuration.endRotation)

                            wallpaperLayerBecomesInvisible(testApp)
                        }

+6 −3
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ class OpenAppWarmTest(
                        windowManagerTrace {
                            navBarWindowIsAlwaysVisible()
                            statusBarWindowIsAlwaysVisible()

                            appWindowReplacesLauncherAsTopWindow(testApp)
                            wallpaperWindowBecomesInvisible(enabled = false)
                        }
@@ -103,9 +104,11 @@ class OpenAppWarmTest(
                                configuration.endRotation)
                            statusBarLayerRotatesScales(Surface.ROTATION_0,
                                configuration.endRotation)
                            navBarLayerIsAlwaysVisible(
                                enabled = configuration.endRotation == Surface.ROTATION_0)
                            statusBarLayerIsAlwaysVisible(enabled = false)
                            navBarLayerIsAlwaysVisible(Surface.ROTATION_0 !=
                                    configuration.endRotation)
                            statusBarLayerIsAlwaysVisible(Surface.ROTATION_0 !=
                                    configuration.endRotation)

                            wallpaperLayerBecomesInvisible(testApp)
                        }