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

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

Merge "b/418202129 Add a new test case for resizing the activity embedding app...

Merge "b/418202129 Add a new test case for resizing the activity embedding app window to its smallest by dragging a corner." into main
parents bd778c61 901b0a12
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ test_module_config {
    base: "WMShellFlickerTestsDesktopMode",
    test_suites: ["device-tests"],
    exclude_filters: [
        "com.android.wm.shell.flicker.appcompat.ResizeActivityEmbeddedAppToMinimumWindowFlickerTest",
        "com.android.wm.shell.flicker.appcompat.ShowAppDialogInDesktopModeFlickerTest",
        "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithAppHeaderMenuFlickerTest",
        "com.android.wm.shell.flicker.exit.ExitDesktopToFullScreenWithDragToTopDragZoneFlickerTest",
@@ -106,6 +107,13 @@ test_module_config {
    ],
}

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

test_module_config {
    name: "WMShellFlickerTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeFlickerTest",
    base: "WMShellFlickerTestsDesktopMode",
+86 −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.appcompat

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 android.tools.traces.component.ComponentNameMatcher
import android.tools.traces.component.IComponentNameMatcher
import com.android.wm.shell.Utils
import com.android.wm.shell.flicker.DesktopModeBaseTest
import com.android.wm.shell.flicker.utils.appWindowIsVisibleAtEnd
import com.android.wm.shell.flicker.utils.appWindowIsVisibleAtStart
import com.android.wm.shell.flicker.utils.layerBecomesInvisible
import com.android.wm.shell.scenarios.ResizeActivityEmbeddedAppToMinimumWindow
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized

/**
 * Resize the activity embedding app window to the smallest possible height and width by dragging
 * with the corner.
 *
 * Assert that the maximum window size content in the two-pane format, minimum window size content
 * in the one-pane format.
 */
@RequiresDesktopDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@Postsubmit
class ResizeActivityEmbeddedAppToMinimumWindowFlickerTest(flicker: FlickerTest) :
    DesktopModeBaseTest(flicker) {
    inner class ResizeActivityEmbeddedAppToMinimumWindowScenario :
        ResizeActivityEmbeddedAppToMinimumWindow(flicker.scenario.startRotation)

    @Rule
    @JvmField
    val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation)
    val scenario = ResizeActivityEmbeddedAppToMinimumWindowScenario()
    private val mainPaneMatcher = scenario.settingsApp
    private val subPaneMatcher: IComponentNameMatcher =
        ComponentNameMatcher.SETTINGS_NETWORK_ACTIVITY

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

    @Test fun mainPaneIsVisibleAtStart() = flicker.appWindowIsVisibleAtStart(mainPaneMatcher)

    @Test fun mainPaneIsVisibleAtEnd() = flicker.appWindowIsVisibleAtEnd(mainPaneMatcher)

    @Test fun subPaneBecomesInvisible() = flicker.layerBecomesInvisible(subPaneMatcher)

    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
@@ -92,6 +92,7 @@ test_module_config {
        "com.android.wm.shell.functional.UnmaximizeAppWindowTest",
        "com.android.wm.shell.functional.UnminimizeAppFromAllAppsTest",
        "com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest",
        "com.android.wm.shell.functional.appcompat.ResizeActivityEmbeddedAppToMinimumWindowTest",
        "com.android.wm.shell.functional.appcompat.ShowAppDialogInDesktopModeTest",
        "com.android.wm.shell.functional.exit.ExitDesktopToFullScreenWithAppHeaderMenuTest",
        "com.android.wm.shell.functional.exit.ExitDesktopToSplitScreenWithAppHeaderMenuTest",
@@ -302,6 +303,13 @@ test_module_config {
    include_filters: ["com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest"],
}

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

test_module_config {
    name: "FunctionalTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeTest",
    base: "FunctionalTestsDesktopMode",
+3 −0
Original line number Diff line number Diff line
@@ -72,6 +72,9 @@
    {
      "name": "FunctionalTestsDesktopMode-UnminimizeAppFromTaskbarTest"
    },
    {
      "name": "FunctionalTestsDesktopMode-appcompat-ResizeActivityEmbeddedAppToMinimumWindowTest"
    },
    {
      "name": "FunctionalTestsDesktopMode-appcompat-ShowAppDialogInDesktopModeTest"
    },
+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.appcompat

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

/* Functional test for [ResizeActivityEmbeddedAppToMinimumWindow]. */

@RunWith(BlockJUnit4ClassRunner::class)
@RequiresDesktopDevice
@Presubmit
@ScreenRecordRule.ScreenRecord
class ResizeActivityEmbeddedAppToMinimumWindowTest : ResizeActivityEmbeddedAppToMinimumWindow()
Loading