Merge "Move disabled shelltransit flicker tests to flaky"

This commit is contained in:
Chris Li
2022-01-26 14:48:53 +00:00
committed by Android (Google) Code Review
7 changed files with 239 additions and 65 deletions

View File

@@ -204,7 +204,6 @@ class EnterPipToOtherOrientationTest(
@Presubmit
@Test
fun testAppPlusPipLayerCoversFullScreenOnEnd() {
// This test doesn't work in shell transitions because of b/206669574
testSpec.assertLayersEnd {
val pipRegion = visibleRegion(pipApp.component).region
visibleRegion(testApp.component)

View File

@@ -31,6 +31,7 @@ import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.traces.common.FlickerComponentName
import com.android.wm.shell.flicker.helpers.ImeAppHelper
import org.junit.Assume.assumeFalse
import org.junit.Assume.assumeTrue
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -82,6 +83,13 @@ class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
super.statusBarLayerRotatesScales()
}
@FlakyTest(bugId = 214452854)
@Test
fun statusBarLayerRotatesScales_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.statusBarLayerRotatesScales()
}
/**
* Ensure the pip window remains visible throughout any keyboard interactions
*/

View File

@@ -92,11 +92,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
/** {@inheritDoc} */
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786
assumeFalse(com.android.server.wm.flicker.helpers.isShellTransitionsEnabled)
super.statusBarLayerRotatesScales()
}
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
@FlakyTest(bugId = 161435597)
@Test

View File

