Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea0f7d80 authored by Nataniel Borges's avatar Nataniel Borges Committed by Android (Google) Code Review
Browse files

Merge "Cleanup snapshotStartingWindowLayerCoversExactlyOnApp assertion" into udc-qpr-dev

parents c4c9b9b1 04b9eaeb
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -255,24 +255,22 @@ fun LegacyFlickerTest.snapshotStartingWindowLayerCoversExactlyOnApp(
        invoke("snapshotStartingWindowLayerCoversExactlyOnApp") {
            val snapshotLayers =
                it.subjects.filter { subject ->
                    subject.name.contains(ComponentNameMatcher.SNAPSHOT.toLayerName()) &&
                    ComponentNameMatcher.SNAPSHOT.layerMatchesAnyOf(subject.layer) &&
                        subject.isVisible
                }
            // Verify the size of snapshotRegion covers appVisibleRegion exactly in animation.
            if (snapshotLayers.isNotEmpty()) {
            val visibleAreas =
                snapshotLayers
                    .mapNotNull { snapshotLayer -> snapshotLayer.layer.visibleRegion }
                    .toTypedArray()
            val snapshotRegion = RegionSubject(visibleAreas, 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)
                snapshotRegion.coversExactly(appVisibleRegion.region)
            }
        }
    }
}
}

/**
 * Asserts that: