Merge "Fix ExitPipWithDismissButtonTest with Shell transition"
This commit is contained in:
@@ -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,11 +52,28 @@ abstract class ExitPipTransition(testSpec: FlickerTestParameter) : PipTransition
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.invoke("hasPipWindow") {
|
||||
it.isPinned(pipApp.component).isAppWindowVisible(pipApp.component)
|
||||
}.then().invoke("!hasPipWindow") {
|
||||
it.isNotPinned(pipApp.component).isAppWindowInvisible(pipApp.component)
|
||||
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)
|
||||
}.then().invoke("!hasPipWindow") {
|
||||
it.isNotPinned(pipApp.component).isAppWindowInvisible(pipApp.component)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user