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

Commit 49f07979 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "b/418233958 Add new test case for Unlock the device back into Desktop...

Merge "b/418233958 Add new test case for Unlock the device back into Desktop Windowing to flicker test" into main
parents 5bd6170f 8a248689
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ test_module_config {
        "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.fundamentals.UnlockIntoDesktopFromLockScreenFlickerTest",
        "com.android.wm.shell.flicker.immersive.EnterImmersiveViaHeaderMenuFlickerTest",
        "com.android.wm.shell.flicker.keyboardshortcuts.AltTabSwitchInDesktopModeFlickerTest",
        "com.android.wm.shell.flicker.keyboardshortcuts.AltTabSwitchToUnminimizeInDesktopModeFlickerTest",
@@ -251,6 +252,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.flicker.fundamentals.SwitchToOverviewFromDesktopFlickerTest"],
}

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

test_module_config {
    name: "WMShellFlickerTestsDesktopMode-immersive-EnterImmersiveViaHeaderMenuFlickerTest",
    base: "WMShellFlickerTestsDesktopMode",
+82 −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.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.appWindowBecomesVisible
import com.android.wm.shell.flicker.utils.appWindowInsideDisplayBoundsAtEnd
import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd
import com.android.wm.shell.flicker.utils.layerIsVisibleAtEnd
import com.android.wm.shell.scenarios.UnlockIntoDesktopFromLockScreen
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized

/** Unlock the device back into Desktop Windowing */
@RequiresDesktopDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@Postsubmit
class UnlockIntoDesktopFromLockScreenFlickerTest(flicker: FlickerTest) :
    DesktopModeBaseTest(flicker) {
    inner class UnlockIntoDesktopFromLockScreenScenario :
        UnlockIntoDesktopFromLockScreen(rotation = flicker.scenario.startRotation)

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

    val scenario = UnlockIntoDesktopFromLockScreenScenario()
    private val testApp = scenario.testApp

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

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

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

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

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

    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
@@ -115,6 +115,7 @@ test_module_config {
        "com.android.wm.shell.functional.fundamentals.SwitchToHomeFromDesktopTest",
        "com.android.wm.shell.functional.fundamentals.SwitchToOverviewFromDesktopTest",
        "com.android.wm.shell.functional.fundamentals.TaskbarInDesktopModeTest",
        "com.android.wm.shell.functional.fundamentals.UnlockIntoDesktopFromLockScreenTest",
        "com.android.wm.shell.functional.fundamentals.focus.ClickAndFocusTest",
        "com.android.wm.shell.functional.fundamentals.focus.CloseThenMoveFocusTest",
        "com.android.wm.shell.functional.fundamentals.focus.DragAndKeepFocusTest",
@@ -479,6 +480,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.functional.fundamentals.TaskbarInDesktopModeTest"],
}

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

test_module_config {
    name: "FunctionalTestsDesktopMode-fundamentals-focus-ClickAndFocusTest",
    base: "FunctionalTestsDesktopMode",
+3 −0
Original line number Diff line number Diff line
@@ -150,6 +150,9 @@
    {
      "name": "FunctionalTestsDesktopMode-fundamentals-TaskbarInDesktopModeTest"
    },
    {
      "name": "FunctionalTestsDesktopMode-fundamentals-UnlockIntoDesktopFromLockScreenTest"
    },
    {
      "name": "FunctionalTestsDesktopMode-fundamentals-focus-ClickAndFocusTest"
    },
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 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.UnlockIntoDesktopFromLockScreen
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner

/* Functional test for [UnlockIntoDesktopFromLockScreen]. */
@RunWith(BlockJUnit4ClassRunner::class)
@RequiresDesktopDevice
@Presubmit
@ScreenRecordRule.ScreenRecord
class UnlockIntoDesktopFromLockScreenTest : UnlockIntoDesktopFromLockScreen()
Loading