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

Commit 237b597d authored by CHIA-HSUAN HSU's avatar CHIA-HSUAN HSU Committed by CHIA-HSUAN HSU (xWF)
Browse files

b/418236025 Add ExitDesktopToFullScreenWithDragToTopDragZone to flicker test

Test: USE_RBE=false atest WMShellFlickerTestsDesktopMode:com.android.wm.shell.flicker.maximize.ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest -c (http://ab/I39700010422344543)
Video:http://recall/-/cJ5zSaHxecdQL9vG0ZkvH9
Flag: EXEMPT add flicker test
Bug: 418236025
Change-Id: Ib249124ec4b81e91faf8f4c9e30d7aff33b583d4
parent cb4e1cbe
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -61,6 +61,7 @@ test_module_config {
        "com.android.wm.shell.flicker.fundamentals.SwitchToOverviewFromDesktopFlickerTest",
        "com.android.wm.shell.flicker.fundamentals.SwitchToOverviewFromDesktopFlickerTest",
        "com.android.wm.shell.flicker.keyboardshortcuts.EnterDesktopFromKeyboardShortcutFlickerTest",
        "com.android.wm.shell.flicker.keyboardshortcuts.EnterDesktopFromKeyboardShortcutFlickerTest",
        "com.android.wm.shell.flicker.keyboardshortcuts.ExitDesktopToFullScreenWithKeyboardShortcutFlickerTest",
        "com.android.wm.shell.flicker.keyboardshortcuts.ExitDesktopToFullScreenWithKeyboardShortcutFlickerTest",
        "com.android.wm.shell.flicker.maximize.ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest",
        "com.android.wm.shell.flicker.maximize.MaximizeAppDoubleTapAppHeaderFlickerTest",
        "com.android.wm.shell.flicker.maximize.MaximizeAppDoubleTapAppHeaderFlickerTest",
        "com.android.wm.shell.flicker.maximize.MaximizeAppFlickerTest",
        "com.android.wm.shell.flicker.maximize.MaximizeAppFlickerTest",
        "com.android.wm.shell.flicker.maximize.MaximizeAppNonResizableFlickerTest",
        "com.android.wm.shell.flicker.maximize.MaximizeAppNonResizableFlickerTest",
@@ -211,6 +212,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.flicker.keyboardshortcuts.ExitDesktopToFullScreenWithKeyboardShortcutFlickerTest"],
    include_filters: ["com.android.wm.shell.flicker.keyboardshortcuts.ExitDesktopToFullScreenWithKeyboardShortcutFlickerTest"],
}
}


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

