Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt +41 −14 Original line number Diff line number Diff line Loading @@ -82,15 +82,35 @@ open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTest(flic @Presubmit @Test override fun pipAppLayerAlwaysVisible() { if (!flicker.scenario.isGesturalNavigation) super.pipAppLayerAlwaysVisible() else { override fun pipAppLayerOrOverlayAlwaysVisible() { // pip layer in gesture nav will disappear during transition Assume.assumeFalse(flicker.scenario.isGesturalNavigation) super.pipAppLayerOrOverlayAlwaysVisible() } @Presubmit @Test fun pipAppWindowVisibleChanges() { // pip layer in gesture nav will disappear during transition Assume.assumeTrue(flicker.scenario.isGesturalNavigation) flicker.assertWm { this.isAppWindowVisible(pipApp) .then() .isAppWindowInvisible(pipApp, isOptional = true) .then() .isAppWindowVisible(pipApp, isOptional = true) } } @Presubmit @Test fun pipAppLayerVisibleChanges() { Assume.assumeTrue(flicker.scenario.isGesturalNavigation) // pip layer in gesture nav will disappear during transition flicker.assertLayers { this.isVisible(pipApp).then().isInvisible(pipApp).then().isVisible(pipApp) } } } @Presubmit @Test Loading @@ -116,12 +136,19 @@ open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTest(flic @Presubmit @Test override fun pipLayerRemainInsideVisibleBounds() { if (!flicker.scenario.isGesturalNavigation) super.pipLayerRemainInsideVisibleBounds() else { override fun pipLayerOrOverlayRemainInsideVisibleBounds() { // pip layer in gesture nav will disappear during transition Assume.assumeFalse(flicker.scenario.isGesturalNavigation) super.pipLayerOrOverlayRemainInsideVisibleBounds() } @Presubmit @Test fun pipLayerRemainInsideVisibleBounds() { // pip layer in gesture nav will disappear during transition Assume.assumeTrue(flicker.scenario.isGesturalNavigation) // pip layer in gesture nav will disappear during transition flicker.assertLayersStart { this.visibleRegion(pipApp).coversAtMost(displayBounds) } flicker.assertLayersEnd { this.visibleRegion(pipApp).coversAtMost(displayBounds) } } } } libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt +12 −4 Original line number Diff line number Diff line Loading @@ -74,8 +74,14 @@ open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) { /** Checks [pipApp] layer remains visible throughout the animation */ @Presubmit @Test open fun pipAppLayerAlwaysVisible() { flicker.assertLayers { this.isVisible(pipApp) } open fun pipAppLayerOrOverlayAlwaysVisible() { flicker.assertLayers { this.isVisible(pipApp) .then() .isVisible(ComponentNameMatcher.PIP_CONTENT_OVERLAY) .then() .isVisible(pipApp) } } /** Loading @@ -94,8 +100,10 @@ open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) { */ @Presubmit @Test open fun pipLayerRemainInsideVisibleBounds() { flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) } open fun pipLayerOrOverlayRemainInsideVisibleBounds() { flicker.assertLayersVisibleRegion(pipApp.or(ComponentNameMatcher.PIP_CONTENT_OVERLAY) ) { coversAtMost(displayBounds) } } /** Checks that the visible region of [pipApp] always reduces during the animation */ Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.flicker.pip import android.app.Activity import android.platform.test.annotations.FlakyTest import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice Loading Loading @@ -197,7 +198,7 @@ open class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition( } /** {@inheritDoc} */ @Presubmit @FlakyTest(bugId = 267424412) @Test override fun visibleLayersShownMoreThanOneConsecutiveEntry() = super.visibleLayersShownMoreThanOneConsecutiveEntry() Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt +11 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import com.android.server.wm.flicker.FlickerTest import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.server.wm.traces.common.ComponentNameMatcher import org.junit.Test /** Base class for pip expand tests */ Loading @@ -32,7 +33,9 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic @Presubmit @Test open fun pipAppWindowRemainInsideVisibleBounds() { flicker.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) } flicker.assertWmVisibleRegion(pipApp.or(ComponentNameMatcher.TRANSITION_SNAPSHOT)) { coversAtMost(displayBounds) } } /** Loading @@ -42,7 +45,9 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic @Presubmit @Test open fun pipAppLayerRemainInsideVisibleBounds() { flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) } flicker.assertLayersVisibleRegion(pipApp.or(ComponentNameMatcher.TRANSITION_SNAPSHOT)) { coversAtMost(displayBounds) } } /** Loading Loading @@ -72,7 +77,10 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic @Test open fun showBothAppLayersThenHidePip() { flicker.assertLayers { isVisible(testApp).isVisible(pipApp).then().isInvisible(testApp).isVisible(pipApp) isVisible(testApp) .isVisible(pipApp.or(ComponentNameMatcher.TRANSITION_SNAPSHOT)) .then() .isInvisible(testApp).isVisible(pipApp) } } Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithSwipeDownTest.kt +3 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,9 @@ open class ExitPipWithSwipeDownTest(flicker: FlickerTest) : ExitPipTransition(fl ?.height ?: error("Couldn't find Nav or Task bar layer") // The dismiss button doesn't appear at the complete bottom of the screen, val displayY = device.displayHeight - barLayerHeight // it appears above the hot seat but `hotseatBarSize` is not available outside // the platform val displayY = (device.displayHeight * 0.9).toInt() - barLayerHeight device.swipe(pipCenterX, pipCenterY, displayCenterX, displayY, 50) // Wait until the other app is no longer visible wmHelper Loading Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt +41 −14 Original line number Diff line number Diff line Loading @@ -82,15 +82,35 @@ open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTest(flic @Presubmit @Test override fun pipAppLayerAlwaysVisible() { if (!flicker.scenario.isGesturalNavigation) super.pipAppLayerAlwaysVisible() else { override fun pipAppLayerOrOverlayAlwaysVisible() { // pip layer in gesture nav will disappear during transition Assume.assumeFalse(flicker.scenario.isGesturalNavigation) super.pipAppLayerOrOverlayAlwaysVisible() } @Presubmit @Test fun pipAppWindowVisibleChanges() { // pip layer in gesture nav will disappear during transition Assume.assumeTrue(flicker.scenario.isGesturalNavigation) flicker.assertWm { this.isAppWindowVisible(pipApp) .then() .isAppWindowInvisible(pipApp, isOptional = true) .then() .isAppWindowVisible(pipApp, isOptional = true) } } @Presubmit @Test fun pipAppLayerVisibleChanges() { Assume.assumeTrue(flicker.scenario.isGesturalNavigation) // pip layer in gesture nav will disappear during transition flicker.assertLayers { this.isVisible(pipApp).then().isInvisible(pipApp).then().isVisible(pipApp) } } } @Presubmit @Test Loading @@ -116,12 +136,19 @@ open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTest(flic @Presubmit @Test override fun pipLayerRemainInsideVisibleBounds() { if (!flicker.scenario.isGesturalNavigation) super.pipLayerRemainInsideVisibleBounds() else { override fun pipLayerOrOverlayRemainInsideVisibleBounds() { // pip layer in gesture nav will disappear during transition Assume.assumeFalse(flicker.scenario.isGesturalNavigation) super.pipLayerOrOverlayRemainInsideVisibleBounds() } @Presubmit @Test fun pipLayerRemainInsideVisibleBounds() { // pip layer in gesture nav will disappear during transition Assume.assumeTrue(flicker.scenario.isGesturalNavigation) // pip layer in gesture nav will disappear during transition flicker.assertLayersStart { this.visibleRegion(pipApp).coversAtMost(displayBounds) } flicker.assertLayersEnd { this.visibleRegion(pipApp).coversAtMost(displayBounds) } } } }
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt +12 −4 Original line number Diff line number Diff line Loading @@ -74,8 +74,14 @@ open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) { /** Checks [pipApp] layer remains visible throughout the animation */ @Presubmit @Test open fun pipAppLayerAlwaysVisible() { flicker.assertLayers { this.isVisible(pipApp) } open fun pipAppLayerOrOverlayAlwaysVisible() { flicker.assertLayers { this.isVisible(pipApp) .then() .isVisible(ComponentNameMatcher.PIP_CONTENT_OVERLAY) .then() .isVisible(pipApp) } } /** Loading @@ -94,8 +100,10 @@ open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) { */ @Presubmit @Test open fun pipLayerRemainInsideVisibleBounds() { flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) } open fun pipLayerOrOverlayRemainInsideVisibleBounds() { flicker.assertLayersVisibleRegion(pipApp.or(ComponentNameMatcher.PIP_CONTENT_OVERLAY) ) { coversAtMost(displayBounds) } } /** Checks that the visible region of [pipApp] always reduces during the animation */ Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.flicker.pip import android.app.Activity import android.platform.test.annotations.FlakyTest import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import androidx.test.filters.RequiresDevice Loading Loading @@ -197,7 +198,7 @@ open class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition( } /** {@inheritDoc} */ @Presubmit @FlakyTest(bugId = 267424412) @Test override fun visibleLayersShownMoreThanOneConsecutiveEntry() = super.visibleLayersShownMoreThanOneConsecutiveEntry() Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipToAppTransition.kt +11 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import com.android.server.wm.flicker.FlickerTest import com.android.server.wm.flicker.helpers.SimpleAppHelper import com.android.server.wm.traces.common.ComponentNameMatcher import org.junit.Test /** Base class for pip expand tests */ Loading @@ -32,7 +33,9 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic @Presubmit @Test open fun pipAppWindowRemainInsideVisibleBounds() { flicker.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) } flicker.assertWmVisibleRegion(pipApp.or(ComponentNameMatcher.TRANSITION_SNAPSHOT)) { coversAtMost(displayBounds) } } /** Loading @@ -42,7 +45,9 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic @Presubmit @Test open fun pipAppLayerRemainInsideVisibleBounds() { flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) } flicker.assertLayersVisibleRegion(pipApp.or(ComponentNameMatcher.TRANSITION_SNAPSHOT)) { coversAtMost(displayBounds) } } /** Loading Loading @@ -72,7 +77,10 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic @Test open fun showBothAppLayersThenHidePip() { flicker.assertLayers { isVisible(testApp).isVisible(pipApp).then().isInvisible(testApp).isVisible(pipApp) isVisible(testApp) .isVisible(pipApp.or(ComponentNameMatcher.TRANSITION_SNAPSHOT)) .then() .isInvisible(testApp).isVisible(pipApp) } } Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/ExitPipWithSwipeDownTest.kt +3 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,9 @@ open class ExitPipWithSwipeDownTest(flicker: FlickerTest) : ExitPipTransition(fl ?.height ?: error("Couldn't find Nav or Task bar layer") // The dismiss button doesn't appear at the complete bottom of the screen, val displayY = device.displayHeight - barLayerHeight // it appears above the hot seat but `hotseatBarSize` is not available outside // the platform val displayY = (device.displayHeight * 0.9).toInt() - barLayerHeight device.swipe(pipCenterX, pipCenterY, displayCenterX, displayY, 50) // Wait until the other app is no longer visible wmHelper Loading