diff options
16 files changed, 52 insertions, 61 deletions
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt index 35bab7aaf22c..fcd333f13868 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt @@ -73,7 +73,8 @@ fun FlickerTestParameter.dockedStackDividerIsInvisible() { fun FlickerTestParameter.appPairsPrimaryBoundsIsVisible(rotation: Int, primaryLayerName: String) { assertLayersEnd { val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER) - this.coversExactly(getPrimaryRegion(dividerRegion, rotation), primaryLayerName) + visibleRegion(primaryLayerName) + .coversExactly(getPrimaryRegion(dividerRegion, rotation)) } } @@ -83,7 +84,8 @@ fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisible( ) { assertLayersEnd { val dividerRegion = entry.getVisibleBounds(DOCKED_STACK_DIVIDER) - this.coversExactly(getPrimaryRegion(dividerRegion, rotation), primaryLayerName) + visibleRegion(primaryLayerName) + .coversExactly(getPrimaryRegion(dividerRegion, rotation)) } } @@ -93,7 +95,8 @@ fun FlickerTestParameter.appPairsSecondaryBoundsIsVisible( ) { assertLayersEnd { val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER) - this.coversExactly(getSecondaryRegion(dividerRegion, rotation), secondaryLayerName) + visibleRegion(secondaryLayerName) + .coversExactly(getSecondaryRegion(dividerRegion, rotation)) } } @@ -103,7 +106,8 @@ fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisible( ) { assertLayersEnd { val dividerRegion = entry.getVisibleBounds(DOCKED_STACK_DIVIDER) - this.coversExactly(getSecondaryRegion(dividerRegion, rotation), secondaryLayerName) + visibleRegion(secondaryLayerName) + .coversExactly(getSecondaryRegion(dividerRegion, rotation)) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt index 63e9a787aa17..614530b5e469 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt @@ -82,10 +82,10 @@ class AppPairsTestPairPrimaryAndSecondaryApps( fun appsEndingBounds() { testSpec.assertLayersEnd { val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER) - this.coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion), - primaryApp.defaultWindowName) - .coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion), - secondaryApp.defaultWindowName) + visibleRegion(primaryApp.defaultWindowName) + .coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion)) + visibleRegion(secondaryApp.defaultWindowName) + .coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion)) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt index 234dda448cc8..ef68ed630353 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt @@ -87,10 +87,10 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps( fun appsStartingBounds() { testSpec.assertLayersStart { val dividerRegion = entry.getVisibleBounds(APP_PAIR_SPLIT_DIVIDER) - coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion), - primaryApp.defaultWindowName) - coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion), - secondaryApp.defaultWindowName) + visibleRegion(primaryApp.defaultWindowName) + .coversExactly(appPairsHelper.getPrimaryBounds(dividerRegion)) + visibleRegion(secondaryApp.defaultWindowName) + .coversExactly(appPairsHelper.getSecondaryBounds(dividerRegion)) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ResizeLegacySplitScreen.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ResizeLegacySplitScreen.kt index f40a08ca341c..33ade38d0373 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ResizeLegacySplitScreen.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ResizeLegacySplitScreen.kt @@ -183,8 +183,8 @@ class ResizeLegacySplitScreen( dividerBounds.bottom - WindowUtils.dockedStackDividerInset, displayBounds.right, displayBounds.bottom - WindowUtils.navigationBarHeight) - this.coversExactly(topAppBounds, "SimpleActivity") - .coversExactly(bottomAppBounds, "ImeActivity") + visibleRegion("SimpleActivity").coversExactly(topAppBounds) + visibleRegion("ImeActivity").coversExactly(bottomAppBounds) } } @@ -203,8 +203,8 @@ class ResizeLegacySplitScreen( displayBounds.right, displayBounds.bottom - WindowUtils.navigationBarHeight) - this.coversExactly(topAppBounds, sSimpleActivity) - .coversExactly(bottomAppBounds, sImeActivity) + visibleRegion(sSimpleActivity).coversExactly(topAppBounds) + visibleRegion(sImeActivity).coversExactly(bottomAppBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterExitPipTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterExitPipTest.kt index 033322786d8f..1ba1f3b3eb5d 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterExitPipTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterExitPipTest.kt @@ -90,8 +90,8 @@ class EnterExitPipTest( @Test fun testAppCoversFullScreenWithPipOnDisplay() { testSpec.assertLayersStart { - coversExactly(displayBounds, testApp.defaultWindowName) - coversAtMost(displayBounds, pipApp.defaultWindowName) + visibleRegion(testApp.defaultWindowName).coversExactly(displayBounds) + visibleRegion(pipApp.defaultWindowName).coversAtMost(displayBounds) } } @@ -99,7 +99,7 @@ class EnterExitPipTest( @Test fun pipAppCoversFullScreen() { testSpec.assertLayersEnd { - coversExactly(displayBounds, pipApp.defaultWindowName) + visibleRegion(pipApp.defaultWindowName).coversExactly(displayBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt index ba88ee5751de..dd6195c50f22 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt @@ -116,7 +116,7 @@ class EnterPipToOtherOrientationTest( @Test fun pipAppLayerHidesTestApp() { testSpec.assertLayersStart { - coversExactly(startingBounds, pipApp.defaultWindowName) + visibleRegion(pipApp.defaultWindowName).coversExactly(startingBounds) isInvisible(testApp.defaultWindowName) } } @@ -125,7 +125,7 @@ class EnterPipToOtherOrientationTest( @Test fun testAppLayerCoversFullScreen() { testSpec.assertLayersEnd { - coversExactly(endingBounds, testApp.defaultWindowName) + visibleRegion(testApp.defaultWindowName).coversExactly(endingBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt index bf148bc83d46..6166721448c9 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt @@ -116,8 +116,8 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t @Test fun bothAppLayersVisible() { testSpec.assertLayersEnd { - coversAtMost(displayBounds, testApp.defaultWindowName) - coversAtMost(displayBounds, imeApp.defaultWindowName) + visibleRegion(testApp.defaultWindowName).coversAtMost(displayBounds) + visibleRegion(imeApp.defaultWindowName).coversAtMost(displayBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipMovesInAllApps.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipMovesInAllApps.kt index f554ca344a80..acc013aa8695 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipMovesInAllApps.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipMovesInAllApps.kt @@ -63,7 +63,7 @@ class PipMovesInAllApps(testSpec: FlickerTestParameter) : PipTransition(testSpec @Test fun pipLayerInsideDisplay() { testSpec.assertLayersStart { - coversAtMost(displayBounds, pipApp.defaultWindowName) + visibleRegion(pipApp.defaultWindowName).coversAtMost(displayBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt index 8ceef8afe857..852ee4726080 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt @@ -26,11 +26,11 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.flicker.endRotation import com.android.server.wm.flicker.helpers.WindowUtils import com.android.server.wm.flicker.helpers.setRotation -import com.android.server.wm.flicker.startRotation -import com.android.wm.shell.flicker.helpers.FixedAppHelper -import com.android.server.wm.flicker.noUncoveredRegions import com.android.server.wm.flicker.navBarLayerRotatesAndScales +import com.android.server.wm.flicker.noUncoveredRegions +import com.android.server.wm.flicker.startRotation import com.android.server.wm.flicker.statusBarLayerRotatesScales +import com.android.wm.shell.flicker.helpers.FixedAppHelper import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -91,8 +91,8 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) @Test fun appLayerRotates_StartingBounds() { testSpec.assertLayersStart { - coversExactly(startingBounds, fixedApp.defaultWindowName) - coversAtMost(startingBounds, pipApp.defaultWindowName) + visibleRegion(fixedApp.defaultWindowName).coversExactly(startingBounds) + visibleRegion(pipApp.defaultWindowName).coversAtMost(startingBounds) } } @@ -100,8 +100,8 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) @Test fun appLayerRotates_EndingBounds() { testSpec.assertLayersEnd { - coversExactly(endingBounds, fixedApp.defaultWindowName) - coversAtMost(endingBounds, pipApp.defaultWindowName) + visibleRegion(fixedApp.defaultWindowName).coversExactly(endingBounds) + visibleRegion(pipApp.defaultWindowName).coversAtMost(endingBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipToAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipToAppTest.kt index 945a20b28ff0..6f17a2c57ffc 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipToAppTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipToAppTest.kt @@ -83,7 +83,7 @@ class PipToAppTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) { @Test fun testAppCoversFullScreen() { testSpec.assertLayersStart { - coversExactly(displayBounds, pipApp.defaultWindowName) + visibleRegion(pipApp.defaultWindowName).coversExactly(displayBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt index 102af92c8968..9aab7f30e6f8 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt @@ -91,7 +91,7 @@ class SetRequestedOrientationWhilePinnedTest( @Test fun pipWindowInsideDisplay() { testSpec.assertWmStart { - coversAtMost(startingBounds, pipApp.defaultWindowName) + frameRegion(pipApp.defaultWindowName).coversAtMost(startingBounds) } } @@ -107,7 +107,7 @@ class SetRequestedOrientationWhilePinnedTest( @Test fun pipLayerInsideDisplay() { testSpec.assertLayersStart { - coversAtMost(startingBounds, pipApp.defaultWindowName) + visibleRegion(pipApp.defaultWindowName).coversAtMost(startingBounds) } } @@ -121,7 +121,7 @@ class SetRequestedOrientationWhilePinnedTest( @Test fun pipAppLayerCoversFullScreen() { testSpec.assertLayersEnd { - coversExactly(endingBounds, pipApp.defaultWindowName) + visibleRegion(pipApp.defaultWindowName).coversExactly(endingBounds) } } 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 e6a4501fc529..ed0a98d3c1ec 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt @@ -101,10 +101,10 @@ fun FlickerTestParameter.noUncoveredRegions( } } else { assertLayersStart { - this.coversAtLeast(startingBounds) + this.visibleRegion().coversAtLeast(startingBounds) } assertLayersEnd { - this.coversAtLeast(endingBounds) + this.visibleRegion().coversAtLeast(endingBounds) } } } @@ -152,10 +152,10 @@ fun FlickerTestParameter.navBarLayerRotatesAndScales( val endingPos = WindowUtils.getNavigationBarPosition(endRotation) assertLayersStart { - this.coversExactly(startingPos, NAV_BAR_LAYER_NAME) + this.visibleRegion(NAV_BAR_LAYER_NAME).coversExactly(startingPos) } assertLayersEnd { - this.coversExactly(endingPos, NAV_BAR_LAYER_NAME) + this.visibleRegion(NAV_BAR_LAYER_NAME).coversExactly(endingPos) } } @@ -168,10 +168,10 @@ fun FlickerTestParameter.statusBarLayerRotatesScales( val endingPos = WindowUtils.getStatusBarPosition(endRotation) assertLayersStart { - this.coversExactly(startingPos, STATUS_BAR_WINDOW_NAME) + this.visibleRegion(STATUS_BAR_WINDOW_NAME).coversExactly(startingPos) } assertLayersEnd { - this.coversExactly(endingPos, STATUS_BAR_WINDOW_NAME) + this.visibleRegion(STATUS_BAR_WINDOW_NAME).coversExactly(endingPos) } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppTransition.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppTransition.kt index e118363de58d..a524466328f5 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppTransition.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppTransition.kt @@ -19,6 +19,7 @@ package com.android.server.wm.flicker.close import android.app.Instrumentation import android.platform.test.annotations.Presubmit import android.view.Surface +import androidx.test.filters.FlakyTest import androidx.test.platform.app.InstrumentationRegistry import com.android.server.wm.flicker.FlickerBuilderProvider import com.android.server.wm.flicker.FlickerTestParameter @@ -87,13 +88,13 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter) testSpec.statusBarLayerIsAlwaysVisible() } - @Presubmit + @FlakyTest @Test open fun navBarLayerRotatesAndScales() { testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation, Surface.ROTATION_0) } - @Presubmit + @FlakyTest @Test open fun statusBarLayerRotatesScales() { testSpec.statusBarLayerRotatesScales(testSpec.config.startRotation, Surface.ROTATION_0) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt index d39044ab285d..7ba9db19dd52 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt @@ -20,6 +20,7 @@ import android.app.Instrumentation import android.platform.test.annotations.Presubmit import android.view.Surface import android.view.WindowManagerPolicyConstants +import androidx.test.filters.FlakyTest import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry import com.android.server.wm.flicker.FlickerBuilderProvider @@ -134,7 +135,7 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) { } } - @Presubmit + @FlakyTest @Test fun visibleWindowsShownMoreThanOneConsecutiveEntry() { testSpec.assertWm { diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt index f037f1d19583..35ad59751639 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt @@ -24,7 +24,6 @@ import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.flicker.helpers.SimpleAppHelper -import org.junit.Assume import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -61,20 +60,6 @@ class ChangeAppRotationTest( @Presubmit @Test - override fun navBarLayerRotatesAndScales() { - Assume.assumeFalse(testSpec.isRotated) - super.navBarLayerRotatesAndScales() - } - - @FlakyTest(bugId = 140855415) - @Test - fun navBarLayerRotatesAndScales_flaky() { - Assume.assumeTrue(testSpec.isRotated) - super.navBarLayerRotatesAndScales() - } - - @Presubmit - @Test fun screenshotLayerBecomesInvisible() { testSpec.assertLayers { this.isVisible(testApp.getPackage()) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/RotationTransition.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/RotationTransition.kt index f037f084f172..298903570e76 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/RotationTransition.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/RotationTransition.kt @@ -139,7 +139,7 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter) @Test open fun appLayerRotates_StartingPos() { testSpec.assertLayersStart { - this.coversExactly(startingPos, testApp.getPackage()) + this.visibleRegion(testApp.getPackage()).coversExactly(startingPos) } } @@ -147,7 +147,7 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter) @Test open fun appLayerRotates_EndingPos() { testSpec.assertLayersEnd { - this.coversExactly(endingPos, testApp.getPackage()) + this.visibleRegion(testApp.getPackage()).coversExactly(endingPos) } } }
\ No newline at end of file |