test_module_config {
test_module_config {
    name: "WMShellFlickerTestsDesktopMode-maximize-MaximizeAppDoubleTapAppHeaderFlickerTest",
    name: "WMShellFlickerTestsDesktopMode-maximize-MaximizeAppDoubleTapAppHeaderFlickerTest",
    base: "WMShellFlickerTestsDesktopMode",
    base: "WMShellFlickerTestsDesktopMode",
+3 −0
Original line number Original line Diff line number Diff line
@@ -54,6 +54,9 @@
    {
    {
      "name": "WMShellFlickerTestsDesktopMode-keyboardshortcuts-ExitDesktopToFullScreenWithKeyboardShortcutFlickerTest"
      "name": "WMShellFlickerTestsDesktopMode-keyboardshortcuts-ExitDesktopToFullScreenWithKeyboardShortcutFlickerTest"
    },
    },
    {
      "name": "WMShellFlickerTestsDesktopMode-maximize-ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest"
    },
    {
    {
      "name": "WMShellFlickerTestsDesktopMode-maximize-MaximizeAppDoubleTapAppHeaderFlickerTest"
      "name": "WMShellFlickerTestsDesktopMode-maximize-MaximizeAppDoubleTapAppHeaderFlickerTest"
    },
    },
+89 −0
Original line number Original line 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.maximize

import androidx.test.filters.RequiresDevice
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 android.tools.traces.component.ComponentNameMatcher.Companion.DESKTOP_WALLPAPER_ACTIVITY
import com.android.wm.shell.flicker.DesktopModeBaseTest
import com.android.wm.shell.flicker.utils.appWindowBecomesInvisible
import com.android.wm.shell.flicker.utils.appWindowOnTopAtStart
import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd
import com.android.wm.shell.flicker.utils.layerCoversFullScreenAtEnd
import com.android.wm.shell.scenarios.ExitDesktopWithDragToTopDragZone
import com.android.wm.shell.Utils
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized

/**
 * Exit the app in desktop mode to full screen by dragging it to the top drag zone.
 */
@RequiresDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
class ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest(flicker: FlickerTest) :
    DesktopModeBaseTest(flicker) {
    inner class ExitDesktopToFullScreenWithDragToTopDragZoneScenario : ExitDesktopWithDragToTopDragZone(flicker.scenario.startRotation)

    @Rule
    @JvmField
    val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation)
    val scenario = ExitDesktopToFullScreenWithDragToTopDragZoneScenario()
    private val testApp = scenario.testApp

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

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

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

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

    @Test
    fun wallpaperBecomesInvisible() = flicker.appWindowBecomesInvisible(DESKTOP_WALLPAPER_ACTIVITY)

    companion object {
        @Parameterized.Parameters(name = "{0}")
        @JvmStatic
        fun getParams(): Collection<FlickerChecker> {
            return FlickerTestFactory.nonRotationTests(
                supportedNavigationModes = listOf(NavBar.MODE_GESTURAL)
            )
        }
    }
}
+8 −8
Original line number Original line Diff line number Diff line
@@ -94,7 +94,6 @@ test_module_config {
        "com.android.wm.shell.functional.EnterDesktopViaStaticDesktopOverviewTaskTest",
        "com.android.wm.shell.functional.EnterDesktopViaStaticDesktopOverviewTaskTest",
        "com.android.wm.shell.functional.EnterDesktopWithDragExistingWindowsTest",
        "com.android.wm.shell.functional.EnterDesktopWithDragExistingWindowsTest",
        "com.android.wm.shell.functional.EnterDesktopWithDragWindowsLimitTest",
        "com.android.wm.shell.functional.EnterDesktopWithDragWindowsLimitTest",
        "com.android.wm.shell.functional.ExitDesktopWithDragToTopDragZoneTest",
        "com.android.wm.shell.functional.FocusAppFromAllAppsTest",
        "com.android.wm.shell.functional.FocusAppFromAllAppsTest",
        "com.android.wm.shell.functional.FocusAppFromTaskbarTest",
        "com.android.wm.shell.functional.FocusAppFromTaskbarTest",
        "com.android.wm.shell.functional.MinimizeAppWindowsTest",
        "com.android.wm.shell.functional.MinimizeAppWindowsTest",
@@ -132,6 +131,7 @@ test_module_config {
        "com.android.wm.shell.functional.fundamentals.focus.OpenAndFocusTest",
        "com.android.wm.shell.functional.fundamentals.focus.OpenAndFocusTest",
        "com.android.wm.shell.functional.keyboardshortcuts.EnterDesktopFromKeyboardShortcutTest",
        "com.android.wm.shell.functional.keyboardshortcuts.EnterDesktopFromKeyboardShortcutTest",
        "com.android.wm.shell.functional.keyboardshortcuts.ExitDesktopFromKeyboardShortcutTest",
        "com.android.wm.shell.functional.keyboardshortcuts.ExitDesktopFromKeyboardShortcutTest",
        "com.android.wm.shell.functional.maximize.ExitDesktopWithDragToTopDragZoneTest",
        "com.android.wm.shell.functional.maximize.MaximizeAppWindowTest",
        "com.android.wm.shell.functional.maximize.MaximizeAppWindowTest",
        "com.android.wm.shell.functional.maximize.MaximizeAppWindowWithDragToTopDragZoneInDesktopFirstTest",
        "com.android.wm.shell.functional.maximize.MaximizeAppWindowWithDragToTopDragZoneInDesktopFirstTest",
        "com.android.wm.shell.functional.maximize.MaximizeAppWindowWithDragToTopDragZoneTest",
        "com.android.wm.shell.functional.maximize.MaximizeAppWindowWithDragToTopDragZoneTest",
@@ -216,13 +216,6 @@ test_module_config {
    include_filters: ["com.android.wm.shell.functional.EnterDesktopWithDragWindowsLimitTest"],
    include_filters: ["com.android.wm.shell.functional.EnterDesktopWithDragWindowsLimitTest"],
}
}


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

test_module_config {
test_module_config {
    name: "FunctionalTestsDesktopMode-FocusAppFromAllAppsTest",
    name: "FunctionalTestsDesktopMode-FocusAppFromAllAppsTest",
    base: "FunctionalTestsDesktopMode",
    base: "FunctionalTestsDesktopMode",
@@ -482,6 +475,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.functional.keyboardshortcuts.ExitDesktopFromKeyboardShortcutTest"],
    include_filters: ["com.android.wm.shell.functional.keyboardshortcuts.ExitDesktopFromKeyboardShortcutTest"],
}
}


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

test_module_config {
test_module_config {
    name: "FunctionalTestsDesktopMode-maximize-MaximizeAppWindowTest",
    name: "FunctionalTestsDesktopMode-maximize-MaximizeAppWindowTest",
    base: "FunctionalTestsDesktopMode",
    base: "FunctionalTestsDesktopMode",
+3 −3
Original line number Original line Diff line number Diff line
@@ -45,9 +45,6 @@
    {
    {
      "name": "FunctionalTestsDesktopMode-EnterDesktopWithDragWindowsLimitTest"
      "name": "FunctionalTestsDesktopMode-EnterDesktopWithDragWindowsLimitTest"
    },
    },
    {
      "name": "FunctionalTestsDesktopMode-ExitDesktopWithDragToTopDragZoneTest"
    },
    {
    {
      "name": "FunctionalTestsDesktopMode-FocusAppFromAllAppsTest"
      "name": "FunctionalTestsDesktopMode-FocusAppFromAllAppsTest"
    },
    },
@@ -159,6 +156,9 @@
    {
    {
      "name": "FunctionalTestsDesktopMode-keyboardshortcuts-ExitDesktopFromKeyboardShortcutTest"
      "name": "FunctionalTestsDesktopMode-keyboardshortcuts-ExitDesktopFromKeyboardShortcutTest"
    },
    },
    {
      "name": "FunctionalTestsDesktopMode-maximize-ExitDesktopWithDragToTopDragZoneTest"
    },
    {
    {
      "name": "FunctionalTestsDesktopMode-maximize-MaximizeAppWindowTest"
      "name": "FunctionalTestsDesktopMode-maximize-MaximizeAppWindowTest"
    },
    },
Loading