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

Commit 56827576 authored by Gustav Sennton's avatar Gustav Sennton
Browse files

Add setup-rule to MinimizeWindowOnAppOpenViaIntent

We need to ensure that all previous tasks (desktop tasks / desks) are
closed when a Desktop E2E test starts.
Utils.testSetupRule() does this through RemoveAllTasksButHomeRule, so add
Utils.testSetupRule() to MinimizeWindowOnAppOpenViaIntent.

We'll add this test rule to TestScenarioBase in a follow-up.

Bug: 421120649
Bug: 411597362
Flag: EXEMPT e2e test
Test: atest MinimizeWindowOnAppOpenViaIntent when Desktop already open
Change-Id: I4e22dfcc455608f01b8967636276f12a5aaaddf1
parent c13f76aa
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -19,7 +19,9 @@ package com.android.wm.shell.scenarios
import android.app.Instrumentation
import android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK
import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import android.tools.NavBar
import android.tools.PlatformConsts.DEFAULT_DISPLAY
import android.tools.Rotation
import android.tools.device.apphelpers.BrowserAppHelper
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
@@ -28,13 +30,14 @@ import com.android.launcher3.tapl.LauncherInstrumentation
import com.android.server.wm.flicker.helpers.DesktopModeAppHelper
import com.android.server.wm.flicker.helpers.MailAppHelper
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.window.flags.Flags
import com.android.wm.shell.Utils
import com.android.wm.shell.shared.desktopmode.DesktopConfig
import com.android.wm.shell.shared.desktopmode.DesktopState
import org.junit.After
import org.junit.Assume
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test

/**
@@ -59,6 +62,10 @@ abstract class MinimizeWindowOnAppOpenViaIntent : TestScenarioBase() {

    private val maxNum = desktopConfig.maxTaskLimit

    @Rule
    @JvmField
    val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, Rotation.ROTATION_0)

    @Before
    fun setup() {
        Assume.assumeTrue(