From 10489f711a29b0b1cfef41b569c9a5002d1932cf Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Fri, 3 Mar 2023 14:04:40 -0800 Subject: [PATCH] Update PiP Flicker tests for content overlay For some reason, the app icon overlay which is backed by hardware buffer does not occlude the pipApp in the trace, though both the screen recording and winscope trace suggest so. Per discussion, we update the assertion that - pipApp layer is always visible - content overlay appears and then disappears during the transition. Bug: 265998256 Test: atest WMShellFlickerTests:EnterPipOnUserLeaveHintTest Change-Id: I402aa1baf5c829fb12c30af659bc2827d65853a0 --- .../flicker/pip/EnterPipOnUserLeaveHintTest.kt | 12 ++++++++++-- .../wm/shell/flicker/pip/EnterPipTransition.kt | 16 +++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt index 11bb0cc1306e1..f52e877ec2b10 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipOnUserLeaveHintTest.kt @@ -74,10 +74,18 @@ open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTransitio @Presubmit @Test - override fun pipAppLayerOrOverlayAlwaysVisible() { + override fun pipAppLayerAlwaysVisible() { // pip layer in gesture nav will disappear during transition Assume.assumeFalse(flicker.scenario.isGesturalNavigation) - super.pipAppLayerOrOverlayAlwaysVisible() + super.pipAppLayerAlwaysVisible() + } + + @Presubmit + @Test + override fun pipOverlayLayerAppearThenDisappear() { + // no overlay in gesture nav for non-auto enter PiP transition + Assume.assumeFalse(flicker.scenario.isGesturalNavigation) + super.pipOverlayLayerAppearThenDisappear() } @Presubmit diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt index 327225421580d..e40e5eaad9e20 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTransition.kt @@ -43,13 +43,23 @@ abstract class EnterPipTransition(flicker: FlickerTest) : PipTransition(flicker) /** Checks [pipApp] layer remains visible throughout the animation */ @Presubmit @Test - open fun pipAppLayerOrOverlayAlwaysVisible() { + open fun pipAppLayerAlwaysVisible() { flicker.assertLayers { this.isVisible(pipApp) + } + } + + /** Checks the content overlay appears then disappears during the animation */ + @Presubmit + @Test + open fun pipOverlayLayerAppearThenDisappear() { + val overlay = ComponentNameMatcher.PIP_CONTENT_OVERLAY + flicker.assertLayers { + this.notContains(overlay) .then() - .isVisible(ComponentNameMatcher.PIP_CONTENT_OVERLAY) + .contains(overlay) .then() - .isVisible(pipApp) + .notContains(overlay) } }