From 4320698b86e487abeebf380e58c152576acddc36 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Tue, 28 Jul 2020 10:09:04 +0200 Subject: [PATCH] Replace coversRegion for coversAtLeastRegion The flickerlib now supports coversAtLeastRegion and coversAtMostRegion to determine the minimum/maximum area covered by a set of layers. Update tests to invoke the new method Test: atest FlickerTests Change-Id: I3bc8f10745beb4776fc03a70adf866fdcea8d8af --- .../com/android/server/wm/flicker/CommonAssertions.kt | 10 +++++----- .../wm/flicker/rotation/SeamlessAppRotationTest.kt | 6 +++--- 2 files changed, 8 insertions(+), 8 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 dcabce896ce2d..f263ee58dfce8 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt @@ -53,19 +53,19 @@ fun LayersAssertion.noUncoveredRegions( if (allStates) { all("noUncoveredRegions", enabled, bugId) { if (startingBounds == endingBounds) { - this.coversRegion(startingBounds) + this.coversAtLeastRegion(startingBounds) } else { - this.coversRegion(startingBounds) + this.coversAtLeastRegion(startingBounds) .then() - .coversRegion(endingBounds) + .coversAtLeastRegion(endingBounds) } } } else { start("noUncoveredRegions_StartingPos") { - this.coversRegion(startingBounds) + this.coversAtLeastRegion(startingBounds) } end("noUncoveredRegions_EndingPos") { - this.coversRegion(endingBounds) + this.coversAtLeastRegion(endingBounds) } } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt index 4746376b724d1..1bc72df146a55 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/SeamlessAppRotationTest.kt @@ -128,11 +128,11 @@ class SeamlessAppRotationTest( val startingBounds = WindowUtils.getDisplayBounds(beginRotation) val endingBounds = WindowUtils.getDisplayBounds(endRotation) if (startingBounds == endingBounds) { - this.coversRegion(startingBounds) + this.coversAtLeastRegion(startingBounds) } else { - this.coversRegion(startingBounds) + this.coversAtLeastRegion(startingBounds) .then() - .coversRegion(endingBounds) + .coversAtLeastRegion(endingBounds) } } }