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

Commit ebda4611 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Fix PipRotation tests

Bug: 239635724
Test: atest WMShellFlickerTests
Change-Id: I1c2a0596be5ff366a31ff114f40da2648de0ad3d
parent 3c2b619f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

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

import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.RequiresDevice
@@ -88,7 +89,7 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
    /**
     * Checks [pipApp] layer remains visible throughout the animation
     */
    @Presubmit
    @FlakyTest
    @Test
    open fun pipAppLayerAlwaysVisible() {
        testSpec.assertLayers {
+28 −4
Original line number Diff line number Diff line
@@ -106,9 +106,9 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
     */
    @Presubmit
    @Test
    fun appLayerRotates_StartingBounds() {
    fun fixedAppLayer_StartingBounds() {
        testSpec.assertLayersStart {
            visibleRegion(fixedApp).coversExactly(screenBoundsStart)
            visibleRegion(fixedApp).coversAtMost(screenBoundsStart)
        }
    }

@@ -117,9 +117,33 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
     */
    @Presubmit
    @Test
    fun appLayerRotates_EndingBounds() {
    fun fixedAppLayer_EndingBounds() {
        testSpec.assertLayersEnd {
            visibleRegion(fixedApp).coversExactly(screenBoundsEnd)
            visibleRegion(fixedApp).coversAtMost(screenBoundsEnd)
        }
    }

    /**
     * Checks that [fixedApp] plus [pipApp] layers are within [screenBoundsEnd] at the start
     * of the transition
     */
    @Presubmit
    @Test
    fun appLayers_StartingBounds() {
        testSpec.assertLayersStart {
            visibleRegion(fixedApp.or(pipApp)).coversExactly(screenBoundsStart)
        }
    }

    /**
     * Checks that [fixedApp] plus [pipApp] layers are within [screenBoundsEnd] at the end
     * of the transition
     */
    @Presubmit
    @Test
    fun appLayers_EndingBounds() {
        testSpec.assertLayersEnd {
            visibleRegion(fixedApp.or(pipApp)).coversExactly(screenBoundsEnd)
        }
    }