Promote and demote flicker tests
Test: atest FlickerTests WMShellFlickerTests -- --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Presubmit --module-arg FlickerTests:exclude-annotation:android.platform.test.annotations.Postsubmit --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest Change-Id: I10699aed8cd4cfb7e053b32b5a526aa5ce78c584
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -84,7 +85,7 @@ class ExitPipViaIntentTest(testSpec: FlickerTestParameter) : ExitPipToAppTransit
|
||||
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 197726610)
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun pipLayerExpands() = super.pipLayerExpands()
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
|
||||
/**
|
||||
* Checks that the visible region of [pipApp] always expands during the animation
|
||||
*/
|
||||
@Presubmit
|
||||
@FlakyTest(bugId = 228012337)
|
||||
@Test
|
||||
fun pipLayerExpands() {
|
||||
val layerName = pipApp.component.toLayerName()
|
||||
|
||||
@@ -33,7 +33,6 @@ import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -69,11 +68,6 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
private val screenBoundsStart = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
private val screenBoundsEnd = WindowUtils.getDisplayBounds(testSpec.endRotation)
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition(eachRun = false) {
|
||||
setup {
|
||||
@@ -135,14 +129,29 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
/**
|
||||
* Checks that [pipApp] layer is within [screenBoundsStart] at the start of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipLayerRotates_StartingBounds() {
|
||||
private fun pipLayerRotates_StartingBounds_internal() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(pipApp.component).coversAtMost(screenBoundsStart)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [pipApp] layer is within [screenBoundsStart] at the start of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipLayerRotates_StartingBounds() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
pipLayerRotates_StartingBounds_internal()
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 228024285)
|
||||
@Test
|
||||
fun pipLayerRotates_StartingBounds_ShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
pipLayerRotates_StartingBounds_internal()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [pipApp] layer is within [screenBoundsEnd] at the end of the transition
|
||||
*/
|
||||
|
||||
@@ -47,7 +47,6 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group4
|
||||
@FlakyTest(bugId = 218604389)
|
||||
open class SetRequestedOrientationWhilePinnedTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : PipTransition(testSpec) {
|
||||
|
||||
@@ -114,7 +114,7 @@ class OpenImeWindowToOverViewTest(private val testSpec: FlickerTestParameter) {
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@FlakyTest(bugId = 228011606)
|
||||
@Test
|
||||
fun imeLayerIsVisibleAndAssociatedWithAppWidow() {
|
||||
testSpec.assertLayersStart {
|
||||
|
||||
@@ -32,12 +32,15 @@ import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.common.WindowManagerConditionsFactory
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -55,11 +58,16 @@ import org.junit.runners.Parameterized
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group4
|
||||
@Presubmit
|
||||
class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParameter) {
|
||||
open class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParameter) {
|
||||
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
private val imeTestApp = ImeAppAutoFocusHelper(instrumentation, testSpec.startRotation)
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2021 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -24,22 +24,26 @@ import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test IME windows switching with 2-Buttons or gestural navigation.
|
||||
* To run this test: `atest FlickerTests:SwitchImeWindowsFromGestureNavTest`
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group4
|
||||
class PipRotationTestShellTransit(testSpec: FlickerTestParameter) : PipRotationTest(testSpec) {
|
||||
@FlakyTest(bugId = 228012334)
|
||||
class SwitchImeWindowsFromGestureNavTest_ShellTransit(testSpec: FlickerTestParameter)
|
||||
: SwitchImeWindowsFromGestureNavTest(testSpec) {
|
||||
@Before
|
||||
override fun before() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
@FlakyTest(bugId = 227214914)
|
||||
override fun pipLayerRotates_StartingBounds() = super.pipLayerRotates_StartingBounds()
|
||||
}
|
||||
@@ -26,12 +26,9 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.WindowManagerConditionsFactory
|
||||
import org.junit.Assume.assumeFalse
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -64,10 +61,6 @@ import org.junit.runners.Parameterized
|
||||
@Group1
|
||||
open class OpenAppFromOverviewTest(testSpec: FlickerTestParameter)
|
||||
: OpenAppFromLauncherTransition(testSpec) {
|
||||
@Before
|
||||
open fun before() {
|
||||
assumeFalse(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the transition used to run the test
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* 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.server.wm.flicker.launch
|
||||
|
||||
import androidx.test.filters.FlakyTest
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import org.junit.Assume.assumeTrue
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test launching an app from the recents app view (the overview)
|
||||
*
|
||||
* To run this test: `atest FlickerTests:OpenAppFromOverviewTest`
|
||||
*
|
||||
* Actions:
|
||||
* Launch [testApp]
|
||||
* Press recents
|
||||
* Relaunch an app [testApp] by selecting it in the overview screen, and wait animation to
|
||||
* complete (only this action is traced)
|
||||
*
|
||||
* Notes:
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [OpenAppTransition]
|
||||
* 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)
|
||||
@Group1
|
||||
class OpenAppFromOverviewTest_ShellTransit(testSpec: FlickerTestParameter)
|
||||
: OpenAppFromOverviewTest(testSpec) {
|
||||
@Before
|
||||
override fun before() {
|
||||
assumeTrue(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 216266712)
|
||||
@Test
|
||||
override fun appWindowBecomesTopWindow() = super.appWindowBecomesTopWindow()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 216266712)
|
||||
@Test
|
||||
override fun appWindowReplacesLauncherAsTopWindow() =
|
||||
super.appWindowReplacesLauncherAsTopWindow()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 218470989)
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
}
|
||||
@@ -27,10 +27,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -64,11 +61,6 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter)
|
||||
override val testApp = NonResizeableAppHelper(instrumentation)
|
||||
private val colorFadComponent = FlickerComponentName("", "ColorFade BLAST#")
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the nav bar layer starts invisible, becomes visible during unlocking animation
|
||||
* and remains visible at the end
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.app.Instrumentation
|
||||
import androidx.test.filters.FlakyTest
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
@@ -216,7 +215,7 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
* Checks that [testApp] window is not on top at the start of the transition, and then becomes
|
||||
* the top visible window until the end of the transition.
|
||||
*/
|
||||
@FlakyTest(bugId = 203538234)
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun appWindowBecomesTopWindow() {
|
||||
testSpec.assertWm {
|
||||
|
||||
@@ -33,12 +33,15 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -70,6 +73,11 @@ open class QuickSwitchBetweenTwoAppsBackTest(private val testSpec: FlickerTestPa
|
||||
|
||||
private val startDisplayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.server.wm.flicker.launch
|
||||
package com.android.server.wm.flicker.quickswitch
|
||||
|
||||
import androidx.test.filters.FlakyTest
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import androidx.test.filters.FlakyTest
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
@@ -30,30 +30,24 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test launching an app while the device is locked
|
||||
* Test quick switching back to previous app from last opened app
|
||||
*
|
||||
* To run this test: `atest FlickerTests:OpenAppNonResizeableTest`
|
||||
* To run this test: `atest FlickerTests:QuickSwitchBetweenTwoAppsBackTest`
|
||||
*
|
||||
* Actions:
|
||||
* Lock the device.
|
||||
* Launch an app on top of the lock screen [testApp] and wait animation to complete
|
||||
* Launch an app [testApp1]
|
||||
* Launch another app [testApp2]
|
||||
* Swipe right from the bottom of the screen to quick switch back to the first app [testApp1]
|
||||
*
|
||||
* Notes:
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [OpenAppTransition]
|
||||
* 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)
|
||||
@Group1
|
||||
@FlakyTest(bugId = 219688533)
|
||||
class OpenAppNonResizeableTest_ShellTransit(testSpec: FlickerTestParameter)
|
||||
: OpenAppNonResizeableTest(testSpec) {
|
||||
@FlakyTest(bugId = 228009808)
|
||||
open class QuickSwitchBetweenTwoAppsBackTest_ShellTransit(testSpec: FlickerTestParameter)
|
||||
: QuickSwitchBetweenTwoAppsBackTest(testSpec) {
|
||||
@Before
|
||||
override fun before() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
@@ -32,6 +32,7 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
@@ -39,6 +40,8 @@ import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.common.Rect
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -68,6 +71,11 @@ open class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTes
|
||||
private val testApp1 = SimpleAppHelper(instrumentation)
|
||||
private val testApp2 = NonResizeableAppHelper(instrumentation)
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2021 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.server.wm.flicker.quickswitch
|
||||
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test quick switching back to previous app from last opened app
|
||||
*
|
||||
* To run this test: `atest FlickerTests:QuickSwitchBetweenTwoAppsForwardTest`
|
||||
*
|
||||
* Actions:
|
||||
* Launch an app [testApp1]
|
||||
* Launch another app [testApp2]
|
||||
* Swipe right from the bottom of the screen to quick switch back to the first app [testApp1]
|
||||
* Swipe left from the bottom of the screen to quick switch forward to the second app [testApp2]
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
open class QuickSwitchBetweenTwoAppsForwardTest_ShellTransit(testSpec: FlickerTestParameter)
|
||||
: QuickSwitchBetweenTwoAppsForwardTest(testSpec) {
|
||||
@Before
|
||||
override fun before() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
@@ -60,7 +60,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group4
|
||||
@Group1
|
||||
class QuickSwitchFromLauncherTest(private val testSpec: FlickerTestParameter) {
|
||||
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
private val taplInstrumentation = LauncherInstrumentation()
|
||||
|
||||
@@ -25,13 +25,11 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.rules.WMFlickerServiceRuleForTestSpec
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
@@ -100,7 +98,7 @@ class ChangeAppRotationTest(
|
||||
* Windows maybe recreated when rotated. Checks that the focus does not change or if it does,
|
||||
* focus returns to [testApp]
|
||||
*/
|
||||
@FlakyTest(bugId = 190185577)
|
||||
@Presubmit
|
||||
@Test
|
||||
fun focusChanges() {
|
||||
testSpec.assertEventLog {
|
||||
@@ -130,18 +128,6 @@ class ChangeAppRotationTest(
|
||||
@Presubmit
|
||||
@Test
|
||||
fun rotationLayerAppearsAndVanishes() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
rotationLayerAppearsAndVanishesAssertion()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [FlickerComponentName.ROTATION] layer appears during the transition,
|
||||
* doesn't flicker, and disappears before the transition is complete
|
||||
*/
|
||||
@FlakyTest(bugId = 218484127)
|
||||
@Test
|
||||
fun rotationLayerAppearsAndVanishes_shellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
rotationLayerAppearsAndVanishesAssertion()
|
||||
}
|
||||
|
||||
|
||||
@@ -26,11 +26,8 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.SeamlessRotationAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -84,11 +81,6 @@ open class SeamlessAppRotationTest(
|
||||
) : RotationTransition(testSpec) {
|
||||
override val testApp = SeamlessRotationAppHelper(instrumentation)
|
||||
|
||||
@Before
|
||||
open fun before() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
}
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* 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.server.wm.flicker.rotation
|
||||
|
||||
import androidx.test.filters.FlakyTest
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test opening an app and cycling through app rotations using seamless rotations
|
||||
*
|
||||
* Currently runs:
|
||||
* 0 -> 90 degrees
|
||||
* 0 -> 90 degrees (with starved UI thread)
|
||||
* 90 -> 0 degrees
|
||||
* 90 -> 0 degrees (with starved UI thread)
|
||||
*
|
||||
* Actions:
|
||||
* Launch an app in fullscreen and supporting seamless rotation (via intent)
|
||||
* Set initial device orientation
|
||||
* Start tracing
|
||||
* Change device orientation
|
||||
* Stop tracing
|
||||
*
|
||||
* To run this test: `atest FlickerTests:SeamlessAppRotationTest`
|
||||
*
|
||||
* To run only the presubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Presubmit`
|
||||
*
|
||||
* To run only the postsubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Postsubmit`
|
||||
*
|
||||
* To run only the flaky assertions add: `--
|
||||
* --module-arg FlickerTests:include-annotation:androidx.test.filters.FlakyTest`
|
||||
*
|
||||
* Notes:
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [RotationTransition]
|
||||
* 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)
|
||||
@Group3
|
||||
@FlakyTest(bugId = 219689723)
|
||||
class SeamlessAppRotationTest_ShellTransit(
|
||||
testSpec: FlickerTestParameter
|
||||
) : SeamlessAppRotationTest(testSpec) {
|
||||
@Before
|
||||
override fun before() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user