Merge "Update OpenImeWindowFromFixedOrientationAppTest (2nd)" into tm-qpr-dev am: f2587d0971
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18715271 Change-Id: I573b07884001d29f284e3c6b54c62de911e16998 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
package com.android.server.wm.flicker
|
package com.android.server.wm.flicker
|
||||||
|
|
||||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||||
|
import com.android.server.wm.flicker.traces.region.RegionSubject
|
||||||
import com.android.server.wm.traces.common.FlickerComponentName
|
import com.android.server.wm.traces.common.FlickerComponentName
|
||||||
|
|
||||||
val LAUNCHER_COMPONENT = FlickerComponentName("com.google.android.apps.nexuslauncher",
|
val LAUNCHER_COMPONENT = FlickerComponentName("com.google.android.apps.nexuslauncher",
|
||||||
@@ -172,6 +173,33 @@ fun FlickerTestParameter.statusBarLayerRotatesScales() {
|
|||||||
statusBarLayerPositionEnd()
|
statusBarLayerPositionEnd()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the visibleRegion of the [FlickerComponentName.SNAPSHOT] layer can cover
|
||||||
|
* the visibleRegion of the given app component exactly
|
||||||
|
*/
|
||||||
|
fun FlickerTestParameter.snapshotStartingWindowLayerCoversExactlyOnApp(
|
||||||
|
component: FlickerComponentName) {
|
||||||
|
assertLayers {
|
||||||
|
invoke("snapshotStartingWindowLayerCoversExactlyOnApp") {
|
||||||
|
val snapshotLayers = it.subjects.filter { subject ->
|
||||||
|
subject.name.contains(
|
||||||
|
FlickerComponentName.SNAPSHOT.toLayerName()) && subject.isVisible
|
||||||
|
}
|
||||||
|
// Verify the size of snapshotRegion covers appVisibleRegion exactly in animation.
|
||||||
|
if (snapshotLayers.isNotEmpty()) {
|
||||||
|
val visibleAreas = snapshotLayers.mapNotNull { snapshotLayer ->
|
||||||
|
snapshotLayer.layer?.visibleRegion
|
||||||
|
}.toTypedArray()
|
||||||
|
val snapshotRegion = RegionSubject.assertThat(visibleAreas, this, timestamp)
|
||||||
|
val appVisibleRegion = it.visibleRegion(component)
|
||||||
|
if (snapshotRegion.region.isNotEmpty) {
|
||||||
|
snapshotRegion.coversExactly(appVisibleRegion.region)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that:
|
* Asserts that:
|
||||||
* [originalLayer] is visible at the start of the trace
|
* [originalLayer] is visible at the start of the trace
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.android.server.wm.flicker.ime
|
package com.android.server.wm.flicker.ime
|
||||||
|
|
||||||
import android.app.Instrumentation
|
import android.app.Instrumentation
|
||||||
|
import android.platform.test.annotations.Postsubmit
|
||||||
import android.platform.test.annotations.Presubmit
|
import android.platform.test.annotations.Presubmit
|
||||||
import android.platform.test.annotations.RequiresDevice
|
import android.platform.test.annotations.RequiresDevice
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
@@ -34,6 +35,7 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
|||||||
import com.android.server.wm.flicker.helpers.setRotation
|
import com.android.server.wm.flicker.helpers.setRotation
|
||||||
import com.android.server.wm.flicker.navBarLayerPositionEnd
|
import com.android.server.wm.flicker.navBarLayerPositionEnd
|
||||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||||
|
import com.android.server.wm.flicker.snapshotStartingWindowLayerCoversExactlyOnApp
|
||||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||||
import org.junit.FixMethodOrder
|
import org.junit.FixMethodOrder
|
||||||
@@ -107,6 +109,12 @@ class OpenImeWindowFromFixedOrientationAppTest(private val testSpec: FlickerTest
|
|||||||
@Test
|
@Test
|
||||||
fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible()
|
fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible()
|
||||||
|
|
||||||
|
@Postsubmit
|
||||||
|
@Test
|
||||||
|
fun snapshotStartingWindowLayerCoversExactlyOnApp() {
|
||||||
|
testSpec.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp.component)
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
/**
|
/**
|
||||||
* Creates the test configurations.
|
* Creates the test configurations.
|
||||||
|
|||||||
Reference in New Issue
Block a user