Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b15b01c authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Remove Snapshot and Splash Screen from consecutive entry check

It is already possible to ignore windows/layers on the verification of  visibleWindowsShownMoreThanOneConsecutiveEntry and visibleLayersShownMoreThanOneConsecutiveEntry. However many tests need to manually add the Snapshot and Splash Screen entries.

Those entries are not guaranteed to show for more than 1 entry, they depend on the app behavior and when the SF actually renders the information sent by WM.

This CL removes those windows by default from the verification and refactor the tests to make it easier to update in the future

Test: atest FlickerTests WMShellFlickerTests
Bug: 182720234
Change-Id: I0e3346e078515b3e9a2065256ac04696acfa59fb
parent e85b1a6c
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
@@ -29,8 +29,7 @@ import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import com.android.wm.shell.flicker.dockedStackDividerBecomesVisible
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
@@ -60,6 +59,11 @@ class EnterSplitScreenDockActivity(
            }
        }

    override val ignoredWindows: List<String>
        get() = listOf(LAUNCHER_PACKAGE_NAME, WALLPAPER_TITLE, LIVE_WALLPAPER_PACKAGE_NAME,
            splitScreenApp.defaultWindowName, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
            WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)

    @FlakyTest(bugId = 169271943)
    @Test
    fun dockedStackPrimaryBoundsIsVisible() =
@@ -73,12 +77,8 @@ class EnterSplitScreenDockActivity(
    @FlakyTest(bugId = 178531736)
    @Test
    // b/178531736
    fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleLayersShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME,
                WALLPAPER_TITLE, LIVE_WALLPAPER_PACKAGE_NAME,
                splitScreenApp.defaultWindowName)
        )
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    @Presubmit
    @Test
@@ -91,12 +91,8 @@ class EnterSplitScreenDockActivity(
    @FlakyTest(bugId = 178531736)
    @Test
    // b/178531736
    fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleWindowsShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME,
                WALLPAPER_TITLE, LIVE_WALLPAPER_PACKAGE_NAME,
                splitScreenApp.defaultWindowName)
        )
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    @Presubmit
    @Test
+10 −14
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@ import com.android.server.wm.flicker.helpers.reopenAppFromOverview
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import com.android.wm.shell.flicker.dockedStackDividerBecomesVisible
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
@@ -62,6 +61,11 @@ class EnterSplitScreenLaunchToSide(
            }
        }

    override val ignoredWindows: List<String>
        get() = listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
            secondaryApp.defaultWindowName, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
            WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)

    @FlakyTest(bugId = 169271943)
    @Test
    fun dockedStackPrimaryBoundsIsVisible() =
@@ -83,12 +87,8 @@ class EnterSplitScreenLaunchToSide(
    @Test
    // TODO(b/178447631) Remove Splash Screen from white list when flicker lib
    //                   add a wait for splash screen be gone
    fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleLayersShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME, SPLASH_SCREEN_NAME,
                splitScreenApp.defaultWindowName,
                secondaryApp.defaultWindowName)
        )
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    @Presubmit
    @Test
@@ -104,12 +104,8 @@ class EnterSplitScreenLaunchToSide(

    @Presubmit
    @Test
    fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleWindowsShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME, SPLASH_SCREEN_NAME,
                splitScreenApp.defaultWindowName,
                secondaryApp.defaultWindowName)
        )
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    companion object {
        @Parameterized.Parameters(name = "{0}")
+12 −18
Original line number Diff line number Diff line
@@ -22,12 +22,10 @@ import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.WALLPAPER_TITLE
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.canSplitScreen
import com.android.server.wm.flicker.helpers.openQuickstep
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
import org.junit.Assert
@@ -66,28 +64,24 @@ class EnterSplitScreenNonResizableNotDock(
            }
        }

    override val ignoredWindows: List<String>
        get() = listOf(LAUNCHER_PACKAGE_NAME,
            WindowManagerStateHelper.SPLASH_SCREEN_NAME,
            WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME,
            nonResizeableApp.defaultWindowName,
            splitScreenApp.defaultWindowName)

    @Test
    fun dockedStackDividerIsInvisible() = testSpec.dockedStackDividerIsInvisible()

    @FlakyTest(bugId = 178447631)
    @Test
    fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleLayersShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME,
                SPLASH_SCREEN_NAME,
                nonResizeableApp.defaultWindowName,
                splitScreenApp.defaultWindowName)
        )
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    @Test
    fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleWindowsShownMoreThanOneConsecutiveEntry(
            listOf(WALLPAPER_TITLE,
                LAUNCHER_PACKAGE_NAME,
                SPLASH_SCREEN_NAME,
                nonResizeableApp.defaultWindowName,
                splitScreenApp.defaultWindowName)
        )
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    @Test
    fun appWindowIsVisible() {
+11 −12
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@ import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.layerBecomesInvisible
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
import org.junit.FixMethodOrder
@@ -70,17 +69,20 @@ class ExitLegacySplitScreenFromBottom(
            }
        }

    override val ignoredWindows: List<String>
        get() = listOf(LAUNCHER_PACKAGE_NAME, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
            splitScreenApp.defaultWindowName, secondaryApp.defaultWindowName,
            WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)

    @Presubmit
    @Test
    fun layerBecomesInvisible() = testSpec.layerBecomesInvisible(DOCKED_STACK_DIVIDER)

    @FlakyTest(bugId = 178447631)
    @Test
    fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleLayersShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
                secondaryApp.defaultWindowName)
        )
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
        super.visibleLayersShownMoreThanOneConsecutiveEntry()
    }

    @Presubmit
    @Test
@@ -97,11 +99,8 @@ class ExitLegacySplitScreenFromBottom(

    @FlakyTest(bugId = 178447631)
    @Test
    fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleWindowsShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
                secondaryApp.defaultWindowName)
        )
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    companion object {
        @Parameterized.Parameters(name = "{0}")
+10 −12
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@ import com.android.server.wm.flicker.helpers.reopenAppFromOverview
import com.android.server.wm.flicker.layerBecomesInvisible
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
import org.junit.FixMethodOrder
@@ -70,6 +69,11 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen(
            }
        }

    override val ignoredWindows: List<String>
        get() = listOf(LAUNCHER_PACKAGE_NAME, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
            splitScreenApp.defaultWindowName, secondaryApp.defaultWindowName,
            WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME)

    @FlakyTest(bugId = 175687842)
    @Test
    fun dockedStackDividerIsInvisible() = testSpec.dockedStackDividerIsInvisible()
@@ -80,11 +84,8 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen(

    @FlakyTest(bugId = 178447631)
    @Test
    fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleLayersShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
                secondaryApp.defaultWindowName)
        )
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    @Presubmit
    @Test
@@ -101,11 +102,8 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen(

    @FlakyTest(bugId = 178447631)
    @Test
    fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        testSpec.visibleWindowsShownMoreThanOneConsecutiveEntry(
            listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
                secondaryApp.defaultWindowName)
        )
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    companion object {
        @Parameterized.Parameters(name = "{0}")
Loading