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

Commit 4ce14de7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Promote passing PIP tests"

parents 76024233 fa2c195b
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.wm.shell.flicker.pip

import android.app.Activity
import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Presubmit
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerBuilder
@@ -27,10 +26,8 @@ import com.android.server.wm.flicker.entireScreenCovered
import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.navBarLayerPositionAtStartAndEnd
import com.android.server.wm.flicker.testapp.ActivityOptions.Pip.ACTION_ENTER_PIP
import com.android.server.wm.flicker.testapp.ActivityOptions.PortraitOnlyActivity.EXTRA_FIXED_ORIENTATION
import com.android.server.wm.traces.common.ComponentNameMatcher
import com.android.server.wm.traces.common.service.PlatformConsts
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_PORTRAIT
@@ -115,14 +112,6 @@ open class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition(
        Assume.assumeFalse(tapl.isTablet)
    }

    /**
     * Checks that the [ComponentNameMatcher.NAV_BAR] has the correct position at the start and end
     * of the transition
     */
    @FlakyTest
    @Test
    override fun navBarLayerPositionAtStartAndEnd() = flicker.navBarLayerPositionAtStartAndEnd()

    /**
     * Checks that all parts of the screen are covered at the start and end of the transition
     *
@@ -132,12 +121,6 @@ open class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition(
    @Test
    fun entireScreenCoveredAtStartAndEnd() = flicker.entireScreenCovered(allStates = false)

    @FlakyTest(bugId = 251219769)
    @Test
    override fun entireScreenCovered() {
        super.entireScreenCovered()
    }

    /** Checks [pipApp] window remains visible and on top throughout the transition */
    @Presubmit
    @Test
