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

Commit da65306c authored by Gustav Sennton's avatar Gustav Sennton
Browse files

[Desktop Windowing] Split some test scenarios into functional tests

We don't want to add extra screenrecordings to jank tests, so to avoid
marking test scenarios (that jank tests are based on) with the
@ScreenRecord rule we here create separate functional tests for those
scenarios and annotate those with the rule instead.

Test: atest
Bug: 408367637
Flag: EXEMPT test fix
Change-Id: Ic14341e6a09fd8bb9059ac64ddd19161ea05a573
parent ad3850c3
Loading
Loading
Loading
Loading
+29 −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

import android.platform.test.annotations.Postsubmit
import android.platform.test.rule.ScreenRecordRule
import com.android.wm.shell.scenarios.EnterDesktopWithAppHandleMenu
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner

/* Functional test for [EnterDesktopWithAppHandleMenu]. */
@RunWith(BlockJUnit4ClassRunner::class)
@Postsubmit
@ScreenRecordRule.ScreenRecord
class EnterDesktopWithAppHandleMenuTest : EnterDesktopWithAppHandleMenu()
+29 −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

import android.platform.test.annotations.Postsubmit
import android.platform.test.rule.ScreenRecordRule
import com.android.wm.shell.scenarios.MinimizeWindowOnAppOpen
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner

/* Functional test for [MinimizeAppWindows]. */
@RunWith(BlockJUnit4ClassRunner::class)
@Postsubmit
@ScreenRecordRule.ScreenRecord
class MinimizeWindowOnAppOpenTest : MinimizeWindowOnAppOpen()
+3 −8
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.wm.shell.scenarios

import android.platform.test.annotations.Postsubmit
import android.platform.test.rule.ScreenRecordRule
import android.app.Instrumentation
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
@@ -29,14 +27,11 @@ import com.android.window.flags.Flags
import org.junit.After
import org.junit.Assume
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner

@RunWith(BlockJUnit4ClassRunner::class)
@Postsubmit
@ScreenRecordRule.ScreenRecord
open class EnterDesktopWithAppHandleMenu : TestScenarioBase() {
@Ignore("Test Base Class")
abstract class EnterDesktopWithAppHandleMenu : TestScenarioBase() {

    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val tapl = LauncherInstrumentation()
+4 −8
Original line number Diff line number Diff line
@@ -16,9 +16,7 @@

package com.android.wm.shell.scenarios

import android.platform.test.annotations.Postsubmit
import android.app.Instrumentation
import android.platform.test.rule.ScreenRecordRule
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -31,18 +29,16 @@ import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
import org.junit.After
import org.junit.Assume
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner

/**
 * Base scenario test for minimizing the least recently used window when a new window is opened
 * above the window limit. For tangor devices, which this test currently runs on, the window limit
 * is 4.
 */
@RunWith(BlockJUnit4ClassRunner::class)
@Postsubmit
@ScreenRecordRule.ScreenRecord
open class MinimizeWindowOnAppOpen() : TestScenarioBase()
@Ignore("Test Base Class")
abstract class MinimizeWindowOnAppOpen() : TestScenarioBase()
{
    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val tapl = LauncherInstrumentation()