diff options
14 files changed, 44 insertions, 38 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 c4be785cff19..68b0b4e48252 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 @@ -17,11 +17,11 @@ @file:JvmName("CommonAssertions") package com.android.wm.shell.flicker -import android.graphics.Region import android.view.Surface import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.helpers.WindowUtils import com.android.server.wm.traces.common.FlickerComponentName +import com.android.server.wm.traces.common.region.Region fun FlickerTestParameter.appPairsDividerIsVisibleAtEnd() { assertLayersEnd { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/AppPairsHelper.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/AppPairsHelper.kt index 623055f659b9..efae20731bef 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/AppPairsHelper.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/AppPairsHelper.kt @@ -17,23 +17,23 @@ package com.android.wm.shell.flicker.helpers import android.app.Instrumentation -import android.graphics.Region import com.android.server.wm.flicker.Flicker import com.android.server.wm.flicker.helpers.WindowUtils import com.android.server.wm.traces.common.FlickerComponentName +import com.android.server.wm.traces.common.region.Region class AppPairsHelper( instrumentation: Instrumentation, activityLabel: String, component: FlickerComponentName ) : BaseAppHelper(instrumentation, activityLabel, component) { - fun getPrimaryBounds(dividerBounds: Region): android.graphics.Region { + fun getPrimaryBounds(dividerBounds: Region): Region { val primaryAppBounds = Region(0, 0, dividerBounds.bounds.right, dividerBounds.bounds.bottom + WindowUtils.dockedStackDividerInset) return primaryAppBounds } - fun getSecondaryBounds(dividerBounds: Region): android.graphics.Region { + fun getSecondaryBounds(dividerBounds: Region): Region { val displayBounds = WindowUtils.displayBounds val secondaryAppBounds = Region(0, dividerBounds.bounds.bottom - WindowUtils.dockedStackDividerInset, diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/PipAppHelper.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/PipAppHelper.kt index 2357b0debb33..8e6fa5f1314c 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/PipAppHelper.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/PipAppHelper.kt @@ -17,7 +17,6 @@ package com.android.wm.shell.flicker.helpers import android.app.Instrumentation -import android.graphics.Rect import android.media.session.MediaController import android.media.session.MediaSessionManager import android.os.SystemClock @@ -26,6 +25,7 @@ import androidx.test.uiautomator.BySelector import androidx.test.uiautomator.Until import com.android.server.wm.flicker.helpers.FIND_TIMEOUT import com.android.server.wm.flicker.helpers.SYSTEMUI_PACKAGE +import com.android.server.wm.traces.common.Rect import com.android.server.wm.traces.parser.toFlickerComponent import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper import com.android.wm.shell.flicker.pip.tv.closeTvPipWindow 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 0448ec8f2135..7d7add48c898 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 @@ -16,7 +16,6 @@ package com.android.wm.shell.flicker.legacysplitscreen -import android.graphics.Region import android.util.Rational import android.view.Surface import androidx.test.filters.FlakyTest @@ -41,6 +40,7 @@ import com.android.server.wm.flicker.navBarWindowIsVisible import com.android.server.wm.flicker.statusBarLayerIsVisible import com.android.server.wm.flicker.statusBarLayerRotatesScales import com.android.server.wm.flicker.statusBarWindowIsVisible +import com.android.server.wm.traces.common.region.Region import com.android.server.wm.traces.parser.toFlickerComponent import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT import com.android.wm.shell.flicker.helpers.SimpleAppHelper diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt index 0cbfc9215103..d3bb0082be07 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt @@ -128,8 +128,8 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) { @Presubmit @Test fun pipWindowRemainInsideVisibleBounds() { - testSpec.assertWm { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertWmVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } @@ -140,8 +140,8 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) { @Presubmit @Test fun pipLayerRemainInsideVisibleBounds() { - testSpec.assertLayers { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertLayersVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt index 3e7e2f542a4c..f8a3aff98276 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt @@ -45,8 +45,8 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans @Presubmit @Test open fun pipAppWindowRemainInsideVisibleBounds() { - testSpec.assertWm { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertWmVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } @@ -57,8 +57,8 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans @Presubmit @Test open fun pipAppLayerRemainInsideVisibleBounds() { - testSpec.assertLayers { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertLayersVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt index cba677b6f1d1..52177c2c7684 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt @@ -78,8 +78,8 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition @Presubmit @Test fun pipWindowRemainInsideVisibleBounds() { - testSpec.assertWm { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertWmVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } @@ -90,8 +90,8 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition @Presubmit @Test fun pipLayerRemainInsideVisibleBounds() { - testSpec.assertLayers { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertLayersVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownShelfHeightChangeTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownShelfHeightChangeTest.kt index 7ed0c4934686..f9e180e8ec61 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownShelfHeightChangeTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownShelfHeightChangeTest.kt @@ -25,8 +25,8 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.Group3 import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled -import com.android.server.wm.flicker.traces.RegionSubject import org.junit.Assume.assumeFalse +import com.android.server.wm.flicker.traces.region.RegionSubject import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipShelfHeightTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipShelfHeightTransition.kt index 6e0324c17272..0499e7de9a0a 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipShelfHeightTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipShelfHeightTransition.kt @@ -19,7 +19,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import com.android.launcher3.tapl.LauncherInstrumentation import com.android.server.wm.flicker.FlickerTestParameter -import com.android.server.wm.flicker.traces.RegionSubject +import com.android.server.wm.flicker.traces.region.RegionSubject import com.android.wm.shell.flicker.helpers.FixedAppHelper import org.junit.Test @@ -66,8 +66,8 @@ abstract class MovePipShelfHeightTransition( @Presubmit @Test open fun pipWindowRemainInsideVisibleBounds() { - testSpec.assertWm { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertWmVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } @@ -78,8 +78,8 @@ abstract class MovePipShelfHeightTransition( @Presubmit @Test open fun pipLayerRemainInsideVisibleBounds() { - testSpec.assertLayers { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertLayersVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpShelfHeightChangeTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpShelfHeightChangeTest.kt index 56c09498f2ba..b7bfa1b2df88 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpShelfHeightChangeTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpShelfHeightChangeTest.kt @@ -24,8 +24,8 @@ import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.annotation.Group3 import com.android.server.wm.flicker.dsl.FlickerBuilder +import com.android.server.wm.flicker.traces.region.RegionSubject import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled -import com.android.server.wm.flicker.traces.RegionSubject import org.junit.Assume.assumeFalse import org.junit.FixMethodOrder import org.junit.Test diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt index 62e230f8c439..c36dfda70c51 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt @@ -88,9 +88,9 @@ class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) @Presubmit @Test fun pipInVisibleBounds() { - testSpec.assertWm { + testSpec.assertWmVisibleRegion(pipApp.component) { val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation) - coversAtMost(displayBounds, pipApp.component) + coversAtMost(displayBounds) } } 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 e3f544ab0fab..df58194fb91a 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 @@ -101,8 +101,8 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t @FlakyTest(bugId = 161435597) @Test fun pipWindowInsideDisplayBounds() { - testSpec.assertWm { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertWmVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } @@ -119,8 +119,8 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t @FlakyTest(bugId = 161435597) @Test fun pipLayerInsideDisplayBounds() { - testSpec.assertLayers { - coversAtMost(displayBounds, pipApp.component) + testSpec.assertLayersVisibleRegion(pipApp.component) { + coversAtMost(displayBounds) } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest.kt index a7a9fe289a4a..19e2c92304d4 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/SwitchImeWindowsFromGestureNavTest.kt @@ -86,8 +86,8 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame // [Step1]: Swipe right from imeTestApp to testApp task createTag(TAG_IME_VISIBLE) val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation) - device.swipe(0, displayBounds.bounds.height(), - displayBounds.bounds.width(), displayBounds.bounds.height(), 50) + device.swipe(0, displayBounds.bounds.height, + displayBounds.bounds.width, displayBounds.bounds.height, 50) wmHelper.waitForFullScreenApp(testApp.component) wmHelper.waitForAppTransitionIdle() @@ -96,8 +96,8 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame transitions { // [Step2]: Swipe left to back to imeTestApp task val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation) - device.swipe(displayBounds.bounds.width(), displayBounds.bounds.height(), - 0, displayBounds.bounds.height(), 50) + device.swipe(displayBounds.bounds.width, displayBounds.bounds.height, + 0, displayBounds.bounds.height, 50) wmHelper.waitForFullScreenApp(imeTestApp.component) } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/TaskTransitionTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/TaskTransitionTest.kt index 769cb1ad959b..882e128fe181 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/launch/TaskTransitionTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/launch/TaskTransitionTest.kt @@ -148,22 +148,28 @@ class TaskTransitionTest(val testSpec: FlickerTestParameter) { val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation) testSpec.assertLayers { - this.coversExactly(displayBounds, LAUNCH_NEW_TASK_ACTIVITY) + this.invoke("LAUNCH_NEW_TASK_ACTIVITY coversExactly displayBounds") { + it.visibleRegion(LAUNCH_NEW_TASK_ACTIVITY).coversExactly(displayBounds) + } .isInvisible(bgColorLayer) .then() // Transitioning .isVisible(bgColorLayer) .then() // Fully transitioned to simple SIMPLE_ACTIVITY - .coversExactly(displayBounds, SIMPLE_ACTIVITY) + .invoke("SIMPLE_ACTIVITY coversExactly displayBounds") { + it.visibleRegion(SIMPLE_ACTIVITY).coversExactly(displayBounds) + } .isInvisible(bgColorLayer) .then() // Transitioning back .isVisible(bgColorLayer) .then() // Fully transitioned back to LAUNCH_NEW_TASK_ACTIVITY + .invoke("LAUNCH_NEW_TASK_ACTIVITY coversExactly displayBounds") { + it.visibleRegion(LAUNCH_NEW_TASK_ACTIVITY).coversExactly(displayBounds) + } .isInvisible(bgColorLayer) - .coversExactly(displayBounds, LAUNCH_NEW_TASK_ACTIVITY) } } |