Loading libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/fundamentals/TaskbarInDesktopModeTest.kt 0 → 100644 +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.fundamentals import android.platform.test.annotations.Presubmit import android.platform.test.rule.ScreenRecordRule import com.android.wm.shell.scenarios.TaskbarInDesktopMode import org.junit.runner.RunWith import org.junit.runners.BlockJUnit4ClassRunner /* Functional test for [TaskbarInDesktopMode]. */ @RunWith(BlockJUnit4ClassRunner::class) @Presubmit @ScreenRecordRule.ScreenRecord class TaskbarInDesktopModeTest : TaskbarInDesktopMode() No newline at end of file libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/TaskbarInDesktopMode.kt 0 → 100644 +88 −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.scenarios import android.app.Instrumentation import android.tools.Rotation import android.tools.device.apphelpers.BrowserAppHelper import android.tools.device.apphelpers.CalculatorAppHelper import android.tools.device.apphelpers.CameraAppHelper import android.tools.device.apphelpers.ClockAppHelper import android.tools.device.apphelpers.StandardAppHelper import android.tools.device.apphelpers.YouTubeAppHelper import android.tools.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice import com.android.launcher3.tapl.LauncherInstrumentation import com.android.server.wm.flicker.helpers.DesktopModeAppHelper import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.google.common.truth.Truth.assertThat import org.junit.After import org.junit.Ignore import org.junit.Test @Ignore("Test Base Class") abstract class TaskbarInDesktopMode( val rotation: Rotation = Rotation.ROTATION_0 ) : TestScenarioBase(rotation) { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() private val tapl = LauncherInstrumentation() private val wmHelper = WindowManagerStateHelper(instrumentation) private val device = UiDevice.getInstance(instrumentation) private val simpleAppHelper = SimpleAppHelper(instrumentation) private val cameraAppHelper = CameraAppHelper(instrumentation) private val youtubeAppHelper = YouTubeAppHelper(instrumentation) private val browserAppHelper = BrowserAppHelper(instrumentation) private val clockAppHelper = ClockAppHelper(instrumentation) private val calculatorAppHelper = CalculatorAppHelper(instrumentation) private val appHelpers = listOf( simpleAppHelper, cameraAppHelper, youtubeAppHelper, browserAppHelper, clockAppHelper, calculatorAppHelper ) private val appsMap: Map<DesktopModeAppHelper, StandardAppHelper> = appHelpers.associateBy { DesktopModeAppHelper(it) } @Test open fun taskbarHasOpenedAppsIcons() { appsMap.entries.forEachIndexed { index, entry -> val desktopApp = entry.key val appHelper = entry.value if (index == 0) { desktopApp.enterDesktopMode(wmHelper, device) } else { desktopApp.launchViaIntent(wmHelper) } assertThat(tapl.launchedAppState.taskbar?.getAppIcon(appHelper.appName)).isNotNull() } } @After fun teardown() { appsMap.keys.reversed().forEach { desktopApp -> desktopApp.exit(wmHelper) } } } Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/functional/fundamentals/TaskbarInDesktopModeTest.kt 0 → 100644 +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.fundamentals import android.platform.test.annotations.Presubmit import android.platform.test.rule.ScreenRecordRule import com.android.wm.shell.scenarios.TaskbarInDesktopMode import org.junit.runner.RunWith import org.junit.runners.BlockJUnit4ClassRunner /* Functional test for [TaskbarInDesktopMode]. */ @RunWith(BlockJUnit4ClassRunner::class) @Presubmit @ScreenRecordRule.ScreenRecord class TaskbarInDesktopModeTest : TaskbarInDesktopMode() No newline at end of file
libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/TaskbarInDesktopMode.kt 0 → 100644 +88 −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.scenarios import android.app.Instrumentation import android.tools.Rotation import android.tools.device.apphelpers.BrowserAppHelper import android.tools.device.apphelpers.CalculatorAppHelper import android.tools.device.apphelpers.CameraAppHelper import android.tools.device.apphelpers.ClockAppHelper import android.tools.device.apphelpers.StandardAppHelper import android.tools.device.apphelpers.YouTubeAppHelper import android.tools.traces.parsers.WindowManagerStateHelper import androidx.test.platform.app.InstrumentationRegistry import androidx.test.uiautomator.UiDevice import com.android.launcher3.tapl.LauncherInstrumentation import com.android.server.wm.flicker.helpers.DesktopModeAppHelper import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.google.common.truth.Truth.assertThat import org.junit.After import org.junit.Ignore import org.junit.Test @Ignore("Test Base Class") abstract class TaskbarInDesktopMode( val rotation: Rotation = Rotation.ROTATION_0 ) : TestScenarioBase(rotation) { private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() private val tapl = LauncherInstrumentation() private val wmHelper = WindowManagerStateHelper(instrumentation) private val device = UiDevice.getInstance(instrumentation) private val simpleAppHelper = SimpleAppHelper(instrumentation) private val cameraAppHelper = CameraAppHelper(instrumentation) private val youtubeAppHelper = YouTubeAppHelper(instrumentation) private val browserAppHelper = BrowserAppHelper(instrumentation) private val clockAppHelper = ClockAppHelper(instrumentation) private val calculatorAppHelper = CalculatorAppHelper(instrumentation) private val appHelpers = listOf( simpleAppHelper, cameraAppHelper, youtubeAppHelper, browserAppHelper, clockAppHelper, calculatorAppHelper ) private val appsMap: Map<DesktopModeAppHelper, StandardAppHelper> = appHelpers.associateBy { DesktopModeAppHelper(it) } @Test open fun taskbarHasOpenedAppsIcons() { appsMap.entries.forEachIndexed { index, entry -> val desktopApp = entry.key val appHelper = entry.value if (index == 0) { desktopApp.enterDesktopMode(wmHelper, device) } else { desktopApp.launchViaIntent(wmHelper) } assertThat(tapl.launchedAppState.taskbar?.getAppIcon(appHelper.appName)).isNotNull() } } @After fun teardown() { appsMap.keys.reversed().forEach { desktopApp -> desktopApp.exit(wmHelper) } } }