From eb773ab87ad4e612df3144783a9ebd06aea4f682 Mon Sep 17 00:00:00 2001 From: Pablo Gamito Date: Wed, 16 Feb 2022 16:58:15 +0100 Subject: [PATCH] Extract out rotationLayerAppearsAndVanishes assertions Fixes problem with rotationLayerAppearsAndVanishes_shellTransit calling rotationLayerAppearsAndVanishes which included the assertion along with an Assume.assumeFalse(isShellTransitionsEnabled) which meant the test would never run Test: atest FlickerTests:ChangeAppRotationTest Change-Id: Icf637f09a062e5f56cab4b5b28fbba7208b0fea4 --- .../flicker/rotation/ChangeAppRotationTest.kt | 22 ++++++++++++++----- .../wm/flicker/rotation/RotationTransition.kt | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt index f603f6e7ed9d8..2b944c6667823 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt @@ -112,10 +112,7 @@ class ChangeAppRotationTest( * Checks that the [FlickerComponentName.ROTATION] layer appears during the transition, * doesn't flicker, and disappears before the transition is complete */ - @Presubmit - @Test - fun rotationLayerAppearsAndVanishes() { - Assume.assumeFalse(isShellTransitionsEnabled) + fun rotationLayerAppearsAndVanishesAssertion() { testSpec.assertLayers { this.isVisible(testApp.component) .then() @@ -126,11 +123,26 @@ class ChangeAppRotationTest( } } + /** + * Checks that the [FlickerComponentName.ROTATION] layer appears during the transition, + * doesn't flicker, and disappears before the transition is complete + */ + @Presubmit + @Test + fun rotationLayerAppearsAndVanishes() { + Assume.assumeFalse(isShellTransitionsEnabled) + rotationLayerAppearsAndVanishesAssertion() + } + + /** + * Checks that the [FlickerComponentName.ROTATION] layer appears during the transition, + * doesn't flicker, and disappears before the transition is complete + */ @FlakyTest(bugId = 218484127) @Test fun rotationLayerAppearsAndVanishes_shellTransit() { Assume.assumeTrue(isShellTransitionsEnabled) - rotationLayerAppearsAndVanishes() + rotationLayerAppearsAndVanishesAssertion() } /** diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/RotationTransition.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/RotationTransition.kt index d1bdeed81b788..0becadf630e16 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/RotationTransition.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/RotationTransition.kt @@ -153,4 +153,4 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter) } } } -} \ No newline at end of file +}