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

Commit db52b105 authored by Orhan Uysal's avatar Orhan Uysal Committed by Android (Google) Code Review
Browse files

Merge "Fix EnterDesktopWithDrag tests" into main

parents ee38b7c0 1f07c0b7
Loading
Loading
Loading
Loading
+71 −65
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.tools.flicker.AssertionInvocationGroup
import android.tools.flicker.assertors.assertions.AppLayerIsInvisibleAtEnd
import android.tools.flicker.assertors.assertions.AppLayerIsVisibleAlways
import android.tools.flicker.assertors.assertions.AppLayerIsVisibleAtStart
import android.tools.flicker.assertors.assertions.AppWindowBecomesVisible
import android.tools.flicker.assertors.assertions.AppWindowHasDesktopModeInitialBoundsAtTheEnd
import android.tools.flicker.assertors.assertions.AppWindowHasSizeOfAtLeast
import android.tools.flicker.assertors.assertions.AppWindowIsInvisibleAtEnd
@@ -52,6 +53,7 @@ class DesktopModeFlickerScenarios {
                                    transitions: Collection<Transition>
                                ): Collection<Transition> {
                                    return transitions.filter {
                                        // TODO(351168217) Use jank CUJ to extract a longer trace
                                        it.type == TransitionType.DESKTOP_MODE_END_DRAG_TO_DESKTOP
                                    }
                                }
@@ -64,8 +66,10 @@ class DesktopModeFlickerScenarios {
                                AppWindowOnTopAtEnd(Components.DESKTOP_MODE_APP),
                                AppWindowHasDesktopModeInitialBoundsAtTheEnd(
                                    Components.DESKTOP_MODE_APP
                                ),
                                AppWindowBecomesVisible(DESKTOP_WALLPAPER)
                            )
                        ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
                            .associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
            )

        // Use this scenario for closing an app in desktop windowing, except the last app. For the
@@ -96,7 +100,8 @@ class DesktopModeFlickerScenarios {
                                AppWindowOnTopAtStart(Components.DESKTOP_MODE_APP),
                                AppLayerIsVisibleAtStart(Components.DESKTOP_MODE_APP),
                                AppLayerIsInvisibleAtEnd(Components.DESKTOP_MODE_APP),
                        ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
                            )
                            .associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
            )

        val CLOSE_LAST_APP =
@@ -123,7 +128,8 @@ class DesktopModeFlickerScenarios {
                                AppWindowIsInvisibleAtEnd(Components.DESKTOP_MODE_APP),
                                LauncherWindowReplacesAppAsTopWindow(Components.DESKTOP_MODE_APP),
                                AppWindowIsInvisibleAtEnd(DESKTOP_WALLPAPER)
                        ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
                            )
                            .associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
            )

        val CORNER_RESIZE =
@@ -147,12 +153,12 @@ class DesktopModeFlickerScenarios {
                        .setTargetTag(CujType.CUJ_DESKTOP_MODE_RESIZE_WINDOW)
                        .setTransitionMatcher(
                            TaggedCujTransitionMatcher(associatedTransitionRequired = false)
                        ).build(),
                        )
                        .build(),
                assertions =
                    AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS +
                        listOf(
                            AppWindowHasSizeOfAtLeast(Components.DESKTOP_MODE_APP, 770, 700)
                        ).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
                        listOf(AppWindowHasSizeOfAtLeast(Components.DESKTOP_MODE_APP, 770, 700))
                            .associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
            )
    }
}