Merge "Fix status bar assertions on seamless rotation"

This commit is contained in:
TreeHugger Robot
2021-06-08 12:38:51 +00:00
committed by Android (Google) Code Review
3 changed files with 96 additions and 36 deletions

View File

@@ -25,7 +25,12 @@ import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.Group3
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.endRotation
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.statusBarLayerRotatesScales
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -73,10 +78,23 @@ class ChangeAppRotationTest(
}
}
@Presubmit
@Test
fun statusBarWindowIsAlwaysVisible() {
testSpec.statusBarWindowIsAlwaysVisible()
}
@FlakyTest
@Test
fun statusBarLayerIsAlwaysVisible() {
testSpec.statusBarLayerIsAlwaysVisible(rotatesScreen = true)
}
@Postsubmit
@Test
override fun statusBarLayerRotatesScales() {
super.statusBarLayerRotatesScales()
fun statusBarLayerRotatesScales() {
testSpec.statusBarLayerRotatesScales(
testSpec.config.startRotation, testSpec.config.endRotation)
}
@Presubmit
@@ -87,8 +105,20 @@ class ChangeAppRotationTest(
@FlakyTest
@Test
override fun statusBarLayerIsAlwaysVisible() {
super.statusBarLayerIsAlwaysVisible()
override fun navBarLayerIsAlwaysVisible() {
super.navBarLayerIsAlwaysVisible()
}
@FlakyTest
@Test
override fun navBarLayerRotatesAndScales() {
super.navBarLayerRotatesAndScales()
}
@FlakyTest
@Test
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
super.visibleLayersShownMoreThanOneConsecutiveEntry()
}
companion object {

View File

@@ -18,7 +18,6 @@ package com.android.server.wm.flicker.rotation
import android.app.Instrumentation
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.FlickerBuilderProvider
import com.android.server.wm.flicker.FlickerTestParameter
@@ -33,9 +32,6 @@ import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.noUncoveredRegions
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.statusBarLayerRotatesScales
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import org.junit.Test
@@ -69,19 +65,19 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
}
}
@FlakyTest
@Presubmit
@Test
open fun navBarWindowIsAlwaysVisible() {
testSpec.navBarWindowIsAlwaysVisible()
}
@FlakyTest
@Presubmit
@Test
open fun navBarLayerIsAlwaysVisible() {
testSpec.navBarLayerIsAlwaysVisible(rotatesScreen = true)
}
@FlakyTest
@Presubmit
@Test
open fun navBarLayerRotatesAndScales() {
testSpec.navBarLayerRotatesAndScales(
@@ -90,25 +86,6 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
@Presubmit
@Test
open fun statusBarWindowIsAlwaysVisible() {
testSpec.statusBarWindowIsAlwaysVisible()
}
@FlakyTest
@Test
open fun statusBarLayerIsAlwaysVisible() {
testSpec.statusBarLayerIsAlwaysVisible(rotatesScreen = true)
}
@FlakyTest
@Test
open fun statusBarLayerRotatesScales() {
testSpec.statusBarLayerRotatesScales(
testSpec.config.startRotation, testSpec.config.endRotation)
}
@FlakyTest
@Test
open fun visibleLayersShownMoreThanOneConsecutiveEntry() {
testSpec.assertLayers {
this.visibleLayersShownMoreThanOneConsecutiveEntry(

View File

@@ -18,6 +18,7 @@ package com.android.server.wm.flicker.rotation
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import android.view.WindowManager
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
@@ -27,6 +28,7 @@ import com.android.server.wm.flicker.annotation.Group3
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.SeamlessRotationAppHelper
import com.android.server.wm.flicker.testapp.ActivityOptions
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -60,16 +62,33 @@ class SeamlessAppRotationTest(
}
}
@FlakyTest(bugId = 140855415)
@Postsubmit
@Test
override fun statusBarWindowIsAlwaysVisible() {
super.statusBarWindowIsAlwaysVisible()
fun appWindowFullScreen() {
testSpec.assertWm {
this.invoke("isFullScreen") {
val appWindow = it.windowState(testApp.`package`)
val flags = appWindow.windowState?.attributes?.flags ?: 0
appWindow.verify("isFullScreen")
.that(flags.and(WindowManager.LayoutParams.FLAG_FULLSCREEN))
.isGreaterThan(0)
}
}
}
@FlakyTest(bugId = 140855415)
@Postsubmit
@Test
override fun statusBarLayerIsAlwaysVisible() {
super.statusBarLayerIsAlwaysVisible()
fun appWindowSeamlessRotation() {
testSpec.assertWm {
this.invoke("isRotationSeamless") {
val appWindow = it.windowState(testApp.`package`)
val rotationAnimation = appWindow.windowState?.attributes?.rotationAnimation ?: 0
appWindow.verify("isRotationSeamless")
.that(rotationAnimation
.and(WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS))
.isGreaterThan(0)
}
}
}
@Presubmit
@@ -90,12 +109,46 @@ class SeamlessAppRotationTest(
}
}
@Presubmit
@Test
fun statusBarWindowIsAlwaysInvisible() {
testSpec.assertWm {
this.hidesAboveAppWindow(WindowManagerStateHelper.STATUS_BAR_WINDOW_NAME)
}
}
@Presubmit
@Test
fun statusBarLayerIsAlwaysInvisible() {
testSpec.assertLayers {
this.isInvisible(WindowManagerStateHelper.STATUS_BAR_LAYER_NAME)
}
}
@Postsubmit
@Test
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
super.visibleLayersShownMoreThanOneConsecutiveEntry()
}
@FlakyTest
@Test
override fun navBarWindowIsAlwaysVisible() {
super.navBarWindowIsAlwaysVisible()
}
@FlakyTest
@Test
override fun navBarLayerIsAlwaysVisible() {
super.navBarLayerIsAlwaysVisible()
}
@FlakyTest
@Test
override fun navBarLayerRotatesAndScales() {
super.navBarLayerRotatesAndScales()
}
companion object {
private val testFactory = FlickerTestParameterFactory.getInstance()