Loading tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +44 −4 Original line number Diff line number Diff line Loading @@ -102,13 +102,24 @@ fun FlickerTestParameter.statusBarLayerIsVisible() { } } fun FlickerTestParameter.navBarLayerRotatesAndScales() { /** * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the start * of the SF trace */ fun FlickerTestParameter.navBarLayerPositionStart() { assertLayersStart { val display = this.entry.displays.minByOrNull { it.id } ?: throw RuntimeException("There is no display!") this.visibleRegion(FlickerComponentName.NAV_BAR) .coversExactly(WindowUtils.getNavigationBarPosition(display)) } } /** * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the end * of the SF trace */ fun FlickerTestParameter.navBarLayerPositionEnd() { assertLayersEnd { val display = this.entry.displays.minByOrNull { it.id } ?: throw RuntimeException("There is no display!") Loading @@ -117,13 +128,33 @@ fun FlickerTestParameter.navBarLayerRotatesAndScales() { } } fun FlickerTestParameter.statusBarLayerRotatesScales() { /** * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the start * and end of the SF trace */ fun FlickerTestParameter.navBarLayerRotatesAndScales() { navBarLayerPositionStart() navBarLayerPositionEnd() } /** * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the start * of the SF trace */ fun FlickerTestParameter.statusBarLayerPositionStart() { assertLayersStart { val display = this.entry.displays.minByOrNull { it.id } ?: throw RuntimeException("There is no display!") this.visibleRegion(FlickerComponentName.STATUS_BAR) .coversExactly(WindowUtils.getStatusBarPosition(display)) } } /** * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the end * of the SF trace */ fun FlickerTestParameter.statusBarLayerPositionEnd() { assertLayersEnd { val display = this.entry.displays.minByOrNull { it.id } ?: throw RuntimeException("There is no display!") Loading @@ -132,6 +163,15 @@ fun FlickerTestParameter.statusBarLayerRotatesScales() { } } /** * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the start * and end of the SF trace */ fun FlickerTestParameter.statusBarLayerRotatesScales() { statusBarLayerPositionStart() statusBarLayerPositionEnd() } /** * Asserts that: * [originalLayer] is visible at the start of the trace Loading tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import org.junit.runners.Parameterized /** * Test cold launching an app from a notification from the lock screen. * * This test assumes the device doesn't have AOD enabled * * To run this test: `atest FlickerTests:OpenAppFromLockNotificationCold` */ @RequiresDevice Loading tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt +2 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import org.junit.runners.Parameterized /** * Test warm launching an app from a notification from the lock screen. * * This test assumes the device doesn't have AOD enabled * * To run this test: `atest FlickerTests:OpenAppFromLockNotificationWarm` */ @RequiresDevice Loading tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockTransition.kt +24 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.platform.test.annotations.Presubmit import androidx.test.filters.FlakyTest import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.flicker.navBarLayerPositionEnd import com.android.server.wm.traces.common.FlickerComponentName import org.junit.Test Loading Loading @@ -99,4 +100,27 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) @FlakyTest(bugId = 203538234) @Test override fun appWindowBecomesVisible() = super.appWindowBecomesVisible() /** * Checks the position of the navigation bar at the start and end of the transition * * Differently from the normal usage of this assertion, check only the final state of the * transition because the display is off at the start and the NavBar is never visible */ @Presubmit @Test override fun navBarLayerRotatesAndScales() = testSpec.navBarLayerPositionEnd() /** * Checks that the status bar layer is visible at the end of the trace * * It is not possible to check at the start because the screen is off */ @Presubmit @Test override fun statusBarLayerIsVisible() { testSpec.assertLayersEnd { this.isVisible(FlickerComponentName.STATUS_BAR) } } } tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt +2 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import org.junit.runners.Parameterized /** * Test cold launching an app from a notification. * * This test assumes the device doesn't have AOD enabled * * To run this test: `atest FlickerTests:OpenAppFromNotificationCold` */ @RequiresDevice Loading Loading
tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +44 −4 Original line number Diff line number Diff line Loading @@ -102,13 +102,24 @@ fun FlickerTestParameter.statusBarLayerIsVisible() { } } fun FlickerTestParameter.navBarLayerRotatesAndScales() { /** * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the start * of the SF trace */ fun FlickerTestParameter.navBarLayerPositionStart() { assertLayersStart { val display = this.entry.displays.minByOrNull { it.id } ?: throw RuntimeException("There is no display!") this.visibleRegion(FlickerComponentName.NAV_BAR) .coversExactly(WindowUtils.getNavigationBarPosition(display)) } } /** * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the end * of the SF trace */ fun FlickerTestParameter.navBarLayerPositionEnd() { assertLayersEnd { val display = this.entry.displays.minByOrNull { it.id } ?: throw RuntimeException("There is no display!") Loading @@ -117,13 +128,33 @@ fun FlickerTestParameter.navBarLayerRotatesAndScales() { } } fun FlickerTestParameter.statusBarLayerRotatesScales() { /** * Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the start * and end of the SF trace */ fun FlickerTestParameter.navBarLayerRotatesAndScales() { navBarLayerPositionStart() navBarLayerPositionEnd() } /** * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the start * of the SF trace */ fun FlickerTestParameter.statusBarLayerPositionStart() { assertLayersStart { val display = this.entry.displays.minByOrNull { it.id } ?: throw RuntimeException("There is no display!") this.visibleRegion(FlickerComponentName.STATUS_BAR) .coversExactly(WindowUtils.getStatusBarPosition(display)) } } /** * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the end * of the SF trace */ fun FlickerTestParameter.statusBarLayerPositionEnd() { assertLayersEnd { val display = this.entry.displays.minByOrNull { it.id } ?: throw RuntimeException("There is no display!") Loading @@ -132,6 +163,15 @@ fun FlickerTestParameter.statusBarLayerRotatesScales() { } } /** * Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the start * and end of the SF trace */ fun FlickerTestParameter.statusBarLayerRotatesScales() { statusBarLayerPositionStart() statusBarLayerPositionEnd() } /** * Asserts that: * [originalLayer] is visible at the start of the trace Loading
tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationCold.kt +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import org.junit.runners.Parameterized /** * Test cold launching an app from a notification from the lock screen. * * This test assumes the device doesn't have AOD enabled * * To run this test: `atest FlickerTests:OpenAppFromLockNotificationCold` */ @RequiresDevice Loading
tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockNotificationWarm.kt +2 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import org.junit.runners.Parameterized /** * Test warm launching an app from a notification from the lock screen. * * This test assumes the device doesn't have AOD enabled * * To run this test: `atest FlickerTests:OpenAppFromLockNotificationWarm` */ @RequiresDevice Loading
tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromLockTransition.kt +24 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.platform.test.annotations.Presubmit import androidx.test.filters.FlakyTest import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.flicker.navBarLayerPositionEnd import com.android.server.wm.traces.common.FlickerComponentName import org.junit.Test Loading Loading @@ -99,4 +100,27 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) @FlakyTest(bugId = 203538234) @Test override fun appWindowBecomesVisible() = super.appWindowBecomesVisible() /** * Checks the position of the navigation bar at the start and end of the transition * * Differently from the normal usage of this assertion, check only the final state of the * transition because the display is off at the start and the NavBar is never visible */ @Presubmit @Test override fun navBarLayerRotatesAndScales() = testSpec.navBarLayerPositionEnd() /** * Checks that the status bar layer is visible at the end of the trace * * It is not possible to check at the start because the screen is off */ @Presubmit @Test override fun statusBarLayerIsVisible() { testSpec.assertLayersEnd { this.isVisible(FlickerComponentName.STATUS_BAR) } } }
tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppFromNotificationCold.kt +2 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import org.junit.runners.Parameterized /** * Test cold launching an app from a notification. * * This test assumes the device doesn't have AOD enabled * * To run this test: `atest FlickerTests:OpenAppFromNotificationCold` */ @RequiresDevice Loading