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

Commit 4227fe30 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Fix nav bar window visibility check on quick switch

The nav bar becomes invisible during animation. check only start and end now

Fixes: 241917511
Test: atest FlickerTests
Change-Id: I453d7703aec5dcbdec1da71ffb7e7fb4763eb334
parent f3e41e9a
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -42,6 +42,19 @@ fun FlickerTestParameter.navBarWindowIsAlwaysVisible() {
    }
}

/**
 * Checks that [ComponentMatcher.NAV_BAR] window is visible and above the app windows at the start
 * and end of the WM trace
 */
fun FlickerTestParameter.navBarWindowIsVisibleAtStartAndEnd() {
    assertWmStart {
        this.isAboveAppWindowVisible(ComponentMatcher.NAV_BAR)
    }
    assertWmEnd {
        this.isAboveAppWindowVisible(ComponentMatcher.NAV_BAR)
    }
}

/**
 * Checks that [ComponentMatcher.TASK_BAR] window is visible and above the app windows in
 * all WM trace entries
+20 −0
Original line number Diff line number Diff line
@@ -17,14 +17,18 @@
package com.android.server.wm.flicker.ime

import android.platform.test.annotations.FlakyTest
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.Group4
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
import com.android.server.wm.traces.common.ComponentMatcher
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -65,4 +69,20 @@ class SwitchImeWindowsFromGestureNavTest_ShellTransit(
    @Test
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc} */
    @Ignore("Nav bar window becomes invisible during quick switch")
    @Test
    override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()

    /**
     * Checks that [ComponentMatcher.NAV_BAR] window is visible and above the app windows at the start
     * and end of the WM trace
     */
    @Presubmit
    @Test
    fun navBarWindowIsVisibleAtStartAndEnd() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.navBarWindowIsVisibleAtStartAndEnd()
    }
}
+20 −0
Original line number Diff line number Diff line
@@ -17,14 +17,18 @@
package com.android.server.wm.flicker.quickswitch

import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
import com.android.server.wm.traces.common.ComponentMatcher
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -76,4 +80,20 @@ open class QuickSwitchBetweenTwoAppsBackTest_ShellTransit(
    @Test
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc} */
    @Ignore("Nav bar window becomes invisible during quick switch")
    @Test
    override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()

    /**
     * Checks that [ComponentMatcher.NAV_BAR] window is visible and above the app windows at the start
     * and end of the WM trace
     */
    @Presubmit
    @Test
    fun navBarWindowIsVisibleAtStartAndEnd() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.navBarWindowIsVisibleAtStartAndEnd()
    }
}
+20 −0
Original line number Diff line number Diff line
@@ -17,14 +17,18 @@
package com.android.server.wm.flicker.quickswitch

import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
import com.android.server.wm.traces.common.ComponentMatcher
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -66,4 +70,20 @@ open class QuickSwitchBetweenTwoAppsForwardTest_ShellTransit(
    @FlakyTest(bugId = 228009808)
    @Test
    override fun endsWithApp2BeingOnTop() = super.endsWithApp2BeingOnTop()

    /** {@inheritDoc} */
    @Ignore("Nav bar window becomes invisible during quick switch")
    @Test
    override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()

    /**
     * Checks that [ComponentMatcher.NAV_BAR] window is visible and above the app windows at the start
     * and end of the WM trace
     */
    @Presubmit
    @Test
    fun navBarWindowIsVisibleAtStartAndEnd() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.navBarWindowIsVisibleAtStartAndEnd()
    }
}
+19 −0
Original line number Diff line number Diff line
@@ -29,9 +29,12 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.server.wm.flicker.navBarWindowIsVisibleAtStartAndEnd
import com.android.server.wm.traces.common.ComponentMatcher
import com.android.server.wm.traces.common.Rect
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
@@ -296,6 +299,22 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
    override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
        super.visibleWindowsShownMoreThanOneConsecutiveEntry()

    /** {@inheritDoc} */
    @Ignore("Nav bar window becomes invisible during quick switch")
    @Test
    override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()

    /**
     * Checks that [ComponentMatcher.NAV_BAR] window is visible and above the app windows at the start
     * and end of the WM trace
     */
    @Presubmit
    @Test
    fun navBarWindowIsVisibleAtStartAndEnd() {
        Assume.assumeFalse(testSpec.isTablet)
        testSpec.navBarWindowIsVisibleAtStartAndEnd()
    }

    companion object {
        /** {@inheritDoc} */
        private var startDisplayBounds = Rect.EMPTY