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

Commit 36714cfb authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Fix task bar assertions on tablets when screen is locked

Fixes: 240662437
Test: atest FlickerTests
Change-Id: If80aaccea7b65d9e6eb941e914ca6a7bef2afd5f
parent cc4d221e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -108,7 +108,8 @@ abstract class BaseTest @JvmOverloads constructor(
    }

    /**
     * Checks that the [ComponentMatcher.TASK_BAR] layer is visible during the whole transition
     * Checks that the [ComponentMatcher.TASK_BAR] window is visible at the start and end of the
     * transition
     *
     * Note: Large screen only
     */
@@ -132,7 +133,8 @@ abstract class BaseTest @JvmOverloads constructor(
    }

    /**
     * Checks that the [ComponentMatcher.STATUS_BAR] layer is visible during the whole transition
     * Checks that the [ComponentMatcher.STATUS_BAR] layer is visible at the start and end
     * of the transition
     */
    @Presubmit
    @Test
+26 −0
Original line number Diff line number Diff line
@@ -52,6 +52,16 @@ fun FlickerTestParameter.taskBarWindowIsAlwaysVisible() {
    }
}

/**
 * Checks that [ComponentMatcher.TASK_BAR] window is visible and above the app windows in
 * all WM trace entries
 */
fun FlickerTestParameter.taskBarWindowIsVisibleAtEnd() {
    assertWmEnd {
        this.isAboveAppWindowVisible(ComponentMatcher.TASK_BAR)
    }
}

/**
 * If [allStates] is true, checks if the stack space of all displays is fully covered
 * by any visible layer, during the whole transitions
@@ -103,9 +113,25 @@ fun FlickerTestParameter.navBarLayerIsVisibleAtStartAndEnd() {
 * trace
 */
fun FlickerTestParameter.taskBarLayerIsVisibleAtStartAndEnd() {
    this.taskBarLayerIsVisibleAtStart()
    this.taskBarLayerIsVisibleAtEnd()
}

/**
 * Checks that [ComponentMatcher.TASK_BAR] layer is visible at the start of the SF
 * trace
 */
fun FlickerTestParameter.taskBarLayerIsVisibleAtStart() {
    assertLayersStart {
        this.isVisible(ComponentMatcher.TASK_BAR)
    }
}

/**
 * Checks that [ComponentMatcher.TASK_BAR] layer is visible at the end of the SF
 * trace
 */
fun FlickerTestParameter.taskBarLayerIsVisibleAtEnd() {
    assertLayersEnd {
        this.isVisible(ComponentMatcher.TASK_BAR)
    }
+40 −0
Original line number Diff line number Diff line
@@ -32,8 +32,12 @@ import com.android.server.wm.flicker.helpers.NotificationAppHelper
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.taskBarLayerIsVisibleAtEnd
import com.android.server.wm.flicker.taskBarWindowIsVisibleAtEnd
import com.android.server.wm.traces.common.ComponentMatcher
import org.junit.Assume
import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -231,6 +235,42 @@ open class OpenAppFromNotificationWarm(
        super.appWindowBecomesTopWindow()
    }

    /**
     * Checks that the [ComponentMatcher.TASK_BAR] window is visible at the end of the transition
     *
     * Note: Large screen only
     */
    @Postsubmit
    @Test
    open fun taskBarWindowIsVisibleAtEnd() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.taskBarWindowIsVisibleAtEnd()
    }

    /**
     * Checks that the [ComponentMatcher.TASK_BAR] layer is visible at the end of the transition
     *
     * Note: Large screen only
     */
    @Postsubmit
    @Test
    open fun taskBarLayerIsVisibleAtEnd() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.taskBarLayerIsVisibleAtEnd()
    }

    /** {@inheritDoc} */
    @Test
    @Ignore("Display is locked at the start")
    override fun taskBarWindowIsAlwaysVisible() =
        super.taskBarWindowIsAlwaysVisible()

    /** {@inheritDoc} */
    @Test
    @Ignore("Display is locked at the start")
    override fun taskBarLayerIsVisibleAtStartAndEnd() =
        super.taskBarLayerIsVisibleAtStartAndEnd()

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