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

Commit 07a7e3ed authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Android (Google) Code Review
Browse files

Merge "Update statusbar/taskbar assertions in NetflixEnterPipTest" into main

parents ff5bbedb d56a00a3
Loading
Loading
Loading
Loading
+40 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.tools.device.flicker.legacy.FlickerBuilder
import android.tools.device.flicker.legacy.LegacyFlickerTest
import android.tools.device.flicker.legacy.LegacyFlickerTestFactory
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
import org.junit.Assume
import org.junit.FixMethodOrder
import org.junit.Test
@@ -66,8 +67,10 @@ open class NetflixEnterPipTest(flicker: LegacyFlickerTest) : AppsEnterPipTransit
            standardAppHelper.launchViaIntent(
                wmHelper,
                NetflixAppHelper.getNetflixWatchVideoIntent("70184207"),
                ComponentNameMatcher(NetflixAppHelper.PACKAGE_NAME,
                    NetflixAppHelper.WATCH_ACTIVITY)
                ComponentNameMatcher(
                    NetflixAppHelper.PACKAGE_NAME,
                    NetflixAppHelper.WATCH_ACTIVITY
                )
            )
            standardAppHelper.waitForVideoPlaying()
        }
@@ -99,6 +102,41 @@ open class NetflixEnterPipTest(flicker: LegacyFlickerTest) : AppsEnterPipTransit
        super.focusChanges()
    }

    @Postsubmit
    @Test
    override fun taskBarLayerIsVisibleAtStartAndEnd() {
        Assume.assumeTrue(flicker.scenario.isTablet)
        // Netflix starts in immersive fullscreen mode, so taskbar bar is not visible at start
        flicker.assertLayersStart { this.isInvisible(ComponentNameMatcher.TASK_BAR) }
        flicker.assertLayersEnd { this.isVisible(ComponentNameMatcher.TASK_BAR) }
    }

    @Postsubmit
    @Test
    override fun taskBarWindowIsAlwaysVisible() {
        // Netflix plays in immersive fullscreen mode, so taskbar will be gone at some point
    }

    @Postsubmit
    @Test
    override fun statusBarLayerIsVisibleAtStartAndEnd() {
        // Netflix starts in immersive fullscreen mode, so status bar is not visible at start
        flicker.assertLayersStart { this.isInvisible(ComponentNameMatcher.STATUS_BAR) }
        flicker.assertLayersEnd { this.isVisible(ComponentNameMatcher.STATUS_BAR) }
    }

    @Postsubmit
    @Test
    override fun statusBarLayerPositionAtStartAndEnd() {
        // Netflix starts in immersive fullscreen mode, so status bar is not visible at start
        flicker.statusBarLayerPositionAtEnd()
    }

    @Postsubmit
    @Test override fun statusBarWindowIsAlwaysVisible() {
        // Netflix plays in immersive fullscreen mode, so taskbar will be gone at some point
    }

    companion object {
        /**
         * Creates the test configurations.