@@ -27,6 +27,7 @@ import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume.assumeFalse
import org.junit.Assume.assumeTrue
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -91,6 +92,13 @@ class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.statusBarLayerRotatesScales()
}
@FlakyTest(bugId = 214452854)
@Test
fun statusBarLayerRotatesScales_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.statusBarLayerRotatesScales()
}
/** {@inheritDoc} */
@Presubmit
@Test
@@ -100,6 +108,13 @@ class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.launcherLayerReplacesApp()
}
@FlakyTest(bugId = 214452854)
@Test
fun launcherLayerReplacesApp_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.launcherLayerReplacesApp()
}
/** {@inheritDoc} */
@Presubmit
@Test
@@ -109,6 +124,13 @@ class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.entireScreenCovered()
}
@FlakyTest(bugId = 214452854)
@Test
fun entireScreenCovered_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.entireScreenCovered()
}
companion object {
/**
* Creates the test configurations.

View File

@@ -26,6 +26,7 @@ import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume.assumeFalse
import org.junit.Assume.assumeTrue
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -90,6 +91,13 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.statusBarLayerRotatesScales()
}
@FlakyTest(bugId = 214452854)
@Test
fun statusBarLayerRotatesScales_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.statusBarLayerRotatesScales()
}
/** {@inheritDoc} */
@Presubmit
@Test
@@ -99,6 +107,13 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.launcherLayerReplacesApp()
}
@FlakyTest(bugId = 214452854)
@Test
fun launcherLayerReplacesApp_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.launcherLayerReplacesApp()
}
/** {@inheritDoc} */
@Presubmit
@Test
@@ -108,6 +123,13 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.entireScreenCovered()
}
@FlakyTest(bugId = 214452854)
@Test
fun entireScreenCovered_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.entireScreenCovered()
}
/** {@inheritDoc} */
@Presubmit
@Test
@@ -117,6 +139,13 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.visibleLayersShownMoreThanOneConsecutiveEntry()
}
@FlakyTest(bugId = 214452854)
@Test
fun visibleLayersShownMoreThanOneConsecutiveEntry_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.visibleLayersShownMoreThanOneConsecutiveEntry()
}
companion object {
/**
* Creates the test configurations.

View File

@@ -40,6 +40,7 @@ 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
@@ -62,7 +63,7 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group1
class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestParameter) {
open class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestParameter) {
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
private val testApp1 = SimpleAppHelper(instrumentation)
@@ -85,9 +86,9 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
?: error("Display not found")
// Swipe right from bottom to quick switch back
// NOTE: We don't perform an edge-to-edge swipe but instead only swipe in the middle
// as to not accidentally trigger a swipe back or forward action which would result
// in the same behavior but not testing quick swap.
// NOTE: We don't perform an edge-to-edge swipe but instead only swipe in the
// middle as to not accidentally trigger a swipe back or forward action which
// would result in the same behavior but not testing quick swap.
device.swipe(
startDisplayBounds.right / 3,
startDisplayBounds.bottom,
@@ -126,15 +127,19 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
}
}
@Before
open fun setup() {
// This test doesn't work in shell transitions because of b/213867585
Assume.assumeFalse(isShellTransitionsEnabled)
}
/**
* Checks that the transition starts with [testApp1]'s windows filling/covering exactly the
* entirety of the display.
*/
@Presubmit
@Test
fun startsWithApp1WindowsCoverFullScreen() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun startsWithApp1WindowsCoverFullScreen() {
testSpec.assertWmStart {
this.frameRegion(testApp1.component, FlickerComponentName.LETTERBOX)
.coversExactly(startDisplayBounds)
@@ -147,9 +152,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun startsWithApp1LayersCoverFullScreen() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun startsWithApp1LayersCoverFullScreen() {
testSpec.assertLayersStart {
this.visibleRegion(testApp1.component).coversExactly(startDisplayBounds)
}
@@ -160,23 +163,19 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun startsWithApp1WindowBeingOnTop() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun startsWithApp1WindowBeingOnTop() {
testSpec.assertWmStart {
this.isAppWindowOnTop(testApp1.component)
}
}
/**
* Checks that [testApp2] windows fill the entire screen (i.e. is "fullscreen") at the end of the
* transition once we have fully quick switched from [testApp1] back to the [testApp2].
* Checks that [testApp2] windows fill the entire screen (i.e. is "fullscreen") at the end of
* the transition once we have fully quick switched from [testApp1] back to the [testApp2].
*/
@Presubmit
@Test
fun endsWithApp2WindowsCoveringFullScreen() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun endsWithApp2WindowsCoveringFullScreen() {
testSpec.assertWmEnd {
this.frameRegion(testApp2.component).coversExactly(startDisplayBounds)
}
@@ -188,9 +187,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun endsWithApp2LayersCoveringFullScreen() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun endsWithApp2LayersCoveringFullScreen() {
testSpec.assertLayersEnd {
this.visibleRegion(testApp2.component, FlickerComponentName.LETTERBOX)
.coversExactly(startDisplayBounds)
@@ -198,14 +195,12 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
}
/**
* Checks that [testApp2] is the top window at the end of the transition once we have fully quick
* switched from [testApp1] back to the [testApp2].
* Checks that [testApp2] is the top window at the end of the transition once we have fully
* quick switched from [testApp1] back to the [testApp2].
*/
@Presubmit
@Test
fun endsWithApp2BeingOnTop() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun endsWithApp2BeingOnTop() {
testSpec.assertWmEnd {
this.isAppWindowOnTop(testApp2.component)
}
@@ -217,9 +212,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun app2WindowBecomesAndStaysVisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun app2WindowBecomesAndStaysVisible() {
testSpec.assertWm {
this.isAppWindowInvisible(testApp2.component)
.then()
@@ -235,9 +228,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun app2LayerBecomesAndStaysVisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun app2LayerBecomesAndStaysVisible() {
testSpec.assertLayers {
this.isInvisible(testApp2.component)
.then()
@@ -251,9 +242,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun app1WindowBecomesAndStaysInvisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun app1WindowBecomesAndStaysInvisible() {
testSpec.assertWm {
this.isAppWindowVisible(testApp1.component)
.then()
@@ -267,9 +256,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun app1LayerBecomesAndStaysInvisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun app1LayerBecomesAndStaysInvisible() {
testSpec.assertLayers {
this.isVisible(testApp1.component)
.then()
@@ -284,9 +271,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun app2WindowIsVisibleOnceApp1WindowIsInvisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun app2WindowIsVisibleOnceApp1WindowIsInvisible() {
testSpec.assertWm {
this.isAppWindowVisible(testApp1.component)
.then()
@@ -305,9 +290,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun app2LayerIsVisibleOnceApp1LayerIsInvisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun app2LayerIsVisibleOnceApp1LayerIsInvisible() {
testSpec.assertLayers {
this.isVisible(testApp1.component)
.then()
@@ -324,9 +307,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun navBarWindowIsAlwaysVisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun navBarWindowIsAlwaysVisible() {
testSpec.navBarWindowIsVisible()
}
@@ -335,9 +316,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun navBarLayerAlwaysIsVisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun navBarLayerAlwaysIsVisible() {
testSpec.navBarLayerIsVisible()
}
@@ -348,9 +327,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun navbarIsAlwaysInRightPosition() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun navbarIsAlwaysInRightPosition() {
testSpec.navBarLayerRotatesAndScales()
}
@@ -359,9 +336,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun statusBarWindowIsAlwaysVisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun statusBarWindowIsAlwaysVisible() {
testSpec.statusBarWindowIsVisible()
}
@@ -370,9 +345,7 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
*/
@Presubmit
@Test
fun statusBarLayerIsAlwaysVisible() {
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
open fun statusBarLayerIsAlwaysVisible() {
testSpec.statusBarLayerIsVisible()
}

View File

@@ -0,0 +1,147 @@
/*
* 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 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
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
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 quick switching back to previous app from last opened app
*
* To run this test: `atest FlickerTests:QuickSwitchBetweenTwoAppsForwardTestShellTransit`
*
* 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
class QuickSwitchBetweenTwoAppsForwardTestShellTransit(private val testSpec: FlickerTestParameter)
: QuickSwitchBetweenTwoAppsForwardTest(testSpec) {
@Before
override fun setup() {
// This test class should be removed after b/213867585 is fixed.
Assume.assumeTrue(isShellTransitionsEnabled)
}
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun startsWithApp1WindowsCoverFullScreen() =
super.startsWithApp1WindowsCoverFullScreen()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun startsWithApp1LayersCoverFullScreen() = super.startsWithApp1LayersCoverFullScreen()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun startsWithApp1WindowBeingOnTop() = super.startsWithApp1WindowBeingOnTop()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun endsWithApp2WindowsCoveringFullScreen() =
super.endsWithApp2WindowsCoveringFullScreen()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun endsWithApp2LayersCoveringFullScreen() =
super.endsWithApp2LayersCoveringFullScreen()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun endsWithApp2BeingOnTop() = super.endsWithApp2BeingOnTop()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app2WindowBecomesAndStaysVisible() = super.app2WindowBecomesAndStaysVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app2LayerBecomesAndStaysVisible() = super.app2LayerBecomesAndStaysVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app1WindowBecomesAndStaysInvisible() = super.app1WindowBecomesAndStaysInvisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app1LayerBecomesAndStaysInvisible() = super.app1LayerBecomesAndStaysInvisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app2WindowIsVisibleOnceApp1WindowIsInvisible() =
super.app2WindowIsVisibleOnceApp1WindowIsInvisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app2LayerIsVisibleOnceApp1LayerIsInvisible() =
super.app2LayerIsVisibleOnceApp1LayerIsInvisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun navBarLayerAlwaysIsVisible() = super.navBarLayerAlwaysIsVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun navbarIsAlwaysInRightPosition() = super.navbarIsAlwaysInRightPosition()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun statusBarLayerIsAlwaysVisible() = super.statusBarLayerIsAlwaysVisible()
}