From f0cd4e9e0395abc4ec97bba91a48a8b75acf7297 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Wed, 18 Jan 2023 15:30:45 +0000 Subject: [PATCH] Improve pip test naming Previous names didn't clearly identify the test behavior Test: atest FlickerTests Bug: 265910451 Change-Id: I6f1e05e9f4faa57234fb4a6c8263f7f314863f90 --- .../flicker/pip/AutoEnterPipOnGoToHomeTest.kt | 2 +- ...wnTest.kt => ClosePipBySwipingDownTest.kt} | 20 +------ ...m.kt => ClosePipBySwipingDownTestCfArm.kt} | 2 +- ...PipTransition.kt => ClosePipTransition.kt} | 20 ++++++- ...st.kt => ClosePipWithDismissButtonTest.kt} | 20 +------ ... => ClosePipWithDismissButtonTestCfArm.kt} | 4 +- .../pip/EnterPipOnUserLeaveHintTest.kt | 2 +- ...nTest.kt => EnterPipToOtherOrientation.kt} | 5 +- ....kt => EnterPipToOtherOrientationCfArm.kt} | 4 +- ...{EnterPipTest.kt => EnterPipTransition.kt} | 39 ++---------- .../flicker/pip/EnterPipViaAppUiButtonTest.kt | 60 +++++++++++++++++++ ....kt => EnterPipViaAppUiButtonTestCfArm.kt} | 2 +- .../flicker/pip/ExitPipToAppTransition.kt | 22 ++++++- ....kt => ExitPipToAppViaExpandButtonTest.kt} | 20 +------ ...> ExitPipToAppViaExpandButtonTestCfArm.kt} | 4 +- ...ntTest.kt => ExitPipToAppViaIntentTest.kt} | 20 +------ ...m.kt => ExitPipToAppViaIntentTestCfArm.kt} | 2 +- .../flicker/pip/ExpandPipOnDoubleClickTest.kt | 2 +- ...=> ExpandPipOnDoubleClickTestTestCfArm.kt} | 3 +- ...t.kt => MovePipDownOnShelfHeightChange.kt} | 21 +------ ...kt => MovePipOnImeVisibilityChangeTest.kt} | 2 +- ... MovePipOnImeVisibilityChangeTestCfArm.kt} | 3 +- ...pOnImeVisibilityChangeTestShellTransit.kt} | 3 +- .../pip/MovePipShelfHeightTransition.kt | 19 ++++++ ...kt => MovePipUpOnShelfHeightChangeTest.kt} | 20 +------ ... => SetRequestedOrientationWhilePinned.kt} | 6 +- ...tionTest.kt => ShowPipAndRotateDisplay.kt} | 2 +- ...Arm.kt => ShowPipAndRotateDisplayCfArm.kt} | 2 +- .../flicker/splitscreen/CopyContentInSplit.kt | 1 - 29 files changed, 154 insertions(+), 178 deletions(-) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipWithSwipeDownTest.kt => ClosePipBySwipingDownTest.kt} (84%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipViaIntentTestCfArm.kt => ClosePipBySwipingDownTestCfArm.kt} (94%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipTransition.kt => ClosePipTransition.kt} (82%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipWithDismissButtonTest.kt => ClosePipWithDismissButtonTest.kt} (77%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipWithDismissButtonTestCfArm.kt => ClosePipWithDismissButtonTestCfArm.kt} (93%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{EnterPipToOtherOrientationTest.kt => EnterPipToOtherOrientation.kt} (98%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{EnterPipToOtherOrientationTestCfArm.kt => EnterPipToOtherOrientationCfArm.kt} (93%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{EnterPipTest.kt => EnterPipTransition.kt} (75%) create mode 100644 libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipViaAppUiButtonTest.kt rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipWithSwipeDownTestCfArm.kt => EnterPipViaAppUiButtonTestCfArm.kt} (94%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipViaExpandButtonClickTest.kt => ExitPipToAppViaExpandButtonTest.kt} (82%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipViaExpandButtonClickTestCfArm.kt => ExitPipToAppViaExpandButtonTestCfArm.kt} (93%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExitPipViaIntentTest.kt => ExitPipToAppViaIntentTest.kt} (83%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{EnterPipTestCfArm.kt => ExitPipToAppViaIntentTestCfArm.kt} (94%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{ExpandPipOnDoubleClickTestCfArm.kt => ExpandPipOnDoubleClickTestTestCfArm.kt} (94%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{MovePipDownShelfHeightChangeTest.kt => MovePipDownOnShelfHeightChange.kt} (78%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{PipKeyboardTest.kt => MovePipOnImeVisibilityChangeTest.kt} (97%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{PipKeyboardTestCfArm.kt => MovePipOnImeVisibilityChangeTestCfArm.kt} (93%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{PipKeyboardTestShellTransit.kt => MovePipOnImeVisibilityChangeTestShellTransit.kt} (92%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{MovePipUpShelfHeightChangeTest.kt => MovePipUpOnShelfHeightChangeTest.kt} (79%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{SetRequestedOrientationWhilePinnedTest.kt => SetRequestedOrientationWhilePinned.kt} (96%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{PipRotationTest.kt => ShowPipAndRotateDisplay.kt} (98%) rename libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/{PipRotationTestCfArm.kt => ShowPipAndRotateDisplayCfArm.kt} (94%) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/AutoEnterPipOnGoToHomeTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/AutoEnterPipOnGoToHomeTest.kt index 4f3facb5b4848..88cf15e92c99f 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/AutoEnterPipOnGoToHomeTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/AutoEnterPipOnGoToHomeTest.kt @@ -54,7 +54,7 @@ import org.junit.runners.Parameterized @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) @FlakyTest(bugId = 238367575) -class AutoEnterPipOnGoToHomeTest(flicker: FlickerTest) : EnterPipTest(flicker) { +class AutoEnterPipOnGoToHomeTest(flicker: FlickerTest) : EnterPipViaAppUiButtonTest(flicker) { /** Defines the transition used to run the test */ override val transition: FlickerBuilder.() -> Unit get() = { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithSwipeDownTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt similarity index 84% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithSwipeDownTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt index 39681b1d8597e..88542d51563d7 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithSwipeDownTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTest.kt @@ -20,10 +20,8 @@ import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerBuilder import com.android.server.wm.flicker.FlickerTest -import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher -import com.android.server.wm.traces.common.service.PlatformConsts import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -54,7 +52,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class ExitPipWithSwipeDownTest(flicker: FlickerTest) : ExitPipTransition(flicker) { +open class ClosePipBySwipingDownTest(flicker: FlickerTest) : ClosePipTransition(flicker) { override val transition: FlickerBuilder.() -> Unit get() = { super.transition(this) @@ -96,20 +94,4 @@ open class ExitPipWithSwipeDownTest(flicker: FlickerTest) : ExitPipTransition(fl fun focusDoesNotChange() { flicker.assertEventLog { this.focusDoesNotChange() } } - - companion object { - /** - * Creates the test configurations. - * - * See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation - * and navigation modes. - */ - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun getParams(): List { - return FlickerTestFactory.nonRotationTests( - supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) - ) - } - } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTestCfArm.kt similarity index 94% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTestCfArm.kt index 03dfa5be425d9..fb1eb01918d77 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipBySwipingDownTestCfArm.kt @@ -28,7 +28,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class ExitPipViaIntentTestCfArm(flicker: FlickerTest) : ExitPipViaIntentTest(flicker) { +class ClosePipBySwipingDownTestCfArm(flicker: FlickerTest) : ClosePipBySwipingDownTest(flicker) { companion object { /** * Creates the test configurations. diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipTransition.kt similarity index 82% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipTransition.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipTransition.kt index efe249ad7ab69..080e033f30740 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipTransition.kt @@ -19,14 +19,16 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import com.android.server.wm.flicker.FlickerBuilder import com.android.server.wm.flicker.FlickerTest +import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher.Companion.LAUNCHER import com.android.server.wm.traces.common.service.PlatformConsts import org.junit.Test +import org.junit.runners.Parameterized /** Base class for exiting pip (closing pip window) without returning to the app */ -abstract class ExitPipTransition(flicker: FlickerTest) : PipTransition(flicker) { +abstract class ClosePipTransition(flicker: FlickerTest) : PipTransition(flicker) { override val transition: FlickerBuilder.() -> Unit get() = buildTransition { setup { this.setRotation(flicker.scenario.startRotation) } @@ -77,4 +79,20 @@ abstract class ExitPipTransition(flicker: FlickerTest) : PipTransition(flicker) .isVisible(LAUNCHER) } } + + companion object { + /** + * Creates the test configurations. + * + * See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation + * and navigation modes. + */ + @Parameterized.Parameters(name = "{0}") + @JvmStatic + fun getParams(): List { + return FlickerTestFactory.nonRotationTests( + supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) + ) + } + } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithDismissButtonTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipWithDismissButtonTest.kt similarity index 77% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithDismissButtonTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipWithDismissButtonTest.kt index 8a1a31a172f8b..f27fa4a81328c 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithDismissButtonTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipWithDismissButtonTest.kt @@ -20,9 +20,7 @@ import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerBuilder import com.android.server.wm.flicker.FlickerTest -import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory -import com.android.server.wm.traces.common.service.PlatformConsts import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -54,7 +52,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class ExitPipWithDismissButtonTest(flicker: FlickerTest) : ExitPipTransition(flicker) { +open class ClosePipWithDismissButtonTest(flicker: FlickerTest) : ClosePipTransition(flicker) { override val transition: FlickerBuilder.() -> Unit get() = { @@ -71,20 +69,4 @@ open class ExitPipWithDismissButtonTest(flicker: FlickerTest) : ExitPipTransitio fun focusChanges() { flicker.assertEventLog { this.focusChanges("PipMenuView", "NexusLauncherActivity") } } - - companion object { - /** - * Creates the test configurations. - * - * See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation - * and navigation modes. - */ - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun getParams(): List { - return FlickerTestFactory.nonRotationTests( - supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) - ) - } - } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithDismissButtonTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipWithDismissButtonTestCfArm.kt similarity index 93% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithDismissButtonTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipWithDismissButtonTestCfArm.kt index a3f214c09ecdc..fbada69f6f32f 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithDismissButtonTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ClosePipWithDismissButtonTestCfArm.kt @@ -28,8 +28,8 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class ExitPipWithDismissButtonTestCfArm(flicker: FlickerTest) : - ExitPipWithDismissButtonTest(flicker) { +open class ClosePipWithDismissButtonTestCfArm(flicker: FlickerTest) : + ClosePipWithDismissButtonTest(flicker) { companion object { /** * Creates the test configurations. diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt index 82617dd84dfda..47537c6c5cddd 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt @@ -52,7 +52,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTest(flicker) { +open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTransition(flicker) { /** Defines the transition used to run the test */ override val transition: FlickerBuilder.() -> Unit get() = { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientation.kt similarity index 98% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientation.kt index 41e37b66085e8..db50489681121 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientation.kt @@ -67,7 +67,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition(flicker) { +open class EnterPipToOtherOrientation(flicker: FlickerTest) : PipTransition(flicker) { private val testApp = FixedOrientationAppHelper(instrumentation) private val startingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_90) private val endingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_0) @@ -179,8 +179,7 @@ open class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition( fun pipAppLayerPlusLetterboxCoversFullScreenOnStartTablet() { Assume.assumeFalse(tapl.isTablet) flicker.assertLayersStart { - visibleRegion(pipApp.or(ComponentNameMatcher.LETTERBOX)) - .coversExactly(startingBounds) + visibleRegion(pipApp.or(ComponentNameMatcher.LETTERBOX)).coversExactly(startingBounds) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationCfArm.kt similarity index 93% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationCfArm.kt index 39aab6ee49b75..ec5f13cbed499 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationCfArm.kt @@ -29,8 +29,8 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class EnterPipToOtherOrientationTestCfArm(flicker: FlickerTest) : - EnterPipToOtherOrientationTest(flicker) { +open class EnterPipToOtherOrientationCfArm(flicker: FlickerTest) : + EnterPipToOtherOrientation(flicker) { companion object { /** * Creates the test configurations. diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt similarity index 75% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt index 26f7345b079e5..3ef66d7e8ed29 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 The Android Open Source Project + * Copyright (C) 2023 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. @@ -17,51 +17,20 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit -import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerBuilder import com.android.server.wm.flicker.FlickerTest import com.android.server.wm.flicker.FlickerTestFactory -import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher import com.android.server.wm.traces.common.service.PlatformConsts -import org.junit.FixMethodOrder import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.MethodSorters import org.junit.runners.Parameterized -/** - * Test entering pip from an app by interacting with the app UI - * - * To run this test: `atest WMShellFlickerTests:EnterPipTest` - * - * Actions: - * ``` - * Launch an app in full screen - * Press an "enter pip" button to put [pipApp] in pip mode - * ``` - * Notes: - * ``` - * 1. Some default assertions (e.g., nav bar, status bar and screen covered) - * are inherited from [PipTransition] - * 2. Part of the test setup occurs automatically via - * [com.android.server.wm.flicker.TransitionRunnerWithRules], - * including configuring navigation mode, initial orientation and ensuring no - * apps are running before setup - * ``` - */ -@RequiresDevice -@RunWith(Parameterized::class) -@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) { - +abstract class EnterPipTransition(flicker: FlickerTest) : PipTransition(flicker) { /** {@inheritDoc} */ override val transition: FlickerBuilder.() -> Unit get() = { setup { pipApp.launchViaIntent(wmHelper) } teardown { pipApp.exit(wmHelper) } - transitions { pipApp.clickEnterPipButton(wmHelper) } } /** Checks [pipApp] window remains visible throughout the animation */ @@ -101,7 +70,7 @@ open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) { @Presubmit @Test open fun pipLayerOrOverlayRemainInsideVisibleBounds() { - flicker.assertLayersVisibleRegion(pipApp.or(ComponentNameMatcher.PIP_CONTENT_OVERLAY) ) { + flicker.assertLayersVisibleRegion(pipApp.or(ComponentNameMatcher.PIP_CONTENT_OVERLAY)) { coversAtMost(displayBounds) } } @@ -129,7 +98,7 @@ open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) { } } - /** Checks [ComponentMatcher.LAUNCHER] layer remains visible throughout the animation */ + /** Checks [ComponentNameMatcher.LAUNCHER] layer remains visible throughout the animation */ @Presubmit @Test fun launcherLayerBecomesVisible() { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipViaAppUiButtonTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipViaAppUiButtonTest.kt new file mode 100644 index 0000000000000..c3c705eb58e52 --- /dev/null +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipViaAppUiButtonTest.kt @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2020 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.pip + +import androidx.test.filters.RequiresDevice +import com.android.server.wm.flicker.FlickerBuilder +import com.android.server.wm.flicker.FlickerTest +import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory +import org.junit.FixMethodOrder +import org.junit.runner.RunWith +import org.junit.runners.MethodSorters +import org.junit.runners.Parameterized + +/** + * Test entering pip from an app by interacting with the app UI + * + * To run this test: `atest WMShellFlickerTests:EnterPipTest` + * + * Actions: + * ``` + * Launch an app in full screen + * Press an "enter pip" button to put [pipApp] in pip mode + * ``` + * Notes: + * ``` + * 1. Some default assertions (e.g., nav bar, status bar and screen covered) + * are inherited from [PipTransition] + * 2. Part of the test setup occurs automatically via + * [com.android.server.wm.flicker.TransitionRunnerWithRules], + * including configuring navigation mode, initial orientation and ensuring no + * apps are running before setup + * ``` + */ +@RequiresDevice +@RunWith(Parameterized::class) +@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +open class EnterPipViaAppUiButtonTest(flicker: FlickerTest) : EnterPipTransition(flicker) { + + /** {@inheritDoc} */ + override val transition: FlickerBuilder.() -> Unit + get() = { + super.transition(this) + transitions { pipApp.clickEnterPipButton(wmHelper) } + } +} diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithSwipeDownTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipViaAppUiButtonTestCfArm.kt similarity index 94% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithSwipeDownTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipViaAppUiButtonTestCfArm.kt index 9f26018897dc3..b487ff4a296b7 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithSwipeDownTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipViaAppUiButtonTestCfArm.kt @@ -28,7 +28,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class ExitPipWithSwipeDownTestCfArm(flicker: FlickerTest) : ExitPipWithSwipeDownTest(flicker) { +class EnterPipViaAppUiButtonTestCfArm(flicker: FlickerTest) : EnterPipViaAppUiButtonTest(flicker) { companion object { /** * Creates the test configurations. diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt index 01930e6b36268..f88f8d6e64ed6 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt @@ -18,9 +18,12 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import com.android.server.wm.flicker.FlickerTest +import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher +import com.android.server.wm.traces.common.service.PlatformConsts import org.junit.Test +import org.junit.runners.Parameterized /** Base class for pip expand tests */ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flicker) { @@ -80,7 +83,8 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic isVisible(testApp) .isVisible(pipApp.or(ComponentNameMatcher.TRANSITION_SNAPSHOT)) .then() - .isInvisible(testApp).isVisible(pipApp) + .isInvisible(testApp) + .isVisible(pipApp) } } @@ -121,4 +125,20 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic /** {@inheritDoc} */ @Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered() + + companion object { + /** + * Creates the test configurations. + * + * See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and + * navigation modes. + */ + @Parameterized.Parameters(name = "{0}") + @JvmStatic + fun getParams(): List { + return FlickerTestFactory.nonRotationTests( + supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) + ) + } + } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaExpandButtonClickTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaExpandButtonTest.kt similarity index 82% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaExpandButtonClickTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaExpandButtonTest.kt index 3bfcde3dbc484..d2fbb2a2c9412 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaExpandButtonClickTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaExpandButtonTest.kt @@ -21,10 +21,8 @@ import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerBuilder import com.android.server.wm.flicker.FlickerTest -import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory -import com.android.server.wm.traces.common.service.PlatformConsts import org.junit.Assume import org.junit.FixMethodOrder import org.junit.Test @@ -58,7 +56,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class ExitPipViaExpandButtonClickTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) { +open class ExitPipToAppViaExpandButtonTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) { /** Defines the transition used to run the test */ override val transition: FlickerBuilder.() -> Unit @@ -89,20 +87,4 @@ open class ExitPipViaExpandButtonClickTest(flicker: FlickerTest) : ExitPipToAppT Assume.assumeTrue(isShellTransitionsEnabled) super.pipLayerExpands() } - - companion object { - /** - * Creates the test configurations. - * - * See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and - * navigation modes. - */ - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun getParams(): List { - return FlickerTestFactory.nonRotationTests( - supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) - ) - } - } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaExpandButtonClickTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaExpandButtonTestCfArm.kt similarity index 93% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaExpandButtonClickTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaExpandButtonTestCfArm.kt index f77e335d8f520..8b3755e38366e 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaExpandButtonClickTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaExpandButtonTestCfArm.kt @@ -28,8 +28,8 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class ExitPipViaExpandButtonClickTestCfArm(flicker: FlickerTest) : - ExitPipViaExpandButtonClickTest(flicker) { +class ExitPipToAppViaExpandButtonTestCfArm(flicker: FlickerTest) : + ExitPipToAppViaExpandButtonTest(flicker) { companion object { /** * Creates the test configurations. diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaIntentTest.kt similarity index 83% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaIntentTest.kt index 2c5455f8528a1..a9eb18d44856b 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipViaIntentTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaIntentTest.kt @@ -21,10 +21,8 @@ import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerBuilder import com.android.server.wm.flicker.FlickerTest -import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory -import com.android.server.wm.traces.common.service.PlatformConsts import org.junit.Assume import org.junit.FixMethodOrder import org.junit.Test @@ -57,7 +55,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class ExitPipViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) { +open class ExitPipToAppViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) { /** Defines the transition used to run the test */ override val transition: FlickerBuilder.() -> Unit @@ -106,20 +104,4 @@ open class ExitPipViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(f Assume.assumeTrue(isShellTransitionsEnabled) super.pipLayerExpands() } - - companion object { - /** - * Creates the test configurations. - * - * See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation - * and navigation modes. - */ - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun getParams(): List { - return FlickerTestFactory.nonRotationTests( - supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) - ) - } - } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaIntentTestCfArm.kt similarity index 94% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaIntentTestCfArm.kt index d2e864587431a..39b1c82f96760 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppViaIntentTestCfArm.kt @@ -28,7 +28,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class EnterPipTestCfArm(flicker: FlickerTest) : EnterPipTest(flicker) { +class ExitPipToAppViaIntentTestCfArm(flicker: FlickerTest) : ExitPipToAppViaIntentTest(flicker) { companion object { /** * Creates the test configurations. diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt index e7f544d127e60..d577b4f463191 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTest.kt @@ -31,7 +31,7 @@ import org.junit.runners.MethodSorters import org.junit.runners.Parameterized /** - * Test expanding a pip window by double clicking it + * Test expanding a pip window by double-clicking it * * To run this test: `atest WMShellFlickerTests:ExpandPipOnDoubleClickTest` * diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTestTestCfArm.kt similarity index 94% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTestTestCfArm.kt index 5feb73e3f71de..08db8aefb148c 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExpandPipOnDoubleClickTestTestCfArm.kt @@ -28,7 +28,8 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class ExpandPipOnDoubleClickTestCfArm(flicker: FlickerTest) : ExpandPipOnDoubleClickTest(flicker) { +class ExpandPipOnDoubleClickTestTestCfArm(flicker: FlickerTest) : + ExpandPipOnDoubleClickTest(flicker) { companion object { /** * Creates the test configurations. diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownShelfHeightChangeTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownOnShelfHeightChange.kt similarity index 78% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownShelfHeightChangeTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownOnShelfHeightChange.kt index 16acc11f57295..39ac49f8c81c5 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownShelfHeightChangeTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipDownOnShelfHeightChange.kt @@ -20,9 +20,7 @@ import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerBuilder import com.android.server.wm.flicker.FlickerTest -import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory -import com.android.server.wm.traces.common.service.PlatformConsts import com.android.wm.shell.flicker.Direction import org.junit.FixMethodOrder import org.junit.Test @@ -56,8 +54,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class MovePipDownShelfHeightChangeTest(flicker: FlickerTest) : - MovePipShelfHeightTransition(flicker) { +class MovePipDownOnShelfHeightChange(flicker: FlickerTest) : MovePipShelfHeightTransition(flicker) { /** Defines the transition used to run the test */ override val transition: FlickerBuilder.() -> Unit get() = buildTransition { @@ -73,20 +70,4 @@ class MovePipDownShelfHeightChangeTest(flicker: FlickerTest) : /** Checks that the visible region of [pipApp] layer always moves down during the animation. */ @Presubmit @Test fun pipLayerMovesDown() = pipLayerMoves(Direction.DOWN) - - companion object { - /** - * Creates the test configurations. - * - * See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and - * navigation modes. - */ - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun getParams(): List { - return FlickerTestFactory.nonRotationTests( - supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) - ) - } - } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTest.kt similarity index 97% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTest.kt index 35417b0613db7..7db80a8c81103 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTest.kt @@ -41,7 +41,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class PipKeyboardTest(flicker: FlickerTest) : PipTransition(flicker) { +open class MovePipOnImeVisibilityChangeTest(flicker: FlickerTest) : PipTransition(flicker) { private val imeApp = ImeAppHelper(instrumentation) @Before diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTestCfArm.kt similarity index 93% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTestCfArm.kt index 9e2d27d061be2..be3bd60d28e84 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTestCfArm.kt @@ -28,7 +28,8 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class PipKeyboardTestCfArm(flicker: FlickerTest) : PipKeyboardTest(flicker) { +class MovePipOnImeVisibilityChangeTestCfArm(flicker: FlickerTest) : + MovePipOnImeVisibilityChangeTest(flicker) { companion object { private const val TAG_IME_VISIBLE = "imeIsVisible" diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTestShellTransit.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTestShellTransit.kt similarity index 92% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTestShellTransit.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTestShellTransit.kt index 901814e219710..ef9920c3c793a 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTestShellTransit.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipOnImeVisibilityChangeTestShellTransit.kt @@ -33,7 +33,8 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class PipKeyboardTestShellTransit(flicker: FlickerTest) : PipKeyboardTest(flicker) { +class MovePipOnImeVisibilityChangeTestShellTransit(flicker: FlickerTest) : + MovePipOnImeVisibilityChangeTest(flicker) { @Before override fun before() { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipShelfHeightTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipShelfHeightTransition.kt index 35525cbd4e1a6..77a8c3c3e43f5 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipShelfHeightTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipShelfHeightTransition.kt @@ -18,10 +18,13 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import com.android.server.wm.flicker.FlickerTest +import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper import com.android.server.wm.flicker.traces.region.RegionSubject +import com.android.server.wm.traces.common.service.PlatformConsts import com.android.wm.shell.flicker.Direction import org.junit.Test +import org.junit.runners.Parameterized /** Base class for pip tests with Launcher shelf height change */ abstract class MovePipShelfHeightTransition(flicker: FlickerTest) : PipTransition(flicker) { @@ -103,4 +106,20 @@ abstract class MovePipShelfHeightTransition(flicker: FlickerTest) : PipTransitio regions.zipWithNext { previous, current -> current.isHigherOrEqual(previous.region) } regions.last().isHigher(regions.first()) } + + companion object { + /** + * Creates the test configurations. + * + * See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and + * navigation modes. + */ + @Parameterized.Parameters(name = "{0}") + @JvmStatic + fun getParams(): List { + return FlickerTestFactory.nonRotationTests( + supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) + ) + } + } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpShelfHeightChangeTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpOnShelfHeightChangeTest.kt similarity index 79% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpShelfHeightChangeTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpOnShelfHeightChangeTest.kt index 3a12a34a5206c..511a6511eb446 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpShelfHeightChangeTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/MovePipUpOnShelfHeightChangeTest.kt @@ -20,9 +20,7 @@ import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice import com.android.server.wm.flicker.FlickerBuilder import com.android.server.wm.flicker.FlickerTest -import com.android.server.wm.flicker.FlickerTestFactory import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory -import com.android.server.wm.traces.common.service.PlatformConsts import com.android.wm.shell.flicker.Direction import org.junit.FixMethodOrder import org.junit.Test @@ -56,7 +54,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class MovePipUpShelfHeightChangeTest(flicker: FlickerTest) : +open class MovePipUpOnShelfHeightChangeTest(flicker: FlickerTest) : MovePipShelfHeightTransition(flicker) { /** Defines the transition used to run the test */ override val transition: FlickerBuilder.() -> Unit @@ -72,20 +70,4 @@ open class MovePipUpShelfHeightChangeTest(flicker: FlickerTest) : /** Checks that the visible region of [pipApp] layer always moves up during the animation. */ @Presubmit @Test fun pipLayerMovesUp() = pipLayerMoves(Direction.UP) - - companion object { - /** - * Creates the test configurations. - * - * See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and - * navigation modes. - */ - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun getParams(): List { - return FlickerTestFactory.nonRotationTests( - supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0) - ) - } - } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinned.kt similarity index 96% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinned.kt index 871515ba91473..3f5d06748d059 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinnedTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/SetRequestedOrientationWhilePinned.kt @@ -46,7 +46,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class SetRequestedOrientationWhilePinnedTest(flicker: FlickerTest) : PipTransition(flicker) { +open class SetRequestedOrientationWhilePinned(flicker: FlickerTest) : PipTransition(flicker) { private val startingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_0) private val endingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_90) @@ -71,9 +71,7 @@ open class SetRequestedOrientationWhilePinnedTest(flicker: FlickerTest) : PipTra .withStatusBarVisible() .waitForAndVerify() } - teardown { - pipApp.exit(wmHelper) - } + teardown { pipApp.exit(wmHelper) } transitions { // Launch the activity back into fullscreen and ensure that it is now in landscape pipApp.launchViaIntent(wmHelper) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ShowPipAndRotateDisplay.kt similarity index 98% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ShowPipAndRotateDisplay.kt index 4557a15222b92..720fe72440476 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ShowPipAndRotateDisplay.kt @@ -57,7 +57,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -open class PipRotationTest(flicker: FlickerTest) : PipTransition(flicker) { +open class ShowPipAndRotateDisplay(flicker: FlickerTest) : PipTransition(flicker) { private val testApp = SimpleAppHelper(instrumentation) private val screenBoundsStart = WindowUtils.getDisplayBounds(flicker.scenario.startRotation) private val screenBoundsEnd = WindowUtils.getDisplayBounds(flicker.scenario.endRotation) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTestCfArm.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ShowPipAndRotateDisplayCfArm.kt similarity index 94% rename from libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTestCfArm.kt rename to libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ShowPipAndRotateDisplayCfArm.kt index e72d60458a6c0..daf3e1b18b4bd 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipRotationTestCfArm.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ShowPipAndRotateDisplayCfArm.kt @@ -27,7 +27,7 @@ import org.junit.runners.Parameterized @RunWith(Parameterized::class) @Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -class PipRotationTestCfArm(flicker: FlickerTest) : PipRotationTest(flicker) { +class ShowPipAndRotateDisplayCfArm(flicker: FlickerTest) : ShowPipAndRotateDisplay(flicker) { companion object { /** * Creates the test configurations. diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt index 35d2f3c4a15da..247403a2cbc6f 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/CopyContentInSplit.kt @@ -116,7 +116,6 @@ class CopyContentInSplit(flicker: FlickerTest) : SplitScreenBase(flicker) { /** {@inheritDoc} */ @Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered() - /** {@inheritDoc} */ @Presubmit @Test