From 312f714e5e4b9536781859c0722c62b1d57e72e3 Mon Sep 17 00:00:00 2001 From: Pablo Gamito Date: Tue, 25 Jul 2023 16:22:08 +0000 Subject: [PATCH] Update snapshotStartingWindowLayerCoversExactlyOnApp to only check snapshot starting windows overlap app when app exists Test: atest com.android.server.wm.flicker.ime.ShowImeOnAppStartWhenLaunchingAppFromFixedOrientationTest Bug: 293096776 Change-Id: I7be721d482c79bb18677f04bc66b972cda5b8ef3 --- .../src/com/android/server/wm/flicker/CommonAssertions.kt | 4 ++-- ...owImeOnAppStartWhenLaunchingAppFromFixedOrientationTest.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt index abd8758383fa5..1a77785150742 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt @@ -283,9 +283,9 @@ fun LegacyFlickerTest.snapshotStartingWindowLayerCoversExactlyOnApp( .mapNotNull { snapshotLayer -> snapshotLayer.layer.visibleRegion } .toTypedArray() val snapshotRegion = RegionSubject(visibleAreas, it.timestamp) + val appVisibleRegion = it.visibleRegion(component) // Verify the size of snapshotRegion covers appVisibleRegion exactly in animation. - if (snapshotRegion.region.isNotEmpty) { - val appVisibleRegion = it.visibleRegion(component) + if (snapshotRegion.region.isNotEmpty && appVisibleRegion.region.isNotEmpty) { snapshotRegion.coversExactly(appVisibleRegion.region) } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/ShowImeOnAppStartWhenLaunchingAppFromFixedOrientationTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/ShowImeOnAppStartWhenLaunchingAppFromFixedOrientationTest.kt index 0ee07483eaa67..ea7c7c4276dcf 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/ShowImeOnAppStartWhenLaunchingAppFromFixedOrientationTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/ShowImeOnAppStartWhenLaunchingAppFromFixedOrientationTest.kt @@ -73,7 +73,7 @@ class ShowImeOnAppStartWhenLaunchingAppFromFixedOrientationTest(flicker: LegacyF @Presubmit @Test fun imeLayerBecomesVisible() = flicker.imeLayerBecomesVisible() - @FlakyTest(bugId = 293096776) + @Presubmit @Test fun snapshotStartingWindowLayerCoversExactlyOnApp() { flicker.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp)