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

Commit a0907889 authored by Daniel Akinola's avatar Daniel Akinola Committed by Android (Google) Code Review
Browse files

Merge "Fix Resizing Flicker Tests - Transitions" into main

parents 750612bd c7cc1450
Loading
Loading
Loading
Loading
+24 −12
Original line number Diff line number Diff line
@@ -298,12 +298,18 @@ class DesktopModeFlickerScenarios {
            FlickerConfigEntry(
                scenarioId = ScenarioId("MAXIMIZE_APP"),
                extractor =
                TaggedScenarioExtractorBuilder()
                    .setTargetTag(CujType.CUJ_DESKTOP_MODE_MAXIMIZE_WINDOW)
                    .setTransitionMatcher(
                        TaggedCujTransitionMatcher(associatedTransitionRequired = false)
                    )
                    .build(),
                ShellTransitionScenarioExtractor(
                    transitionMatcher =
                    object : ITransitionMatcher {
                        override fun findAll(
                            transitions: Collection<Transition>
                        ): Collection<Transition> {
                            return transitions.filter {
                                it.type == TransitionType.DESKTOP_MODE_TOGGLE_RESIZE
                            }
                        }
                    }
                ),
                assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS +
                        listOf(
                            AppLayerIncreasesInSize(DESKTOP_MODE_APP),
@@ -316,12 +322,18 @@ class DesktopModeFlickerScenarios {
            FlickerConfigEntry(
                scenarioId = ScenarioId("MAXIMIZE_APP_NON_RESIZABLE"),
                extractor =
                TaggedScenarioExtractorBuilder()
                    .setTargetTag(CujType.CUJ_DESKTOP_MODE_MAXIMIZE_WINDOW)
                    .setTransitionMatcher(
                        TaggedCujTransitionMatcher(associatedTransitionRequired = false)
                    )
                    .build(),
                ShellTransitionScenarioExtractor(
                    transitionMatcher =
                    object : ITransitionMatcher {
                        override fun findAll(
                            transitions: Collection<Transition>
                        ): Collection<Transition> {
                            return transitions.filter {
                                it.type == TransitionType.DESKTOP_MODE_TOGGLE_RESIZE
                            }
                        }
                    }
                ),
                assertions =
                AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS +
                        listOf(
+6 −1
Original line number Diff line number Diff line
@@ -285,7 +285,11 @@ open class DesktopModeAppHelper(private val innerHelper: IStandardAppHelper) :

        val displayRect = getDisplayRect(wmHelper)

        val endX = if (isLeft) displayRect.left else displayRect.right
        val endX = if (isLeft) {
            displayRect.left + SNAP_RESIZE_DRAG_INSET
        } else {
            displayRect.right - SNAP_RESIZE_DRAG_INSET
        }
        val endY = displayRect.centerY() / 2

        // drag the window to snap resize
@@ -391,6 +395,7 @@ open class DesktopModeAppHelper(private val innerHelper: IStandardAppHelper) :

    private companion object {
        val TIMEOUT: Duration = Duration.ofSeconds(3)
        const val SNAP_RESIZE_DRAG_INSET: Int = 5 // inset to avoid dragging to display edge
        const val CAPTION: String = "desktop_mode_caption"
        const val MAXIMIZE_BUTTON_VIEW: String = "maximize_button_view"
        const val MAXIMIZE_MENU: String = "maximize_menu"