Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9bac738 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Promote stable flicker tests to presubmit

Also, fix flaky flicker postsubmit tests

Test: atest FlickerTests WMShellFlickerTests
Change-Id: I4552a08a6290fe3aaf5c4728f9dc8b3ebee647fc
parent 04d25e55
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
        val expandButtonBounds = expandPipObject.visibleBounds
        uiDevice.click(expandButtonBounds.centerX(), expandButtonBounds.centerY())
        wmHelper.waitFor("!hasPipWindow") { !it.wmState.hasPipWindow() }
        wmHelper.waitForAppTransitionIdle()
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.wm.shell.flicker.legacysplitscreen

import android.content.ComponentName
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.FlakyTest
@@ -113,7 +112,7 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen(
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
            super.visibleLayersShownMoreThanOneConsecutiveEntry()

    @Postsubmit
    @Presubmit
    @Test
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
            super.visibleWindowsShownMoreThanOneConsecutiveEntry()
+3 −3
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
     * Checks that the pip app window remains inside the display bounds throughout the whole
     * animation
     */
    @Postsubmit
    @Presubmit
    @Test
    fun pipWindowRemainInsideVisibleBounds() {
        testSpec.assertWm {
@@ -131,7 +131,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
    /**
     * Checks that [pipApp] window becomes pinned
     */
    @Postsubmit
    @Presubmit
    @Test
    fun pipWindowBecomesPinned() {
        testSpec.assertWm {
@@ -144,7 +144,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
    /**
     * Checks [LAUNCHER_COMPONENT] layer remains visible throughout the animation
     */
    @Postsubmit
    @Presubmit
    @Test
    fun launcherLayerBecomesVisible() {
        testSpec.assertLayers {
+6 −1
Original line number Diff line number Diff line
@@ -101,6 +101,8 @@ class EnterPipToOtherOrientationTest(
                broadcastActionTrigger.doAction(ACTION_ENTER_PIP)
                wmHelper.waitFor { it.wmState.hasPipWindow() }
                wmHelper.waitForAppTransitionIdle()
                // during rotation the status bar becomes invisible and reappears at the end
                wmHelper.waitForNavBarStatusBarVisible()
            }
        }

@@ -122,7 +124,10 @@ class EnterPipToOtherOrientationTest(
    override fun statusBarLayerRotatesScales() =
        testSpec.statusBarLayerRotatesScales(Surface.ROTATION_90, Surface.ROTATION_0)

    @Postsubmit
    /**
     * Checks that all parts of the screen are covered at the start and end of the transition
     */
    @Presubmit
    @Test
    override fun entireScreenCovered() =
        testSpec.entireScreenCovered(Surface.ROTATION_90, Surface.ROTATION_0, allStates = false)
+16 −1
Original line number Diff line number Diff line
@@ -24,7 +24,9 @@ import com.android.server.wm.flicker.FlickerTestParameter
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.traces.parser.toWindowName
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
@@ -53,7 +55,6 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group3
@Postsubmit
class ExitPipViaExpandButtonClickTest(
    testSpec: FlickerTestParameter
) : ExitPipToAppTransition(testSpec) {
@@ -72,9 +73,23 @@ class ExitPipViaExpandButtonClickTest(
            transitions {
                // This will bring PipApp to fullscreen
                pipApp.expandPipWindowToApp(wmHelper)
                // Wait until the other app is no longer visible
                wmHelper.waitForSurfaceAppeared(testApp.component.toWindowName())
            }
        }

    @Postsubmit
    @Test
    override fun pipAppCoversFullScreenAtEnd() = super.pipAppCoversFullScreenAtEnd()

    @Postsubmit
    @Test
    override fun showBothAppLayersThenHidePip() = super.showBothAppLayersThenHidePip()

    @Postsubmit
    @Test
    override fun showBothAppWindowsThenHidePip() = super.showBothAppWindowsThenHidePip()

    companion object {
        /**
         * Creates the test configurations.
Loading