From ab508e96cf6dfd472ae93a2d42d01950f42b82d7 Mon Sep 17 00:00:00 2001 From: Antonella Dellanzo Date: Mon, 7 Dec 2020 14:22:17 +0100 Subject: [PATCH] Updating split screen tests Updating split screen tests: - Adding the assertions visibleWindowsShownMoreThanOneConsecutiveEntry and visibleLayersShownMoreThanOneConsecutiveEntry for all the split screen tests (the layer one is disabled as we need ag/13051160 to ignore one layer). - Replacing some assertions for other that check more things (i.e. replacing the dockedStackDividerIsVisible assertion for dockedStackDividerBecomesVisible). - Adding some new assertions to the current tests in order to check for more things. Adding new WM and layer assertions to Flicker tests to avoid repeating code: - appWindowBecomesVisible - layerBecomesVisible - layerBecomesInvisible Adding new layer assertions to WM shell to avoid repeating code: - dockedStackDividerBecomesVisible - dockedStackDividerBecomesInvisible Test: atest WMShellFlickerTests Bug: b/171049797 Change-Id: I2bbb23a1cf92df16ee6292e5da4644936a6d99e5 --- .../wm/shell/flicker/CommonAssertions.kt | 25 +++++++++++++ .../EnterLegacySplitScreenTest.kt | 16 ++++++--- .../ExitLegacySplitScreenTest.kt | 19 ++++++++-- .../LegacySplitScreenToLauncherTest.kt | 25 ++++++------- .../OpenAppToLegacySplitScreenTest.kt | 24 +++++++++---- .../ResizeLegacySplitScreenTest.kt | 6 +++- .../legacysplitscreen/SplitScreenTestBase.kt | 3 ++ .../flicker/pip/PipLegacySplitScreenTest.kt | 2 +- .../server/wm/flicker/CommonAssertions.kt | 36 +++++++++++++++++++ 9 files changed, 128 insertions(+), 28 deletions(-) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt index c5b54bc4abcbe..e3ac3f0565013 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt @@ -17,6 +17,7 @@ package com.android.wm.shell.flicker import android.graphics.Region +import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER import com.android.server.wm.flicker.dsl.EventLogAssertion import com.android.server.wm.flicker.dsl.LayersAssertion import com.android.server.wm.flicker.helpers.WindowUtils @@ -51,6 +52,30 @@ fun LayersAssertion.dockedStackDividerIsVisible( } } +@JvmOverloads +fun LayersAssertion.dockedStackDividerBecomesVisible( + bugId: Int = 0, + enabled: Boolean = bugId == 0 +) { + all("dividerLayerBecomesVisible") { + this.hidesLayer(DOCKED_STACK_DIVIDER) + .then() + .showsLayer(DOCKED_STACK_DIVIDER) + } +} + +@JvmOverloads +fun LayersAssertion.dockedStackDividerBecomesInvisible( + bugId: Int = 0, + enabled: Boolean = bugId == 0 +) { + all("dividerLayerBecomesInvisible") { + this.showsLayer(DOCKED_STACK_DIVIDER) + .then() + .hidesLayer(DOCKED_STACK_DIVIDER) + } +} + @JvmOverloads fun LayersAssertion.dockedStackDividerIsInvisible( bugId: Int = 0, diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt index 02f6f8c4b32fb..5b9091fa7c039 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt @@ -29,7 +29,6 @@ import com.android.server.wm.flicker.helpers.launchSplitScreen import com.android.server.wm.flicker.helpers.openQuickstep import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.wm.shell.flicker.dockedStackDividerIsInvisible -import com.android.wm.shell.flicker.dockedStackDividerIsVisible import com.android.wm.shell.flicker.helpers.SplitScreenHelper.Companion.TEST_REPETITIONS import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible @@ -38,6 +37,9 @@ import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible import org.junit.Assert +import com.android.wm.shell.flicker.dockedStackDividerBecomesVisible +import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -46,7 +48,7 @@ import org.junit.runners.Parameterized /** * Test SplitScreen launch. - * To run this test: `atest WMShellFlickerTests:EnterSplitScreenTest` + * To run this test: `atest WMShellFlickerTests:EnterLegacySplitScreenTest` */ @Presubmit @RequiresDevice @@ -81,10 +83,16 @@ class EnterLegacySplitScreenTest( layersTrace { navBarLayerIsAlwaysVisible() statusBarLayerIsAlwaysVisible() + visibleLayersShownMoreThanOneConsecutiveEntry( + listOf(launcherPackageName, splitScreenApp.defaultWindowName, + secondaryApp.defaultWindowName, + nonResizeableApp.defaultWindowName) + ) } windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(launcherPackageName)) } } } @@ -103,9 +111,9 @@ class EnterLegacySplitScreenTest( } assertions { layersTrace { - dockedStackDividerIsVisible() dockedStackPrimaryBoundsIsVisible( rotation, splitScreenApp.defaultWindowName, 169271943) + dockedStackDividerBecomesVisible() } windowManagerTrace { end { @@ -132,11 +140,11 @@ class EnterLegacySplitScreenTest( } assertions { layersTrace { - dockedStackDividerIsVisible() dockedStackPrimaryBoundsIsVisible( rotation, splitScreenApp.defaultWindowName, 169271943) dockedStackSecondaryBoundsIsVisible( rotation, secondaryApp.defaultWindowName, 169271943) + dockedStackDividerBecomesVisible() } windowManagerTrace { end { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt index 33306bf946399..be7faf61890dd 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt @@ -21,6 +21,11 @@ import android.util.Rational import android.view.Surface import androidx.test.filters.FlakyTest import androidx.test.filters.RequiresDevice +import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible +import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible +import com.android.server.wm.flicker.layerBecomesInvisible import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.flicker.dsl.runWithFlicker import com.android.server.wm.flicker.helpers.exitSplitScreen @@ -29,8 +34,6 @@ import com.android.server.wm.flicker.helpers.resizeSplitScreen import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.wm.shell.flicker.dockedStackDividerIsInvisible import com.android.wm.shell.flicker.helpers.SplitScreenHelper.Companion.TEST_REPETITIONS -import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible -import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -39,7 +42,7 @@ import org.junit.runners.Parameterized /** * Test exit SplitScreen mode. - * To run this test: `atest WMShellFlickerTests:ExitSplitScreenTest` + * To run this test: `atest WMShellFlickerTests:ExitLegacySplitScreenTest` */ @Presubmit @RequiresDevice @@ -71,6 +74,15 @@ class ExitLegacySplitScreenTest( secondaryApp.exit() } } + assertions { + windowManagerTrace { + visibleWindowsShownMoreThanOneConsecutiveEntry() + } + layersTrace { + visibleLayersShownMoreThanOneConsecutiveEntry( + listOf(launcherPackageName)) + } + } } @Test @@ -87,6 +99,7 @@ class ExitLegacySplitScreenTest( assertions { layersTrace { dockedStackDividerIsInvisible() + layerBecomesInvisible(splitScreenApp.defaultWindowName) } windowManagerTrace { navBarWindowIsAlwaysVisible() diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/LegacySplitScreenToLauncherTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/LegacySplitScreenToLauncherTest.kt index cc02aa30a4ba2..f8df0e1cd3e07 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/LegacySplitScreenToLauncherTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/LegacySplitScreenToLauncherTest.kt @@ -17,10 +17,10 @@ package com.android.wm.shell.flicker.legacysplitscreen import android.platform.test.annotations.Presubmit +import android.support.test.launcherhelper.LauncherStrategyFactory import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry -import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER import com.android.server.wm.flicker.Flicker import com.android.server.wm.flicker.FlickerTestRunner import com.android.server.wm.flicker.FlickerTestRunnerFactory @@ -35,12 +35,16 @@ import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible import com.android.server.wm.flicker.navBarLayerRotatesAndScales +import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.layerBecomesInvisible import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible import com.android.server.wm.flicker.noUncoveredRegions import com.android.server.wm.flicker.repetitions import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible import com.android.server.wm.flicker.statusBarLayerRotatesScales import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible +import com.android.wm.shell.flicker.dockedStackDividerBecomesInvisible import org.junit.FixMethodOrder import org.junit.runner.RunWith import org.junit.runners.MethodSorters @@ -48,7 +52,7 @@ import org.junit.runners.Parameterized /** * Test open app to split screen. - * To run this test: `atest WMShellFlickerTests:SplitScreenToLauncherTest` + * To run this test: `atest WMShellFlickerTests:LegacySplitScreenToLauncherTest` */ @Presubmit @RequiresDevice @@ -63,6 +67,8 @@ class LegacySplitScreenToLauncherTest( @JvmStatic fun getParams(): Collection> { val instrumentation = InstrumentationRegistry.getInstrumentation() + val launcherPackageName = LauncherStrategyFactory.getInstance(instrumentation) + .launcherStrategy.supportedLauncherPackage val testApp = StandardAppHelper(instrumentation, "com.android.wm.shell.flicker.testapp", "SimpleApp") @@ -101,6 +107,7 @@ class LegacySplitScreenToLauncherTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry() } layersTrace { @@ -109,19 +116,13 @@ class LegacySplitScreenToLauncherTest( noUncoveredRegions(configuration.endRotation) navBarLayerRotatesAndScales(configuration.endRotation) statusBarLayerRotatesScales(configuration.endRotation) + visibleLayersShownMoreThanOneConsecutiveEntry( + listOf(launcherPackageName)) // b/161435597 causes the test not to work on 90 degrees - all("dividerLayerBecomesInvisible") { - this.showsLayer(DOCKED_STACK_DIVIDER) - .then() - .hidesLayer(DOCKED_STACK_DIVIDER) - } + dockedStackDividerBecomesInvisible() - all("appLayerBecomesInvisible") { - this.showsLayer(testApp.getPackage()) - .then() - .hidesLayer(testApp.getPackage()) - } + layerBecomesInvisible(testApp.getPackage()) } eventLog { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/OpenAppToLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/OpenAppToLegacySplitScreenTest.kt index bb80726bf05f6..134461adf57b3 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/OpenAppToLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/OpenAppToLegacySplitScreenTest.kt @@ -17,10 +17,10 @@ package com.android.wm.shell.flicker.legacysplitscreen import android.platform.test.annotations.Presubmit +import android.support.test.launcherhelper.LauncherStrategyFactory import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry -import com.android.server.wm.flicker.DOCKED_STACK_DIVIDER import com.android.server.wm.flicker.Flicker import com.android.server.wm.flicker.FlickerTestRunner import com.android.server.wm.flicker.FlickerTestRunnerFactory @@ -35,12 +35,17 @@ import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible import com.android.server.wm.flicker.navBarLayerRotatesAndScales +import com.android.server.wm.flicker.appWindowBecomesVisible +import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.layerBecomesVisible import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible import com.android.server.wm.flicker.noUncoveredRegions import com.android.server.wm.flicker.repetitions import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible import com.android.server.wm.flicker.statusBarLayerRotatesScales import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible +import com.android.wm.shell.flicker.dockedStackDividerBecomesVisible import org.junit.FixMethodOrder import org.junit.runner.RunWith import org.junit.runners.MethodSorters @@ -48,7 +53,7 @@ import org.junit.runners.Parameterized /** * Test open app to split screen. - * To run this test: `atest WMShellFlickerTests:OpenAppToSplitScreenTest` + * To run this test: `atest WMShellFlickerTests:OpenAppToLegacySplitScreenTest` */ @Presubmit @RequiresDevice @@ -63,6 +68,8 @@ class OpenAppToLegacySplitScreenTest( @JvmStatic fun getParams(): Collection> { val instrumentation = InstrumentationRegistry.getInstrumentation() + val launcherPackageName = LauncherStrategyFactory.getInstance(instrumentation) + .launcherStrategy.supportedLauncherPackage val testApp = StandardAppHelper(instrumentation, "com.android.wm.shell.flicker.testapp", "SimpleApp") @@ -79,6 +86,7 @@ class OpenAppToLegacySplitScreenTest( } eachRun { testApp.open() + device.pressHome() this.setRotation(configuration.endRotation) } } @@ -99,6 +107,9 @@ class OpenAppToLegacySplitScreenTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry() + + appWindowBecomesVisible(testApp.getPackage()) } layersTrace { @@ -108,12 +119,11 @@ class OpenAppToLegacySplitScreenTest( navBarLayerRotatesAndScales(configuration.endRotation, bugId = 140855415) statusBarLayerRotatesScales(configuration.endRotation) + visibleLayersShownMoreThanOneConsecutiveEntry( + listOf(launcherPackageName)) - all("dividerLayerBecomesVisible") { - this.hidesLayer(DOCKED_STACK_DIVIDER) - .then() - .showsLayer(DOCKED_STACK_DIVIDER) - } + dockedStackDividerBecomesVisible() + layerBecomesVisible(testApp.getPackage()) } eventLog { diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ResizeLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ResizeLegacySplitScreenTest.kt index e3beb41750f33..391cb2a03d1c2 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ResizeLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ResizeLegacySplitScreenTest.kt @@ -47,6 +47,8 @@ import com.android.server.wm.flicker.repetitions import com.android.server.wm.flicker.startRotation import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible import com.android.server.wm.flicker.statusBarLayerRotatesScales +import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry +import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible import org.junit.FixMethodOrder import org.junit.runner.RunWith @@ -55,7 +57,7 @@ import org.junit.runners.Parameterized /** * Test split screen resizing window transitions. - * To run this test: `atest WMShellFlickerTests:ResizeSplitScreenTest` + * To run this test: `atest WMShellFlickerTests:ResizeLegacySplitScreenTest` * * Currently it runs only in 0 degrees because of b/156100803 */ @@ -131,6 +133,7 @@ class ResizeLegacySplitScreenTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry() all("topAppWindowIsAlwaysVisible", bugId = 156223549) { this.showsAppWindow(sSimpleActivity) @@ -147,6 +150,7 @@ class ResizeLegacySplitScreenTest( noUncoveredRegions(configuration.endRotation) navBarLayerRotatesAndScales(configuration.endRotation) statusBarLayerRotatesScales(configuration.endRotation) + visibleLayersShownMoreThanOneConsecutiveEntry() all("topAppLayerIsAlwaysVisible") { this.showsLayer(sSimpleActivity) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/SplitScreenTestBase.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/SplitScreenTestBase.kt index a2e325e49674d..a536ec8e2e0be 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/SplitScreenTestBase.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/SplitScreenTestBase.kt @@ -16,6 +16,7 @@ package com.android.wm.shell.flicker.legacysplitscreen +import android.support.test.launcherhelper.LauncherStrategyFactory import com.android.wm.shell.flicker.NonRotationTestBase import com.android.wm.shell.flicker.TEST_APP_NONRESIZEABLE_LABEL import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_PRIMARY_LABEL @@ -36,4 +37,6 @@ abstract class SplitScreenTestBase( protected val nonResizeableApp = SplitScreenHelper(instrumentation, TEST_APP_NONRESIZEABLE_LABEL, Components.NonResizeableActivity()) + protected val launcherPackageName = LauncherStrategyFactory.getInstance(instrumentation) + .launcherStrategy.supportedLauncherPackage } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt index 81cdbf05be6cf..9eae179fed929 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt @@ -41,7 +41,7 @@ import org.junit.runners.Parameterized /** * Test Pip with split-screen. - * To run this test: `atest WMShellFlickerTests:PipSplitScreenTest` + * To run this test: `atest WMShellFlickerTests:PipLegacySplitScreenTest` */ @RequiresDevice @RunWith(Parameterized::class) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt index 0df44543a74e6..e4db55e238ea5 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt @@ -101,6 +101,18 @@ fun WmAssertion.appWindowAlwaysVisibleOnTop( } } +fun WmAssertion.appWindowBecomesVisible( + appName: String, + bugId: Int = 0, + enabled: Boolean = bugId == 0 +) { + all("appWindowBecomesVisible", bugId, enabled) { + this.hidesAppWindow(appName) + .then() + .showsAppWindow(appName) + } +} + @JvmOverloads fun LayersAssertion.noUncoveredRegions( beginRotation: Int, @@ -259,6 +271,30 @@ fun LayersAssertion.layerAlwaysVisible( } } +fun LayersAssertion.layerBecomesVisible( + packageName: String, + bugId: Int = 0, + enabled: Boolean = bugId == 0 +) { + all("layerBecomesVisible", bugId, enabled) { + this.hidesLayer(packageName) + .then() + .showsLayer(packageName) + } +} + +fun LayersAssertion.layerBecomesInvisible( + packageName: String, + bugId: Int = 0, + enabled: Boolean = bugId == 0 +) { + all("layerBecomesInvisible", bugId, enabled) { + this.showsLayer(packageName) + .then() + .hidesLayer(packageName) + } +} + fun EventLogAssertion.focusChanges( vararg windows: String, bugId: Int = 0,