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

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

Merge "Promote passing pip tests"

parents 7bf6d1ef 67a01616
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.wm.shell.flicker

import android.app.Instrumentation
import android.platform.test.annotations.Presubmit
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.tapl.LauncherInstrumentation
import com.android.server.wm.flicker.FlickerBuilderProvider
@@ -34,6 +35,7 @@ import com.android.server.wm.flicker.taskBarWindowIsAlwaysVisible
import com.android.server.wm.traces.common.ComponentMatcher
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import org.junit.Assume
import org.junit.Test

/**
 * Base test class containing common assertions for [ComponentMatcher.NAV_BAR],
@@ -80,6 +82,8 @@ abstract class BaseTest @JvmOverloads constructor(
    /**
     * Checks that the [ComponentMatcher.NAV_BAR] layer is visible during the whole transition
     */
    @Presubmit
    @Test
    open fun navBarLayerIsVisibleAtStartAndEnd() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.navBarLayerIsVisibleAtStartAndEnd()
@@ -88,6 +92,8 @@ abstract class BaseTest @JvmOverloads constructor(
    /**
     * Checks the position of the [ComponentMatcher.NAV_BAR] at the start and end of the transition
     */
    @Presubmit
    @Test
    open fun navBarLayerPositionAtStartAndEnd() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.navBarLayerPositionAtStartAndEnd()
@@ -98,6 +104,8 @@ abstract class BaseTest @JvmOverloads constructor(
     *
     * Note: Phones only
     */
    @Presubmit
    @Test
    open fun navBarWindowIsAlwaysVisible() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.navBarWindowIsAlwaysVisible()
@@ -106,6 +114,8 @@ abstract class BaseTest @JvmOverloads constructor(
    /**
     * Checks that the [ComponentMatcher.TASK_BAR] layer is visible during the whole transition
     */
    @Presubmit
    @Test
    open fun taskBarLayerIsVisibleAtStartAndEnd() {
        Assume.assumeTrue(testSpec.isTablet)
        testSpec.taskBarLayerIsVisibleAtStartAndEnd()
@@ -116,6 +126,8 @@ abstract class BaseTest @JvmOverloads constructor(
     *
     * Note: Large screen only
     */
    @Presubmit
    @Test
    open fun taskBarWindowIsAlwaysVisible() {
        Assume.assumeTrue(testSpec.isTablet)
        testSpec.taskBarWindowIsAlwaysVisible()
@@ -124,25 +136,31 @@ abstract class BaseTest @JvmOverloads constructor(
    /**
     * Checks that the [ComponentMatcher.STATUS_BAR] layer is visible during the whole transition
     */
    @Presubmit
    @Test
    open fun statusBarLayerIsVisibleAtStartAndEnd() =
        testSpec.statusBarLayerIsVisibleAtStartAndEnd()

    /**
     * Checks the position of the [ComponentMatcher.STATUS_BAR] at the start and end of the transition
     */
    @Presubmit
    @Test
    open fun statusBarLayerPositionAtStartAndEnd() = testSpec.statusBarLayerPositionAtStartAndEnd()

    /**
     * Checks that the [ComponentMatcher.STATUS_BAR] window is visible during the whole transition
     */
    open fun statusBarWindowIsAlwaysVisible() {
        testSpec.statusBarWindowIsAlwaysVisible()
    }
    @Presubmit
    @Test
    open fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsAlwaysVisible()

    /**
     * Checks that all layers that are visible on the trace, are visible for at least 2
     * consecutive entries.
     */
    @Presubmit
    @Test
    open fun visibleLayersShownMoreThanOneConsecutiveEntry() {
        testSpec.assertLayers {
            this.visibleLayersShownMoreThanOneConsecutiveEntry()
@@ -153,6 +171,8 @@ abstract class BaseTest @JvmOverloads constructor(
     * Checks that all windows that are visible on the trace, are visible for at least 2
     * consecutive entries.
     */
    @Presubmit
    @Test
    open fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
        testSpec.assertWm {
            this.visibleWindowsShownMoreThanOneConsecutiveEntry()
+27 −0
Original line number Diff line number Diff line
@@ -16,13 +16,18 @@

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

import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
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.annotation.Group3
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
@@ -72,6 +77,8 @@ class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest
            }
        }

    @Postsubmit
    @Test
    override fun pipAppLayerAlwaysVisible() {
        if (!testSpec.isGesturalNavigation) super.pipAppLayerAlwaysVisible() else {
            // pip layer in gesture nav will disappear during transition
@@ -83,18 +90,38 @@ class EnterPipOnUserLeaveHintTest(testSpec: FlickerTestParameter) : EnterPipTest
        }
    }

    @Postsubmit
    @Test
    override fun pipLayerReduces() {
        // in gestural nav the pip enters through alpha animation
        Assume.assumeFalse(testSpec.isGesturalNavigation)
        super.pipLayerReduces()
    }

    @Postsubmit
    @Test
    override fun focusChanges() {
        // in gestural nav the focus goes to different activity on swipe up
        Assume.assumeFalse(testSpec.isGesturalNavigation)
        super.focusChanges()
    }

    @Presubmit
    @Test
    override fun entireScreenCovered() {
        Assume.assumeFalse(isShellTransitionsEnabled)
        super.entireScreenCovered()
    }

    @FlakyTest(bugId = 227313015)
    @Test
    fun entireScreenCovered_ShellTransit() {
        Assume.assumeTrue(isShellTransitionsEnabled)
        super.entireScreenCovered()
    }

    @Postsubmit
    @Test
    override fun pipLayerRemainInsideVisibleBounds() {
        if (!testSpec.isGesturalNavigation) super.pipLayerRemainInsideVisibleBounds() else {
            // pip layer in gesture nav will disappear during transition
+0 −60
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

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

import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.RequiresDevice
@@ -173,65 +172,6 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
        }
    }

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun entireScreenCovered() = super.entireScreenCovered()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarLayerIsVisibleAtStartAndEnd() =
        super.statusBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarLayerPositionAtStartAndEnd() =
        super.statusBarLayerPositionAtStartAndEnd()

    companion object {
        /**
         * Creates the test configurations.
+1 −44
Original line number Diff line number Diff line
@@ -224,12 +224,6 @@ class EnterPipToOtherOrientationTest(
        }
    }

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
@@ -237,47 +231,10 @@ class EnterPipToOtherOrientationTest(
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @FlakyTest(bugId = 197726599)
    @FlakyTest(bugId = 227313015)
    @Test
    override fun entireScreenCovered() = super.entireScreenCovered()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarLayerIsVisibleAtStartAndEnd() =
        super.statusBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarLayerPositionAtStartAndEnd() =
        super.statusBarLayerPositionAtStartAndEnd()

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

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

import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.wm.shell.flicker.helpers.FixedAppHelper
@@ -129,61 +128,7 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans
    }

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
        super.visibleLayersShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @Postsubmit
    @Presubmit
    @Test
    override fun entireScreenCovered() = super.entireScreenCovered()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarLayerIsVisibleAtStartAndEnd() =
        super.statusBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun navBarLayerIsVisibleAtStartAndEnd() = super.navBarLayerIsVisibleAtStartAndEnd()

    /** {@inheritDoc}  */
    @Postsubmit
    @Test
    override fun statusBarLayerPositionAtStartAndEnd() =
        super.statusBarLayerPositionAtStartAndEnd()
}
Loading