+14 −3
Original line number Diff line number Diff line
@@ -22,8 +22,10 @@ import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerBuilder
import com.android.server.wm.flicker.FlickerTest
import com.android.server.wm.flicker.FlickerTestFactory
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
import com.android.server.wm.traces.common.service.PlatformConsts
import org.junit.Assume
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -74,10 +76,19 @@ open class ExitPipViaExpandButtonClickTest(flicker: FlickerTest) : ExitPipToAppT
        }

    /** {@inheritDoc} */
    @Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
    @FlakyTest(bugId = 197726610)
    @Test
    override fun pipLayerExpands() {
        Assume.assumeFalse(isShellTransitionsEnabled)
        super.pipLayerExpands()
    }

    /** {@inheritDoc} */
    @FlakyTest(bugId = 197726610) @Test override fun pipLayerExpands() = super.pipLayerExpands()
    @Presubmit
    @Test
    fun pipLayerExpands_ShellTransit() {
        Assume.assumeTrue(isShellTransitionsEnabled)
        super.pipLayerExpands()
    }

    companion object {
        /**
+11 −77
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.wm.shell.flicker.pip

import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Presubmit
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerBuilder
import com.android.server.wm.flicker.FlickerTest
@@ -62,7 +62,7 @@ class ExpandPipOnDoubleClickTest(flicker: FlickerTest) : PipTransition(flicker)
     * Checks that the pip app window remains inside the display bounds throughout the whole
     * animation
     */
    @FlakyTest(bugId = 249308003)
    @Presubmit
    @Test
    fun pipWindowRemainInsideVisibleBounds() {
        flicker.assertWmVisibleRegion(pipApp) { coversAtMost(displayBounds) }
@@ -72,28 +72,28 @@ class ExpandPipOnDoubleClickTest(flicker: FlickerTest) : PipTransition(flicker)
     * Checks that the pip app layer remains inside the display bounds throughout the whole
     * animation
     */
    @FlakyTest(bugId = 249308003)
    @Presubmit
    @Test
    fun pipLayerRemainInsideVisibleBounds() {
        flicker.assertLayersVisibleRegion(pipApp) { coversAtMost(displayBounds) }
    }

    /** Checks [pipApp] window remains visible throughout the animation */
    @FlakyTest(bugId = 249308003)
    @Presubmit
    @Test
    fun pipWindowIsAlwaysVisible() {
        flicker.assertWm { isAppWindowVisible(pipApp) }
    }

    /** Checks [pipApp] layer remains visible throughout the animation */
    @FlakyTest(bugId = 249308003)
    @Presubmit
    @Test
    fun pipLayerIsAlwaysVisible() {
        flicker.assertLayers { isVisible(pipApp) }
    }

    /** Checks that the visible region of [pipApp] always expands during the animation */
    @FlakyTest(bugId = 249308003)
    @Presubmit
    @Test
    fun pipLayerExpands() {
        flicker.assertLayers {
@@ -104,7 +104,7 @@ class ExpandPipOnDoubleClickTest(flicker: FlickerTest) : PipTransition(flicker)
        }
    }

    @FlakyTest(bugId = 249308003)
    @Presubmit
    @Test
    fun pipSameAspectRatio() {
        flicker.assertLayers {
@@ -116,92 +116,26 @@ class ExpandPipOnDoubleClickTest(flicker: FlickerTest) : PipTransition(flicker)
    }

    /** Checks [pipApp] window remains pinned throughout the animation */
    @FlakyTest(bugId = 249308003)
    @Presubmit
    @Test
    fun windowIsAlwaysPinned() {
        flicker.assertWm { this.invoke("hasPipWindow") { it.isPinned(pipApp) } }
    }

    /** Checks [ComponentMatcher.LAUNCHER] layer remains visible throughout the animation */
    @FlakyTest(bugId = 249308003)
    /** Checks [ComponentNameMatcher.LAUNCHER] layer remains visible throughout the animation */
    @Presubmit
    @Test
    fun launcherIsAlwaysVisible() {
        flicker.assertLayers { isVisible(ComponentNameMatcher.LAUNCHER) }
    }

    /** Checks that the focus doesn't change between windows during the transition */
    @FlakyTest(bugId = 216306753)
    @Presubmit
    @Test
    fun focusDoesNotChange() {
        flicker.assertEventLog { this.focusDoesNotChange() }
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun navBarLayerIsVisibleAtStartAndEnd() {
        super.navBarLayerIsVisibleAtStartAndEnd()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun navBarWindowIsAlwaysVisible() {
        super.navBarWindowIsAlwaysVisible()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun statusBarLayerIsVisibleAtStartAndEnd() {
        super.statusBarLayerIsVisibleAtStartAndEnd()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun statusBarLayerPositionAtStartAndEnd() {
        super.statusBarLayerPositionAtStartAndEnd()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun taskBarLayerIsVisibleAtStartAndEnd() {
        super.taskBarLayerIsVisibleAtStartAndEnd()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun taskBarWindowIsAlwaysVisible() {
        super.taskBarWindowIsAlwaysVisible()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
        super.visibleLayersShownMoreThanOneConsecutiveEntry()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun statusBarWindowIsAlwaysVisible() {
        super.statusBarWindowIsAlwaysVisible()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun entireScreenCovered() {
        super.entireScreenCovered()
    }

    @FlakyTest(bugId = 216306753)
    @Test
    override fun navBarLayerPositionAtStartAndEnd() {
        super.navBarLayerPositionAtStartAndEnd()
    }

    companion object {
        /**
         * Creates the test configurations.
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.wm.shell.flicker.pip

import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerBuilder
import com.android.server.wm.flicker.FlickerTest
@@ -39,7 +39,7 @@ class ExpandPipOnPinchOpenTest(flicker: FlickerTest) : PipTransition(flicker) {
        get() = buildTransition { transitions { pipApp.pinchOpenPipWindow(wmHelper, 0.4f, 30) } }

    /** Checks that the visible region area of [pipApp] always increases during the animation. */
    @Postsubmit
    @Presubmit
    @Test
    fun pipLayerAreaIncreases() {
        flicker.assertLayers {
+0 −14
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.flicker.pip

import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Presubmit
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerBuilder
@@ -24,11 +23,8 @@ import com.android.server.wm.flicker.FlickerTest
import com.android.server.wm.flicker.FlickerTestFactory
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -66,11 +62,6 @@ open class PipRotationTest(flicker: FlickerTest) : PipTransition(flicker) {
    private val screenBoundsStart = WindowUtils.getDisplayBounds(flicker.scenario.startRotation)
    private val screenBoundsEnd = WindowUtils.getDisplayBounds(flicker.scenario.endRotation)

    @Before
    open fun before() {
        Assume.assumeFalse(isShellTransitionsEnabled)
    }

    override val transition: FlickerBuilder.() -> Unit
        get() = buildTransition {
            setup {
@@ -80,11 +71,6 @@ open class PipRotationTest(flicker: FlickerTest) : PipTransition(flicker) {
            transitions { setRotation(flicker.scenario.endRotation) }
        }

    /** Checks the position of the navigation bar at the start and end of the transition */
    @FlakyTest(bugId = 240499181)
    @Test
    override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()

    /** Checks that [testApp] layer is within [screenBoundsStart] at the start of the transition */
    @Presubmit
    @Test
Loading