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

Commit 406bb953 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Change test to check for primary app bounds instead of layer visibility

* App layer will now always be visible since the layer above it
is visible with corner radius change
* Bounds are a more accurate representation of visibility. If we want
to ensure that the top layer is actually present, we should have another
test to check that the top layer isTranslucent=true

Bug: 436897465
Test: atest WMShellFlickerTestsSplitScreen-DismissSplitScreenByDividerTest
Flag: EXEMPT test
Change-Id: I7469c4ccc919e3bbb5344de42567c4ce43024270
parent cddc3b71
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
@@ -18,9 +18,9 @@ package com.android.wm.shell.flicker.splitscreen

import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import android.tools.flicker.junit.FlickerParametersRunnerFactory
import android.tools.flicker.FlickerBuilder
import android.tools.flicker.FlickerTest
import android.tools.flicker.junit.FlickerParametersRunnerFactory
import android.tools.helpers.WindowUtils
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
@@ -28,9 +28,7 @@ import com.android.wm.shell.flicker.splitscreen.benchmark.DismissSplitScreenByDi
import com.android.wm.shell.flicker.utils.ICommonAssertions
import com.android.wm.shell.flicker.utils.appWindowBecomesInvisible
import com.android.wm.shell.flicker.utils.appWindowIsVisibleAtEnd
import com.android.wm.shell.flicker.utils.layerBecomesInvisible
import com.android.wm.shell.flicker.utils.layerIsVisibleAtEnd
import com.android.wm.shell.flicker.utils.splitAppLayerBoundsBecomesInvisible
import com.android.wm.shell.flicker.utils.splitScreenDividerBecomesInvisible
import org.junit.FixMethodOrder
import org.junit.Test
@@ -61,22 +59,17 @@ class DismissSplitScreenByDividerTest(override val flicker: FlickerTest) :
    @Test
    fun splitScreenDividerBecomesInvisible() = flicker.splitScreenDividerBecomesInvisible()

    @Presubmit
    @Test
    fun primaryAppLayerBecomesInvisible() = flicker.layerBecomesInvisible(primaryApp)

    @Presubmit
    @Test
    fun secondaryAppLayerIsVisibleAtEnd() = flicker.layerIsVisibleAtEnd(secondaryApp)

    @Presubmit
    @Test
    fun primaryAppBoundsBecomesInvisible() =
        flicker.splitAppLayerBoundsBecomesInvisible(
            primaryApp,
            landscapePosLeft = tapl.isTablet,
            portraitPosTop = false
        )
    fun primaryAppBoundsBecomesInvisible() {
        flicker.assertLayersEnd {
            this.visibleRegion(primaryApp).isEmpty()
        }
    }

    @Presubmit
    @Test