diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ChangeAppRotationTest.java b/tests/FlickerTests/src/com/android/server/wm/flicker/ChangeAppRotationTest.java index 5a66e805c575c..ad64840aaee20 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ChangeAppRotationTest.java +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ChangeAppRotationTest.java @@ -144,6 +144,19 @@ public class ChangeAppRotationTest extends FlickerTestBase { ); } + @Test + public void checkVisibility_screenshotLayerBecomesInvisible() { + checkResults(result -> LayersTraceSubject.assertThat(result) + .showsLayer(mTestApp.getPackage()) + .then() + .replaceVisibleLayer(mTestApp.getPackage(), "Screenshot") + .then() + .showsLayer(mTestApp.getPackage()).and().showsLayer("Screenshot") + .then() + .replaceVisibleLayer("Screenshot", mTestApp.getPackage()) + .forAllEntries()); + } + @FlakyTest(bugId = 140855415) @Ignore("Waiting bug feedback") @Test diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppColdTest.java b/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppColdTest.java index efdfaee60e648..2981ff9aefe6e 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppColdTest.java +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppColdTest.java @@ -19,6 +19,8 @@ package com.android.server.wm.flicker; import static com.android.server.wm.flicker.CommonTransitions.openAppCold; import static com.android.server.wm.flicker.WmTraceSubject.assertThat; +import android.view.Surface; + import androidx.test.InstrumentationRegistry; import androidx.test.filters.FlakyTest; import androidx.test.filters.LargeTest; @@ -76,10 +78,20 @@ public class OpenAppColdTest extends NonRotationTestBase { @Test public void checkVisibility_wallpaperLayerBecomesInvisible() { - checkResults(result -> LayersTraceSubject.assertThat(result) - .showsLayer("Wallpaper") - .then() - .hidesLayer("Wallpaper") - .forAllEntries()); + if (mBeginRotation == Surface.ROTATION_0) { + checkResults(result -> LayersTraceSubject.assertThat(result) + .showsLayer("Wallpaper") + .then() + .replaceVisibleLayer("Wallpaper", mTestApp.getPackage()) + .forAllEntries()); + } else { + checkResults(result -> LayersTraceSubject.assertThat(result) + .showsLayer("Wallpaper") + .then() + .replaceVisibleLayer("Wallpaper", "Screenshot") + .then() + .showsLayer(mTestApp.getPackage()) + .forAllEntries()); + } } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppWarmTest.java b/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppWarmTest.java index 7ce6315f529a5..bb684d19d6451 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppWarmTest.java +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppWarmTest.java @@ -19,6 +19,8 @@ package com.android.server.wm.flicker; import static com.android.server.wm.flicker.CommonTransitions.openAppWarm; import static com.android.server.wm.flicker.WmTraceSubject.assertThat; +import android.view.Surface; + import androidx.test.InstrumentationRegistry; import androidx.test.filters.FlakyTest; import androidx.test.filters.LargeTest; @@ -76,10 +78,20 @@ public class OpenAppWarmTest extends NonRotationTestBase { @Test public void checkVisibility_wallpaperLayerBecomesInvisible() { - checkResults(result -> LayersTraceSubject.assertThat(result) - .showsLayer("Wallpaper") - .then() - .hidesLayer("Wallpaper") - .forAllEntries()); + if (mBeginRotation == Surface.ROTATION_0) { + checkResults(result -> LayersTraceSubject.assertThat(result) + .showsLayer("Wallpaper") + .then() + .replaceVisibleLayer("Wallpaper", mTestApp.getPackage()) + .forAllEntries()); + } else { + checkResults(result -> LayersTraceSubject.assertThat(result) + .showsLayer("Wallpaper") + .then() + .replaceVisibleLayer("Wallpaper", "Screenshot") + .then() + .showsLayer(mTestApp.getPackage()) + .forAllEntries()); + } } }