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

Commit b86c490d authored by Nergi Rahardi's avatar Nergi Rahardi
Browse files

Ensure the switch to DesktopMode before launching PiP

Bug: 378618113
Flag: EXEMPT test fix
Test: atest
PlatformScenarioTests: com.android.wm.shell.scenarios.ResizeAppCornerMultiWindowAndPipTest
Change-Id: I29170cd083bece869083b840390d70a71e8b10f7
parent 3bfa71c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,9 +45,9 @@ open class DragAppWindowMultiWindowAndPip : DragAppWindowScenarioTestBase()
    @Before
    fun setup() {
        Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet)
        testApp.enterDesktopMode(wmHelper, device)
        // Set string extra to ensure the app is on PiP mode at launch
        pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = mapOf("enter_pip" to "true"))
        testApp.enterDesktopMode(wmHelper, device)
        mailApp.launchViaIntent(wmHelper)
        newTasksApp.launchViaIntent(wmHelper)
        imeApp.launchViaIntent(wmHelper)
+1 −1
Original line number Diff line number Diff line
@@ -63,9 +63,9 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0,
        Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet)
        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)
        testApp.enterDesktopMode(wmHelper, device)
        // Set string extra to ensure the app is on PiP mode at launch
        pipApp.launchViaIntentAndWaitForPip(wmHelper, stringExtras = mapOf("enter_pip" to "true"))
        testApp.enterDesktopMode(wmHelper, device)
        mailApp.launchViaIntent(wmHelper)
        newTasksApp.launchViaIntent(wmHelper)
        imeApp.launchViaIntent(wmHelper)
+2 −7
Original line number Diff line number Diff line
@@ -250,18 +250,13 @@ open class PipAppHelper(instrumentation: Instrumentation) :
            wmHelper,
            launchedAppComponentMatcherOverride,
            action,
            stringExtras,
            waitConditionsBuilder =
                wmHelper
                    .StateSyncBuilder()
                    .add(ConditionsFactory.isWMStateComplete())
                    .withAppTransitionIdle()
                    .add(ConditionsFactory.hasPipWindow())
            stringExtras
        )

        wmHelper
            .StateSyncBuilder()
            .withWindowSurfaceAppeared(this)
            .add(ConditionsFactory.isWMStateComplete())
            .withPipShown()
            .waitForAndVerify()
    }