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

Commit b258c0fd authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Fix ExitPipWithDismissButtonTest with Shell transition"

parents 9131c6a1 2490b439
Loading
Loading
Loading
Loading
+23 −5
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import androidx.test.filters.FlakyTest
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.helpers.setRotation
import org.junit.Test

@@ -51,6 +52,22 @@ abstract class ExitPipTransition(testSpec: FlickerTestParameter) : PipTransition
    @Presubmit
    @Test
    open fun pipWindowBecomesInvisible() {
        if (isShellTransitionsEnabled) {
            // When Shell transition is enabled, we change the windowing mode at start, but
            // update the visibility after the transition is finished, so we can't check isNotPinned
            // and isAppWindowInvisible in the same assertion block.
            testSpec.assertWm {
                this.invoke("hasPipWindow") {
                    it.isPinned(pipApp.component)
                            .isAppWindowVisible(pipApp.component)
                            .isAppWindowOnTop(pipApp.component)
                }.then().invoke("!hasPipWindow") {
                    it.isNotPinned(pipApp.component)
                            .isAppWindowNotOnTop(pipApp.component)
                }
            }
            testSpec.assertWmEnd { isAppWindowInvisible(pipApp.component) }
        } else {
            testSpec.assertWm {
                this.invoke("hasPipWindow") {
                    it.isPinned(pipApp.component).isAppWindowVisible(pipApp.component)
@@ -59,6 +76,7 @@ abstract class ExitPipTransition(testSpec: FlickerTestParameter) : PipTransition
                }
            }
        }
    }

    /**
     * Checks that [pipApp] and [LAUNCHER_COMPONENT] layers are visible at the start
+1 −14
Original line number Diff line number Diff line
@@ -24,10 +24,7 @@ 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.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.rules.WMFlickerServiceRuleForTestSpec
import org.junit.Assume.assumeFalse
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Rule
import org.junit.Test
@@ -88,20 +85,10 @@ class ExitPipWithDismissButtonTest(testSpec: FlickerTestParameter) : ExitPipTran
        flickerRule.checkFlakyAssertions()
    }

    @Before
    fun onBefore() {
        // This CUJ don't work in shell transitions because of b/204570898 b/204562589
        assumeFalse(isShellTransitionsEnabled)
    }

    /** {@inheritDoc}  */
    @FlakyTest(bugId = 206753786)
    @Test
    override fun statusBarLayerRotatesScales() {
        // This test doesn't work in shell transitions because of b/206753786
        assumeFalse(isShellTransitionsEnabled)
        super.statusBarLayerRotatesScales()
    }
    override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()

    companion object {
        /**