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

Commit df6ab2ca authored by CHIA-HSUAN HSU's avatar CHIA-HSUAN HSU
Browse files

b/418235689 Add a new test case for launching a new instance from long...

b/418235689 Add a new test case for launching a new instance from long pressing the app icon in the taskbar and tapping the new window.

Test: USE_RBE=false atest WMShellFlickerTestsDesktopMode:com.android.wm.shell.flicker.taskbar.LaunchNewInstanceFromTaskbarMenuFlickerTes -c (http://ab/I34200010444825127)
Video: http://recall/-/exKj704d5xnoH4PDW6SDAi
Flag: EXEMPT add new test case
Bug: 418235689

Change-Id: I09864991dcb1f472e926b8b1e7940537d80ed3c7
parent a87c9b41
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ test_module_config {
        "com.android.wm.shell.flicker.resizing.SnapResizeAppWindowRightWithKeyboardFlickerTest",
        "com.android.wm.shell.flicker.resizing.SnapResizeNonResizableAppWindowLeftWithDragFlickerTest",
        "com.android.wm.shell.flicker.resizing.SnapResizeNonResizableAppWindowRightWithDragFlickerTest",
        "com.android.wm.shell.flicker.taskbar.LaunchNewInstanceFromTaskbarMenuFlickerTest",
        "com.android.wm.shell.flicker.tiling.TilingDividerResizingAppsFlickerTest",
        "com.android.wm.shell.flicker.tiling.TilingDividerShownAfterHomeSwipeFlickerTest",
        "com.android.wm.shell.flicker.tiling.TilingDividerShownAfterOverviewFlickerTest",
@@ -516,6 +517,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.flicker.resizing.SnapResizeNonResizableAppWindowRightWithDragFlickerTest"],
}

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

test_module_config {
    name: "WMShellFlickerTestsDesktopMode-tiling-TilingDividerResizingAppsFlickerTest",
    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.taskbar

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

/**
 * Test for launching a new instance from the taskbar menu in Desktop Mode.
 *
 * Assert that the app becomes visible and in the bottom right corner at the end.
 */
@RequiresDesktopDevice
@Postsubmit
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
class LaunchNewInstanceFromTaskbarMenuFlickerTest(flicker: FlickerTest) :
    DesktopModeBaseTest(flicker) {
    inner class ManageWindowsScenario :
        LaunchNewInstanceFromTaskbarMenu(flicker.scenario.startRotation)

    @Rule
    @JvmField
    val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation)
    val scenario = ManageWindowsScenario()
    private val launchedApp = scenario.browserApp

    override val transition: FlickerBuilder.() -> Unit
        get() = {
            setup { scenario.setup() }
            transitions { scenario.launchNewInstance() }
            teardown { scenario.teardown() }
        }

    @Test
    fun launchedAppLayerPositionedBottomRightAtEnd() =
        flicker.appLayerPositionedBottomRightAtEnd(launchedApp)

    @Test
    fun launchedAppWindowInsideDisplayBoundsAtEnd() =
        flicker.appWindowInsideDisplayBoundsAtEnd(launchedApp)

    @Test fun launchedAppWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(launchedApp)

    @Test fun layerBecomesVisible() = flicker.layerBecomesVisible(launchedApp)

    companion object {
        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
        fun getParams(): Collection<FlickerChecker> {
            return FlickerTestFactory.nonRotationTests(
                supportedNavigationModes = listOf(NavBar.MODE_GESTURAL)
            )
        }
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ test_module_config {
        "com.android.wm.shell.functional.resizing.SnapResizeAppWindowWithButtonTest",
        "com.android.wm.shell.functional.resizing.SnapResizeAppWindowWithDragTest",
        "com.android.wm.shell.functional.resizing.SnapResizeAppWindowWithKeyboardTest",
        "com.android.wm.shell.functional.taskbar.LaunchNewInstanceFromTaskbarMenuTest",
        "com.android.wm.shell.functional.tiling.TilingTest",
    ],
}
@@ -740,6 +741,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.functional.resizing.SnapResizeAppWindowWithKeyboardTest"],
}

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

test_module_config {
    name: "FunctionalTestsDesktopMode-tiling-TilingTest",
    base: "FunctionalTestsDesktopMode",
+7 −0
Original line number Diff line number Diff line
@@ -601,6 +601,13 @@
        "desktop"
      ]
    },
    {
      "name": "FunctionalTestsDesktopMode-taskbar-LaunchNewInstanceFromTaskbarMenuTest",
      "keywords": [
        "device",
        "desktop"
      ]
    },
    {
      "name": "FunctionalTestsDesktopMode-tiling-TilingTest",
      "keywords": [
+32 −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.taskbar

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

/* Functional test for [LaunchNewInstanceFromTaskbarMenu]. */

@RunWith(BlockJUnit4ClassRunner::class)
@RequiresDesktopDevice
@Presubmit
@ScreenRecordRule.ScreenRecord
class LaunchNewInstanceFromTaskbarMenuTest : LaunchNewInstanceFromTaskbarMenu()
Loading