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

Commit 18a7f728 authored by Souradeep's avatar Souradeep
Browse files

b/418237603 Add new test case for Launch desktop mode from overview tile to flicker test

Test: USE_RBE=false atest WMShellFlickerTestsDesktopMode:com.android.wm.shell.flicker.fundamentals.SwitchToDesktopFromOverviewFlickerTest -c (http://ab/I77300010432614331)

Video: http://recall/-/ceroDXpJUCkSFe4SA23g2G
Flag: EXEMPT add new test case
Bug: 418237603
Change-Id: I4fd672dfe4dcc08deb60738a8e68d0fa22757d2d
parent 958dcc91
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ test_module_config {
        "com.android.wm.shell.flicker.fundamentals.OpenUnlimitedAppsFlickerTest",
        "com.android.wm.shell.flicker.fundamentals.QuickSwitchBetweenDesktopAndFullscreenTest",
        "com.android.wm.shell.flicker.fundamentals.SwitchFocusBetweenAppsTest",
        "com.android.wm.shell.flicker.fundamentals.SwitchToDesktopFromOverviewFlickerTest",
        "com.android.wm.shell.flicker.fundamentals.SwitchToHomeFromDesktopTest",
        "com.android.wm.shell.flicker.fundamentals.SwitchToOverviewFromDesktopFlickerTest",
        "com.android.wm.shell.flicker.immersive.EnterImmersiveViaHeaderMenuFlickerTest",
@@ -220,6 +221,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.flicker.fundamentals.SwitchFocusBetweenAppsTest"],
}

test_module_config {
    name: "WMShellFlickerTestsDesktopMode-fundamentals-SwitchToDesktopFromOverviewFlickerTest",
    base: "WMShellFlickerTestsDesktopMode",
    test_suites: ["device-tests"],
    include_filters: ["com.android.wm.shell.flicker.fundamentals.SwitchToDesktopFromOverviewFlickerTest"],
}

test_module_config {
    name: "WMShellFlickerTestsDesktopMode-fundamentals-SwitchToHomeFromDesktopTest",
    base: "WMShellFlickerTestsDesktopMode",
+87 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.wm.shell.flicker.fundamentals

import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.RequiresDesktopDevice
import android.tools.NavBar
import android.tools.flicker.assertions.FlickerChecker
import android.tools.flicker.junit.FlickerParametersRunnerFactory
import android.tools.flicker.FlickerBuilder
import android.tools.flicker.FlickerTest
import android.tools.flicker.FlickerTestFactory
import com.android.wm.shell.flicker.DesktopModeBaseTest
import com.android.wm.shell.flicker.utils.appWindowIsVisibleAtEnd
import com.android.wm.shell.flicker.utils.appWindowInsideDisplayBoundsAtEnd
import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd
import com.android.wm.shell.scenarios.EnterDesktopViaStaticDesktopOverviewTask
import com.android.wm.shell.Utils
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized

/**
 * Launch Desktop Mode from overview.
 */
@RequiresDesktopDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@Postsubmit
class SwitchToDesktopFromOverviewFlickerTest(flicker: FlickerTest) :
    DesktopModeBaseTest(flicker){

    inner class SwitchToDesktopFromOverviewScenario : EnterDesktopViaStaticDesktopOverviewTask(
        rotation = flicker.scenario.startRotation
    )

    val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation)
    val scenario = SwitchToDesktopFromOverviewScenario()

    private val testApp = scenario.desktopApp

    override val transition: FlickerBuilder.() -> Unit
        get() = {
            setup {
                scenario.setup()
            }
            transitions {
                scenario.enterDesktopViaStaticDesktopOverviewTask()
            }
            teardown {
                scenario.teardown()
            }
        }
    @Test
    fun appWindowIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(testApp)

    @Test
    fun appWindowInsideDisplayBoundsAtEnd() = flicker.appWindowInsideDisplayBoundsAtEnd(testApp)

    @Test
    fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(testApp)

    companion object {
        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
        fun getParams(): Collection<FlickerChecker> {
            return FlickerTestFactory.nonRotationTests(
                supportedNavigationModes = listOf(NavBar.MODE_GESTURAL)
            )
        }
    }
}
 No newline at end of file
+8 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ test_module_config {
        "com.android.wm.shell.functional.fundamentals.OpenUnlimitedAppsTest",
        "com.android.wm.shell.functional.fundamentals.QuickSwitchBetweenDesktopAndFullscreenTest",
        "com.android.wm.shell.functional.fundamentals.SwitchFocusBetweenAppsTest",
        "com.android.wm.shell.functional.fundamentals.SwitchToDesktopFromOverviewTest",
        "com.android.wm.shell.functional.fundamentals.SwitchToHomeFromDesktopTest",
        "com.android.wm.shell.functional.fundamentals.SwitchToOverviewFromDesktopTest",
        "com.android.wm.shell.functional.fundamentals.TaskbarInDesktopModeTest",
@@ -433,6 +434,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.functional.fundamentals.SwitchFocusBetweenAppsTest"],
}

test_module_config {
    name: "FunctionalTestsDesktopMode-fundamentals-SwitchToDesktopFromOverviewTest",
    base: "FunctionalTestsDesktopMode",
    test_suites: ["device-tests"],
    include_filters: ["com.android.wm.shell.functional.fundamentals.SwitchToDesktopFromOverviewTest"],
}

test_module_config {
    name: "FunctionalTestsDesktopMode-fundamentals-SwitchToHomeFromDesktopTest",
    base: "FunctionalTestsDesktopMode",
+3 −0
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@
    {
      "name": "FunctionalTestsDesktopMode-fundamentals-SwitchFocusBetweenAppsTest"
    },
    {
      "name": "FunctionalTestsDesktopMode-fundamentals-SwitchToDesktopFromOverviewTest"
    },
    {
      "name": "FunctionalTestsDesktopMode-fundamentals-SwitchToHomeFromDesktopTest"
    },
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.wm.shell.functional.fundamentals

import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresDesktopDevice
import android.platform.test.rule.ScreenRecordRule
import com.android.wm.shell.scenarios.EnterDesktopViaStaticDesktopOverviewTask
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner

/* Functional test for [SwitchToDesktopFromOverview]. */
@RunWith(BlockJUnit4ClassRunner::class)
@RequiresDesktopDevice
@Presubmit
@ScreenRecordRule.ScreenRecord
class SwitchToDesktopFromOverviewTest : EnterDesktopViaStaticDesktopOverviewTask()
 No newline at end of file
Loading