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

Commit 1f07c0b7 authored by Orhan Uysal's avatar Orhan Uysal
Browse files

Fix EnterDesktopWithDrag tests

Bug: 351121585
Test: atest EnterDesktopWithDragPortrait
Flag: EXEMPT Bugfix

Change-Id: I5f36d64e54cdb2f24130476d279d3020f2664588
parent 5627a898
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 }),
            )
    }
}