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
This commit is contained in:
Pablo Gamito
2023-07-25 16:22:08 +00:00
parent 09c26762d4
commit 312f714e5e
2 changed files with 3 additions and 3 deletions

View File

@@ -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)
}
}

View File

@@ -73,7 +73,7 @@ class ShowImeOnAppStartWhenLaunchingAppFromFixedOrientationTest(flicker: LegacyF
@Presubmit @Test fun imeLayerBecomesVisible() = flicker.imeLayerBecomesVisible()
@FlakyTest(bugId = 293096776)
@Presubmit
@Test
fun snapshotStartingWindowLayerCoversExactlyOnApp() {
flicker.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp)