Add support to newer devices on flicker tests

Some of the assertions used in flicker worked in older devices but not on newer ones.

Disable these assertions and make flicker tests compatible with notch to run on newer devices

Bug: 206753786
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Idf889506d767c4743938ee6727cd228b29873e66
This commit is contained in:
Nataniel Borges
2021-12-22 11:54:16 +01:00
parent 967094148d
commit b876fb200d
39 changed files with 78 additions and 53 deletions

View File

@@ -82,7 +82,7 @@ class AppPairsTestCannotPairNonResizeableApps(
@Test
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -67,7 +67,7 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
@Test
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -86,7 +86,7 @@ class AppPairsTestSupportPairNonResizeableApps(
@Test
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -71,7 +71,7 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
@Test
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -18,6 +18,7 @@ package com.android.wm.shell.flicker.apppairs
import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
@@ -92,6 +93,10 @@ class RotateTwoLaunchedAppsInAppPairsMode(
testSpec.appPairsSecondaryBoundsIsVisibleAtEnd(testSpec.endRotation,
secondaryApp.component)
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic

View File

@@ -18,6 +18,7 @@ package com.android.wm.shell.flicker.apppairs
import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
@@ -79,6 +80,10 @@ class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode(
@Test
override fun statusBarLayerIsVisible() = super.statusBarLayerIsVisible()
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
@Presubmit
@Test
fun bothAppWindowsVisible() {

View File

@@ -110,7 +110,7 @@ class LegacySplitScreenToLauncher(
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -135,6 +135,7 @@ class ResizeLegacySplitScreen(
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -77,7 +77,7 @@ class RotateOneLaunchedAppAndEnterSplitScreen(
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -76,7 +76,7 @@ class RotateOneLaunchedAppInSplitScreenMode(
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -18,6 +18,7 @@ package com.android.wm.shell.flicker.legacysplitscreen
import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
@@ -85,7 +86,7 @@ class RotateTwoLaunchedAppAndEnterSplitScreen(
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -91,7 +91,7 @@ class RotateTwoLaunchedAppInSplitScreenMode(
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -91,7 +91,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -119,7 +119,7 @@ class EnterPipToOtherOrientationTest(
* Checks that the [FlickerComponentName.STATUS_BAR] has the correct position at
* the start and end of the transition
*/
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -16,8 +16,8 @@
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
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
@@ -80,7 +80,7 @@ class ExitPipViaExpandButtonClickTest(
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -16,7 +16,6 @@
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
@@ -100,7 +99,7 @@ class ExitPipViaIntentTest(testSpec: FlickerTestParameter) : ExitPipToAppTransit
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -16,7 +16,6 @@
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
@@ -96,7 +95,7 @@ class ExitPipWithDismissButtonTest(testSpec: FlickerTestParameter) : ExitPipTran
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -16,7 +16,6 @@
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
@@ -80,7 +79,7 @@ class ExitPipWithSwipeDownTest(testSpec: FlickerTestParameter) : ExitPipTransiti
@Test
override fun pipLayerBecomesInvisible() = super.pipLayerBecomesInvisible()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -165,6 +165,10 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
}
}
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
companion object {
/**
* Creates the test configurations.

View File

@@ -16,8 +16,8 @@
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
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
@@ -83,7 +83,7 @@ class MovePipDownShelfHeightChangeTest(
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -16,8 +16,8 @@
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
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
@@ -83,7 +83,7 @@ class MovePipUpShelfHeightChangeTest(
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -18,6 +18,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
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
@@ -73,7 +74,7 @@ class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -90,7 +90,7 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -107,7 +107,7 @@ class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
/**
* Checks the position of the status bar at the start and end of the transition
*/
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() = testSpec.statusBarLayerRotatesScales()

View File

@@ -115,7 +115,7 @@ class SetRequestedOrientationWhilePinnedTest(
super.navBarLayerRotatesAndScales()
}
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -83,7 +83,7 @@ class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -82,7 +82,7 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -20,6 +20,7 @@ import android.app.Instrumentation
import android.platform.test.annotations.Presubmit
import android.view.Surface
import android.view.WindowManagerPolicyConstants
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.FlickerBuilderProvider
@@ -154,7 +155,7 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -20,6 +20,7 @@ import android.app.Instrumentation
import android.platform.test.annotations.Presubmit
import android.view.Surface
import android.view.WindowManagerPolicyConstants
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.FlickerBuilderProvider
@@ -156,7 +157,7 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -132,7 +132,7 @@ class CloseImeWindowToAppTest(private val testSpec: FlickerTestParameter) {
testSpec.navBarLayerRotatesAndScales()
}
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -20,6 +20,7 @@ import android.app.Instrumentation
import android.platform.test.annotations.Presubmit
import android.view.Surface
import android.view.WindowManagerPolicyConstants
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.FlickerBuilderProvider
@@ -149,7 +150,7 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -20,6 +20,7 @@ import android.app.Instrumentation
import android.platform.test.annotations.Presubmit
import android.view.Surface
import android.view.WindowManagerPolicyConstants
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.FlickerBuilderProvider
@@ -127,7 +128,7 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) {
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -217,7 +217,7 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
@Test
fun navBarLayerRotatesAndScales() = testSpec.navBarLayerRotatesAndScales()
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -81,7 +81,7 @@ class OpenAppColdTest(testSpec: FlickerTestParameter) : OpenAppTransition(testSp
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -98,7 +98,7 @@ class OpenAppFromOverviewTest(testSpec: FlickerTestParameter) : OpenAppTransitio
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -188,7 +188,7 @@ class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : OpenAppTransiti
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerPositionAtEnd() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -85,7 +85,7 @@ class OpenAppWarmTest(testSpec: FlickerTestParameter) : OpenAppTransition(testSp
}
/** {@inheritDoc} */
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
override fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786

View File

@@ -31,7 +31,6 @@ 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.WindowUtils
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.navBarLayerIsVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
@@ -39,6 +38,7 @@ 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 com.android.server.wm.traces.common.Rect
import org.junit.Assume
import org.junit.FixMethodOrder
import org.junit.Test
@@ -68,8 +68,6 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
private val testApp1 = SimpleAppHelper(instrumentation)
private val testApp2 = NonResizeableAppHelper(instrumentation)
private val startDisplayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation)
@FlickerBuilderProvider
fun buildFlicker(): FlickerBuilder {
return FlickerBuilder(instrumentation).apply {
@@ -81,15 +79,20 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
testApp2.launchViaIntent(wmHelper)
wmHelper.waitForFullScreenApp(testApp2.component)
startDisplayBounds = wmHelper.currentState.layerState
.displays.firstOrNull { !it.isVirtual }
?.layerStackSpace
?: 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.
device.swipe(
startDisplayBounds.bounds.right / 3,
startDisplayBounds.bounds.bottom,
2 * startDisplayBounds.bounds.right / 3,
startDisplayBounds.bounds.bottom,
startDisplayBounds.right / 3,
startDisplayBounds.bottom,
2 * startDisplayBounds.right / 3,
startDisplayBounds.bottom,
if (testSpec.isLandscapeOrSeascapeAtStart) 75 else 30
)
@@ -103,10 +106,10 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
// 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(
2 * startDisplayBounds.bounds.right / 3,
startDisplayBounds.bounds.bottom,
startDisplayBounds.bounds.right / 3,
startDisplayBounds.bounds.bottom,
2 * startDisplayBounds.right / 3,
startDisplayBounds.bottom,
startDisplayBounds.right / 3,
startDisplayBounds.bottom,
if (testSpec.isLandscapeOrSeascapeAtStart) 75 else 30
)
@@ -133,7 +136,8 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
testSpec.assertWmStart {
this.frameRegion(testApp1.component).coversExactly(startDisplayBounds)
this.frameRegion(testApp1.component, FlickerComponentName.LETTERBOX)
.coversExactly(startDisplayBounds)
}
}
@@ -188,7 +192,8 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
// This test doesn't work in shell transitions because of b/209936664
Assume.assumeFalse(isShellTransitionsEnabled)
testSpec.assertLayersEnd {
this.visibleRegion(testApp2.component).coversExactly(startDisplayBounds)
this.visibleRegion(testApp2.component, FlickerComponentName.LETTERBOX)
.coversExactly(startDisplayBounds)
}
}
@@ -372,6 +377,8 @@ class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestPara
}
companion object {
private var startDisplayBounds = Rect.EMPTY
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getParams(): Collection<FlickerTestParameter> {

View File

@@ -165,7 +165,7 @@ class ChangeAppRotationTest(
/**
* Checks the position of the status bar at the start and end of the transition
*/
@Presubmit
@FlakyTest(bugId = 206753786)
@Test
fun statusBarLayerRotatesScales() {
// This test doesn't work in shell transitions because of b/206753786