Loading tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +11 −4 Original line number Diff line number Diff line Loading @@ -141,6 +141,10 @@ fun FlickerTestParameter.statusBarLayerRotatesScales() { * * @param originalLayer Layer that should be visible at the start * @param newLayer Layer that should be visible at the end * @param ignoreEntriesWithRotationLayer If entries with a visible rotation layer should be ignored * when checking the transition. If true we will not fail the assertion if a rotation layer is * visible to fill the gap between the [originalLayer] being visible and the [newLayer] being * visible. * @param ignoreSnapshot If the snapshot layer should be ignored during the transition * (useful mostly for app launch) * @param ignoreSplashscreen If the splashscreen layer should be ignored during the transition. Loading @@ -150,20 +154,23 @@ fun FlickerTestParameter.statusBarLayerRotatesScales() { fun FlickerTestParameter.replacesLayer( originalLayer: FlickerComponentName, newLayer: FlickerComponentName, ignoreEntriesWithRotationLayer: Boolean = false, ignoreSnapshot: Boolean = false, ignoreSplashscreen: Boolean = true ) { assertLayers { val assertion = this.isVisible(originalLayer) if (ignoreSnapshot || ignoreSplashscreen) { assertion.then() if (ignoreEntriesWithRotationLayer) { assertion.then().isVisible(FlickerComponentName.ROTATION, isOptional = true) } if (ignoreSnapshot) { assertion.isVisible(FlickerComponentName.SNAPSHOT, isOptional = true) assertion.then().isVisible(FlickerComponentName.SNAPSHOT, isOptional = true) } if (ignoreSplashscreen) { assertion.isSplashScreenVisibleFor(newLayer, isOptional = true) assertion.then().isSplashScreenVisibleFor(newLayer, isOptional = true) } assertion.then().isVisible(newLayer) } Loading tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppTransition.kt +2 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,8 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) { * is replaced by [testApp], which remains visible until the end */ open fun appLayerReplacesLauncher() { testSpec.replacesLayer(LAUNCHER_COMPONENT, testApp.component, ignoreSnapshot = true) testSpec.replacesLayer(LAUNCHER_COMPONENT, testApp.component, ignoreEntriesWithRotationLayer = true, ignoreSnapshot = true) } /** Loading Loading
tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +11 −4 Original line number Diff line number Diff line Loading @@ -141,6 +141,10 @@ fun FlickerTestParameter.statusBarLayerRotatesScales() { * * @param originalLayer Layer that should be visible at the start * @param newLayer Layer that should be visible at the end * @param ignoreEntriesWithRotationLayer If entries with a visible rotation layer should be ignored * when checking the transition. If true we will not fail the assertion if a rotation layer is * visible to fill the gap between the [originalLayer] being visible and the [newLayer] being * visible. * @param ignoreSnapshot If the snapshot layer should be ignored during the transition * (useful mostly for app launch) * @param ignoreSplashscreen If the splashscreen layer should be ignored during the transition. Loading @@ -150,20 +154,23 @@ fun FlickerTestParameter.statusBarLayerRotatesScales() { fun FlickerTestParameter.replacesLayer( originalLayer: FlickerComponentName, newLayer: FlickerComponentName, ignoreEntriesWithRotationLayer: Boolean = false, ignoreSnapshot: Boolean = false, ignoreSplashscreen: Boolean = true ) { assertLayers { val assertion = this.isVisible(originalLayer) if (ignoreSnapshot || ignoreSplashscreen) { assertion.then() if (ignoreEntriesWithRotationLayer) { assertion.then().isVisible(FlickerComponentName.ROTATION, isOptional = true) } if (ignoreSnapshot) { assertion.isVisible(FlickerComponentName.SNAPSHOT, isOptional = true) assertion.then().isVisible(FlickerComponentName.SNAPSHOT, isOptional = true) } if (ignoreSplashscreen) { assertion.isSplashScreenVisibleFor(newLayer, isOptional = true) assertion.then().isSplashScreenVisibleFor(newLayer, isOptional = true) } assertion.then().isVisible(newLayer) } Loading
tests/FlickerTests/src/com/android/server/wm/flicker/launch/OpenAppTransition.kt +2 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,8 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) { * is replaced by [testApp], which remains visible until the end */ open fun appLayerReplacesLauncher() { testSpec.replacesLayer(LAUNCHER_COMPONENT, testApp.component, ignoreSnapshot = true) testSpec.replacesLayer(LAUNCHER_COMPONENT, testApp.component, ignoreEntriesWithRotationLayer = true, ignoreSnapshot = true) } /** Loading