Merge "Fix nav bar window visibility check on quick switch"

This commit is contained in:
Nataniel Borges
2022-08-17 09:47:01 +00:00
committed by Android (Google) Code Review
5 changed files with 92 additions and 0 deletions

View File

@@ -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

View File

@@ -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()
}
}

View File

@@ -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()
}
}

View File

@@ -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()
}
}

View File

@@ -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