From 4b2f1da126344377e90badff8d02ddefd03a50ad Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Thu, 29 Apr 2021 12:02:31 +0200 Subject: [PATCH] Fix pip window visibility assertions 1) Fix `Could not find: PipApp`, the test previously used the launcher name, instead of the window name for assertion 2) The command previously missed a `verify` call to actually execute the assertion Bug: 186115871 Bug: 186445782 Test: atest FlickerTests WMShellFlickerTests Change-Id: Ie9274e273bcda2be24491705cd28d7dc0d5ea5db --- .../com/android/wm/shell/flicker/pip/EnterPipTest.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt index a7e1d0fdf90ce..95672f4392754 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipTest.kt @@ -65,7 +65,7 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) { @Test fun pipLayerBecomesVisible() { testSpec.assertLayers { - this.isVisible(pipApp.launcherName) + this.isVisible(pipApp.windowName) } } @@ -73,9 +73,11 @@ class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) { @Test fun pipWindowBecomesVisible() { testSpec.assertWm { - invoke("pipWindowIsNotVisible") { !it.wmState.hasPipWindow() } - .then() - .invoke("pipWindowIsVisible") { it.wmState.hasPipWindow() } + invoke("pipWindowIsNotVisible") { + verify("Has no pip window").that(it.wmState.hasPipWindow()).isTrue() + }.then().invoke("pipWindowIsVisible") { + verify("Has pip window").that(it.wmState.hasPipWindow()).isTrue() + } } }