diff options
author | 2024-11-27 05:16:16 +0000 | |
---|---|---|
committer | 2024-11-27 05:16:16 +0000 | |
commit | 677cb7dc201c9445d9beb33363feef6d34fd8292 (patch) | |
tree | 61860a41ea5c9fa2d1a6a7fb84da82164b3ad7dd | |
parent | 56d171271cbad38d1b39ceb9fa695f6b645215c3 (diff) | |
parent | 17ec432bfea9036d50c4765cb4843d13714e91fb (diff) |
Merge "Fix WMShellFlickerTestsDesktopMode SnapResizeAppWindow" into main
-rw-r--r-- | libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt index d9c36cc70790..f6d2cc09d7b0 100644 --- a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt +++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt @@ -62,6 +62,14 @@ import android.tools.traces.wm.TransitionType class DesktopModeFlickerScenarios { companion object { + // In DesktopMode, window snap can be done with just a single window. In this case, the + // divider tiling between left and right window won't be shown, and hence its states are not + // obtainable in test. + // As the test should just focus on ensuring window goes to one side of the screen, an + // acceptable approach is to ensure snapped window still fills > 95% of either side of the + // screen. + private const val SNAP_WINDOW_MAX_DIFF_THRESHOLD_RATIO = 0.05 + val END_DRAG_TO_DESKTOP = FlickerConfigEntry( scenarioId = ScenarioId("END_DRAG_TO_DESKTOP"), @@ -230,9 +238,11 @@ class DesktopModeFlickerScenarios { TaggedCujTransitionMatcher(associatedTransitionRequired = false) ) .build(), - assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS + - listOf(AppWindowCoversLeftHalfScreenAtEnd(DESKTOP_MODE_APP)) - .associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), + assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS + listOf( + AppWindowCoversLeftHalfScreenAtEnd( + DESKTOP_MODE_APP, SNAP_WINDOW_MAX_DIFF_THRESHOLD_RATIO + ) + ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), ) val SNAP_RESIZE_RIGHT_WITH_BUTTON = @@ -245,9 +255,11 @@ class DesktopModeFlickerScenarios { TaggedCujTransitionMatcher(associatedTransitionRequired = false) ) .build(), - assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS + - listOf(AppWindowCoversRightHalfScreenAtEnd(DESKTOP_MODE_APP)) - .associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), + assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS + listOf( + AppWindowCoversRightHalfScreenAtEnd( + DESKTOP_MODE_APP, SNAP_WINDOW_MAX_DIFF_THRESHOLD_RATIO + ) + ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }), ) val SNAP_RESIZE_LEFT_WITH_DRAG = |