Rename ComponentMatcher to ComponentNameMatcher
We now have a ComponentIdMatcher which means we renamed the ComponentMatcher to ComponentNameMatcher and had to slightly update the IComponentMatcher interface to be more generic. We also updated all places where we actually needed specifically a ComponentNameMatcher rather than just an IComponentMatcher. Test: atest FlickerTests WmShellFlickerTests Bug: 231974873 Change-Id: Ia30c82a9c55665659f530e7428a427763234aeb8
This commit is contained in:
@@ -32,7 +32,6 @@ import com.android.server.wm.flicker.statusBarLayerPositionAtStartAndEnd
|
||||
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.taskBarLayerIsVisibleAtStartAndEnd
|
||||
import com.android.server.wm.flicker.taskBarWindowIsAlwaysVisible
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.Assume
|
||||
import org.junit.Test
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
@file:JvmName("CommonConstants")
|
||||
package com.android.wm.shell.flicker
|
||||
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
|
||||
const val SYSTEM_UI_PACKAGE_NAME = "com.android.systemui"
|
||||
val APP_PAIR_SPLIT_DIVIDER_COMPONENT = ComponentMatcher("", "AppPairSplitDivider#")
|
||||
val DOCKED_STACK_DIVIDER_COMPONENT = ComponentMatcher("", "DockedStackDivider#")
|
||||
val SPLIT_SCREEN_DIVIDER_COMPONENT = ComponentMatcher("", "StageCoordinatorSplitDivider#")
|
||||
val SPLIT_DECOR_MANAGER = ComponentMatcher("", "SplitDecorManager#")
|
||||
val APP_PAIR_SPLIT_DIVIDER_COMPONENT = ComponentNameMatcher("", "AppPairSplitDivider#")
|
||||
val DOCKED_STACK_DIVIDER_COMPONENT = ComponentNameMatcher("", "DockedStackDivider#")
|
||||
val SPLIT_SCREEN_DIVIDER_COMPONENT = ComponentNameMatcher("", "StageCoordinatorSplitDivider#")
|
||||
val SPLIT_DECOR_MANAGER = ComponentNameMatcher("", "SplitDecorManager#")
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
package com.android.wm.shell.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
|
||||
class AppPairsHelper(
|
||||
instrumentation: Instrumentation,
|
||||
activityLabel: String,
|
||||
component: IComponentMatcher
|
||||
component: ComponentNameMatcher
|
||||
) : BaseAppHelper(instrumentation, activityLabel, component)
|
||||
|
||||
@@ -26,13 +26,13 @@ import androidx.test.uiautomator.UiObject2
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.compatibility.common.util.SystemUtil
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.IComponentNameMatcher
|
||||
import java.io.IOException
|
||||
|
||||
abstract class BaseAppHelper(
|
||||
instrumentation: Instrumentation,
|
||||
launcherName: String,
|
||||
component: IComponentMatcher
|
||||
component: IComponentNameMatcher
|
||||
) : StandardAppHelper(
|
||||
instrumentation,
|
||||
launcherName,
|
||||
@@ -46,9 +46,6 @@ abstract class BaseAppHelper(
|
||||
hasSystemFeature(FEATURE_LEANBACK) || hasSystemFeature(FEATURE_LEANBACK_ONLY)
|
||||
}
|
||||
|
||||
val defaultWindowName: String
|
||||
get() = toWindowName()
|
||||
|
||||
val ui: UiObject2?
|
||||
get() = uiDevice.findObject(appSelector)
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ package com.android.wm.shell.flicker.helpers
|
||||
import android.app.Instrumentation
|
||||
import android.content.Context
|
||||
import android.provider.Settings
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
|
||||
class MultiWindowHelper(
|
||||
instrumentation: Instrumentation,
|
||||
activityLabel: String,
|
||||
componentsInfo: IComponentMatcher
|
||||
componentsInfo: ComponentNameMatcher
|
||||
) : BaseAppHelper(instrumentation, activityLabel, componentsInfo) {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -28,6 +28,7 @@ import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.IComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.SPLIT_DECOR_MANAGER
|
||||
@@ -37,8 +38,8 @@ import com.android.wm.shell.flicker.testapp.Components
|
||||
class SplitScreenHelper(
|
||||
instrumentation: Instrumentation,
|
||||
activityLabel: String,
|
||||
componentsInfo: IComponentMatcher
|
||||
) : BaseAppHelper(instrumentation, activityLabel, componentsInfo) {
|
||||
componentInfo: IComponentNameMatcher
|
||||
) : BaseAppHelper(instrumentation, activityLabel, componentInfo) {
|
||||
|
||||
companion object {
|
||||
const val TEST_REPETITIONS = 1
|
||||
@@ -280,12 +281,12 @@ class SplitScreenHelper(
|
||||
fun copyContentFromLeftToRight(
|
||||
instrumentation: Instrumentation,
|
||||
device: UiDevice,
|
||||
sourceApp: IComponentMatcher,
|
||||
destinationApp: IComponentMatcher,
|
||||
sourceApp: IComponentNameMatcher,
|
||||
destinationApp: IComponentNameMatcher,
|
||||
) {
|
||||
// Copy text from sourceApp
|
||||
val textView = device.wait(Until.findObject(
|
||||
By.res(sourceApp.packageNames.firstOrNull(), "SplitScreenTest")), TIMEOUT_MS)
|
||||
By.res(sourceApp.packageName, "SplitScreenTest")), TIMEOUT_MS)
|
||||
longPress(instrumentation, textView.getVisibleCenter())
|
||||
|
||||
val copyBtn = device.wait(Until.findObject(By.text("Copy")), TIMEOUT_MS)
|
||||
@@ -293,7 +294,7 @@ class SplitScreenHelper(
|
||||
|
||||
// Paste text to destinationApp
|
||||
val editText = device.wait(Until.findObject(
|
||||
By.res(destinationApp.packageNames.firstOrNull(), "plain_text_input")), TIMEOUT_MS)
|
||||
By.res(destinationApp.packageName, "plain_text_input")), TIMEOUT_MS)
|
||||
longPress(instrumentation, editText.getVisibleCenter())
|
||||
|
||||
val pasteBtn = device.wait(Until.findObject(By.text("Paste")), TIMEOUT_MS)
|
||||
|
||||
@@ -25,7 +25,7 @@ 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.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -155,9 +155,9 @@ open class EnterPipTest(testSpec: FlickerTestParameter) : PipTransition(testSpec
|
||||
@Test
|
||||
fun launcherLayerBecomesVisible() {
|
||||
testSpec.assertLayers {
|
||||
isInvisible(ComponentMatcher.LAUNCHER)
|
||||
isInvisible(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.LAUNCHER)
|
||||
.isVisible(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtStartAndEnd
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_PORTRAIT
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentMatcher.Companion.LAUNCHER
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher.Companion.LAUNCHER
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@ 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.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -63,9 +63,9 @@ class ExitPipWithSwipeDownTest(testSpec: FlickerTestParameter) : ExitPipTransiti
|
||||
val pipCenterY = pipRegion.centerY()
|
||||
val displayCenterX = device.displayWidth / 2
|
||||
val barComponent = if (testSpec.isTablet) {
|
||||
ComponentMatcher.TASK_BAR
|
||||
ComponentNameMatcher.TASK_BAR
|
||||
} else {
|
||||
ComponentMatcher.NAV_BAR
|
||||
ComponentNameMatcher.NAV_BAR
|
||||
}
|
||||
val barLayerHeight = wmHelper.currentState.layerState
|
||||
.getLayerWithBuffer(barComponent)
|
||||
|
||||
@@ -25,7 +25,7 @@ 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.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -151,7 +151,7 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
|
||||
@Test
|
||||
fun launcherIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
isVisible(ComponentMatcher.LAUNCHER)
|
||||
isVisible(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.wm.shell.flicker.helpers.ImeAppHelper
|
||||
import org.junit.Assume.assumeFalse
|
||||
import org.junit.Before
|
||||
@@ -105,7 +105,7 @@ open class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
@Test
|
||||
open fun pipIsAboveAppWindow() {
|
||||
testSpec.assertWmTag(TAG_IME_VISIBLE) {
|
||||
isAboveWindow(ComponentMatcher.IME, pipApp)
|
||||
isAboveWindow(ComponentNameMatcher.IME, pipApp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.Assume
|
||||
import org.junit.Test
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.android.server.wm.flicker
|
||||
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.traces.region.RegionSubject
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ import com.android.server.wm.traces.common.IComponentMatcher
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarWindowIsAlwaysVisible() {
|
||||
assertWm {
|
||||
this.isAboveAppWindowVisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isAboveAppWindowVisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ fun FlickerTestParameter.statusBarWindowIsAlwaysVisible() {
|
||||
*/
|
||||
fun FlickerTestParameter.navBarWindowIsAlwaysVisible() {
|
||||
assertWm {
|
||||
this.isAboveAppWindowVisible(ComponentMatcher.NAV_BAR)
|
||||
this.isAboveAppWindowVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,10 +48,10 @@ fun FlickerTestParameter.navBarWindowIsAlwaysVisible() {
|
||||
*/
|
||||
fun FlickerTestParameter.navBarWindowIsVisibleAtStartAndEnd() {
|
||||
assertWmStart {
|
||||
this.isAboveAppWindowVisible(ComponentMatcher.NAV_BAR)
|
||||
this.isAboveAppWindowVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
assertWmEnd {
|
||||
this.isAboveAppWindowVisible(ComponentMatcher.NAV_BAR)
|
||||
this.isAboveAppWindowVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ fun FlickerTestParameter.navBarWindowIsVisibleAtStartAndEnd() {
|
||||
*/
|
||||
fun FlickerTestParameter.taskBarWindowIsAlwaysVisible() {
|
||||
assertWm {
|
||||
this.isAboveAppWindowVisible(ComponentMatcher.TASK_BAR)
|
||||
this.isAboveAppWindowVisible(ComponentNameMatcher.TASK_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ fun FlickerTestParameter.taskBarWindowIsAlwaysVisible() {
|
||||
*/
|
||||
fun FlickerTestParameter.taskBarWindowIsVisibleAtEnd() {
|
||||
assertWmEnd {
|
||||
this.isAboveAppWindowVisible(ComponentMatcher.TASK_BAR)
|
||||
this.isAboveAppWindowVisible(ComponentNameMatcher.TASK_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,10 +114,10 @@ fun FlickerTestParameter.entireScreenCovered(allStates: Boolean = true) {
|
||||
*/
|
||||
fun FlickerTestParameter.navBarLayerIsVisibleAtStartAndEnd() {
|
||||
assertLayersStart {
|
||||
this.isVisible(ComponentMatcher.NAV_BAR)
|
||||
this.isVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.NAV_BAR)
|
||||
this.isVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ fun FlickerTestParameter.taskBarLayerIsVisibleAtStartAndEnd() {
|
||||
*/
|
||||
fun FlickerTestParameter.taskBarLayerIsVisibleAtStart() {
|
||||
assertLayersStart {
|
||||
this.isVisible(ComponentMatcher.TASK_BAR)
|
||||
this.isVisible(ComponentNameMatcher.TASK_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ fun FlickerTestParameter.taskBarLayerIsVisibleAtStart() {
|
||||
*/
|
||||
fun FlickerTestParameter.taskBarLayerIsVisibleAtEnd() {
|
||||
assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.TASK_BAR)
|
||||
this.isVisible(ComponentNameMatcher.TASK_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,10 +156,10 @@ fun FlickerTestParameter.taskBarLayerIsVisibleAtEnd() {
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarLayerIsVisibleAtStartAndEnd() {
|
||||
assertLayersStart {
|
||||
this.isVisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isVisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isVisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ fun FlickerTestParameter.navBarLayerPositionAtStart() {
|
||||
assertLayersStart {
|
||||
val display = this.entry.displays.firstOrNull { !it.isVirtual }
|
||||
?: error("There is no display!")
|
||||
this.visibleRegion(ComponentMatcher.NAV_BAR)
|
||||
this.visibleRegion(ComponentNameMatcher.NAV_BAR)
|
||||
.coversExactly(WindowUtils.getNavigationBarPosition(display, isGesturalNavigation))
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,7 @@ fun FlickerTestParameter.navBarLayerPositionAtEnd() {
|
||||
assertLayersEnd {
|
||||
val display = this.entry.displays.minByOrNull { it.id }
|
||||
?: throw RuntimeException("There is no display!")
|
||||
this.visibleRegion(ComponentMatcher.NAV_BAR)
|
||||
this.visibleRegion(ComponentNameMatcher.NAV_BAR)
|
||||
.coversExactly(WindowUtils.getNavigationBarPosition(display, isGesturalNavigation))
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ fun FlickerTestParameter.statusBarLayerPositionAtStart() {
|
||||
assertLayersStart {
|
||||
val display = this.entry.displays.minByOrNull { it.id }
|
||||
?: throw RuntimeException("There is no display!")
|
||||
this.visibleRegion(ComponentMatcher.STATUS_BAR)
|
||||
this.visibleRegion(ComponentNameMatcher.STATUS_BAR)
|
||||
.coversExactly(WindowUtils.getStatusBarPosition(display))
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ fun FlickerTestParameter.statusBarLayerPositionAtEnd() {
|
||||
assertLayersEnd {
|
||||
val display = this.entry.displays.minByOrNull { it.id }
|
||||
?: throw RuntimeException("There is no display!")
|
||||
this.visibleRegion(ComponentMatcher.STATUS_BAR)
|
||||
this.visibleRegion(ComponentNameMatcher.STATUS_BAR)
|
||||
.coversExactly(WindowUtils.getStatusBarPosition(display))
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ fun FlickerTestParameter.snapshotStartingWindowLayerCoversExactlyOnApp(
|
||||
invoke("snapshotStartingWindowLayerCoversExactlyOnApp") {
|
||||
val snapshotLayers = it.subjects.filter { subject ->
|
||||
subject.name.contains(
|
||||
ComponentMatcher.SNAPSHOT.toLayerName()) && subject.isVisible
|
||||
ComponentNameMatcher.SNAPSHOT.toLayerName()) && subject.isVisible
|
||||
}
|
||||
// Verify the size of snapshotRegion covers appVisibleRegion exactly in animation.
|
||||
if (snapshotLayers.isNotEmpty()) {
|
||||
@@ -291,10 +291,10 @@ fun FlickerTestParameter.replacesLayer(
|
||||
val assertion = this.isVisible(originalLayer)
|
||||
|
||||
if (ignoreEntriesWithRotationLayer) {
|
||||
assertion.then().isVisible(ComponentMatcher.ROTATION, isOptional = true)
|
||||
assertion.then().isVisible(ComponentNameMatcher.ROTATION, isOptional = true)
|
||||
}
|
||||
if (ignoreSnapshot) {
|
||||
assertion.then().isVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
assertion.then().isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
}
|
||||
if (ignoreSplashscreen) {
|
||||
assertion.then().isSplashScreenVisibleFor(newLayer, isOptional = true)
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.replacesLayer
|
||||
import com.android.server.wm.traces.common.ComponentMatcher.Companion.LAUNCHER
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher.Companion.LAUNCHER
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@ import androidx.window.extensions.WindowExtensions
|
||||
import androidx.window.extensions.WindowExtensionsProvider
|
||||
import androidx.window.extensions.embedding.ActivityEmbeddingComponent
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.windowmanager.WindowManagerState.Companion.STATE_RESUMED
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
@@ -35,7 +35,7 @@ import org.junit.Assume.assumeNotNull
|
||||
class ActivityEmbeddingAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.ACTIVITY_EMBEDDING_LAUNCHER_NAME,
|
||||
component: IComponentMatcher = MAIN_ACTIVITY_COMPONENT,
|
||||
component: ComponentNameMatcher = MAIN_ACTIVITY_COMPONENT,
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
.launcherStrategy
|
||||
|
||||
@@ -21,12 +21,11 @@ import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.ResolveInfo
|
||||
import android.provider.MediaStore
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
|
||||
class CameraAppHelper @JvmOverloads constructor(
|
||||
instrumentation: Instrumentation,
|
||||
private val pkgManager: PackageManager = instrumentation.context.packageManager
|
||||
instrumentation: Instrumentation,
|
||||
pkgManager: PackageManager = instrumentation.context.packageManager
|
||||
) : StandardAppHelper(instrumentation, getCameraLauncherName(pkgManager),
|
||||
getCameraComponent(pkgManager)){
|
||||
companion object{
|
||||
@@ -40,9 +39,9 @@ class CameraAppHelper @JvmOverloads constructor(
|
||||
?: error("unable to resolve camera activity")
|
||||
}
|
||||
|
||||
private fun getCameraComponent(pkgManager: PackageManager): IComponentMatcher {
|
||||
private fun getCameraComponent(pkgManager: PackageManager): ComponentNameMatcher {
|
||||
val resolveInfo = getResolveInfo(pkgManager)
|
||||
return ComponentMatcher(resolveInfo.activityInfo.packageName,
|
||||
return ComponentNameMatcher(resolveInfo.activityInfo.packageName,
|
||||
className = resolveInfo.activityInfo.name)
|
||||
}
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class FixedOrientationAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.PORTRAIT_ONLY_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.PORTRAIT_ONLY_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.view.WindowInsets.Type.statusBars
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import java.util.regex.Pattern
|
||||
@@ -33,7 +33,7 @@ class ImeAppAutoFocusHelper @JvmOverloads constructor(
|
||||
private val rotation: Int,
|
||||
private val imePackageName: String = IME_PACKAGE,
|
||||
launcherName: String = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent()
|
||||
) : ImeAppHelper(instr, launcherName, component) {
|
||||
override fun openIME(wmHelper: WindowManagerStateHelper) {
|
||||
|
||||
@@ -22,14 +22,14 @@ import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
open class ImeAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.IME_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.IME_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -20,16 +20,14 @@ import android.app.Instrumentation
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
class ImeEditorPopupDialogAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
private val rotation: Int,
|
||||
private val imePackageName: String = IME_PACKAGE,
|
||||
launcherName: String = ActivityOptions.EDITOR_POPUP_DIALOG_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.EDITOR_POPUP_DIALOG_ACTIVITY_COMPONENT_NAME.toFlickerComponent()
|
||||
) : ImeAppHelper(instr, launcherName, component) {
|
||||
override fun openIME(wmHelper: WindowManagerStateHelper) {
|
||||
|
||||
@@ -20,13 +20,13 @@ import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class ImeStateInitializeHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.IME_ACTIVITY_INITIALIZE_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.IME_ACTIVITY_INITIALIZE_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -23,14 +23,14 @@ import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
class NewTasksAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.LAUNCH_NEW_TASK_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.LAUNCH_NEW_TASK_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -20,13 +20,13 @@ import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class NonResizeableAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.NON_RESIZEABLE_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.NON_RESIZEABLE_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -22,14 +22,14 @@ import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
class NotificationAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.NOTIFICATION_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.NOTIFICATION_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -20,13 +20,13 @@ import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class SeamlessRotationAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.SEAMLESS_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.SEAMLESS_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -20,13 +20,13 @@ import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class ShowWhenLockedAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.SHOW_WHEN_LOCKED_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.SHOW_WHEN_LOCKED_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -20,13 +20,13 @@ import android.app.Instrumentation
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class SimpleAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.SIMPLE_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -23,14 +23,14 @@ import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
class TwoActivitiesAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.BUTTON_ACTIVITY_LAUNCHER_NAME,
|
||||
component: IComponentMatcher =
|
||||
component: ComponentNameMatcher =
|
||||
ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -83,7 +83,7 @@ class CloseImeAutoOpenWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(ComponentMatcher.IME)
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class CloseImeAutoOpenWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(ComponentMatcher.IME)
|
||||
this.isInvisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -92,7 +92,7 @@ class CloseImeAutoOpenWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTes
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(ComponentMatcher.IME)
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class CloseImeAutoOpenWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTes
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(ComponentMatcher.IME)
|
||||
this.isInvisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeEditorPopupDialogAppHelper
|
||||
import com.android.server.wm.flicker.traces.region.RegionSubject
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -41,7 +41,7 @@ import org.junit.runners.Parameterized
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group4
|
||||
class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
private val imeTestApp = ImeEditorPopupDialogAppHelper(instrumentation, testSpec.startRotation)
|
||||
private val imeTestApp = ImeEditorPopupDialogAppHelper(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit = {
|
||||
@@ -102,12 +102,12 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
|
||||
@Test
|
||||
fun imeLayerAndImeSnapshotVisibleOnScreen() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(ComponentMatcher.IME)
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.IME_SNAPSHOT)
|
||||
.isVisible(ComponentNameMatcher.IME_SNAPSHOT)
|
||||
.then()
|
||||
.isInvisible(ComponentMatcher.IME_SNAPSHOT, isOptional = true)
|
||||
.isInvisible(ComponentMatcher.IME)
|
||||
.isInvisible(ComponentNameMatcher.IME_SNAPSHOT, isOptional = true)
|
||||
.isInvisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t
|
||||
this.invoke("imeSnapshotAssociatedOnAppVisibleRegion") {
|
||||
val imeSnapshotLayers = it.subjects.filter { subject ->
|
||||
subject.name.contains(
|
||||
ComponentMatcher.IME_SNAPSHOT.toLayerName()
|
||||
ComponentNameMatcher.IME_SNAPSHOT.toLayerName()
|
||||
) && subject.isVisible
|
||||
}
|
||||
if (imeSnapshotLayers.isNotEmpty()) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtStartAndEnd
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -73,9 +73,9 @@ class CloseImeWindowToAppTest(testSpec: FlickerTestParameter) : BaseTest(testSpe
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(
|
||||
ComponentMatcher.IME,
|
||||
ComponentMatcher.SPLASH_SCREEN,
|
||||
ComponentMatcher.SNAPSHOT))
|
||||
ComponentNameMatcher.IME,
|
||||
ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -78,9 +78,9 @@ class CloseImeWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
listOf(
|
||||
ComponentMatcher.IME,
|
||||
ComponentMatcher.SPLASH_SCREEN,
|
||||
ComponentMatcher.SNAPSHOT
|
||||
ComponentNameMatcher.IME,
|
||||
ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -93,8 +93,8 @@ class CloseImeWindowToHomeTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(
|
||||
ComponentMatcher.IME,
|
||||
ComponentMatcher.SPLASH_SCREEN
|
||||
ComponentNameMatcher.IME,
|
||||
ComponentNameMatcher.SPLASH_SCREEN
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -18,52 +18,52 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.isInvisible(ComponentMatcher.IME)
|
||||
this.isInvisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.IME)
|
||||
.isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.isVisible(ComponentMatcher.IME)
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isInvisible(ComponentMatcher.IME)
|
||||
.isInvisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertWm {
|
||||
this.isNonAppWindowVisible(ComponentMatcher.IME)
|
||||
this.isNonAppWindowVisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isNonAppWindowInvisible(ComponentMatcher.IME)
|
||||
.isNonAppWindowInvisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isNonAppWindowVisible(ComponentMatcher.IME)
|
||||
.isNonAppWindowVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
} else {
|
||||
assertWm {
|
||||
this.isNonAppWindowVisible(ComponentMatcher.IME)
|
||||
this.isNonAppWindowVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowBecomesVisible() {
|
||||
assertWm {
|
||||
this.isNonAppWindowInvisible(ComponentMatcher.IME)
|
||||
this.isNonAppWindowInvisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isNonAppWindowVisible(ComponentMatcher.IME)
|
||||
.isNonAppWindowVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowBecomesInvisible() {
|
||||
assertWm {
|
||||
this.isNonAppWindowVisible(ComponentMatcher.IME)
|
||||
this.isNonAppWindowVisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isNonAppWindowInvisible(ComponentMatcher.IME)
|
||||
.isNonAppWindowInvisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -101,7 +101,7 @@ class LaunchAppShowImeAndDialogThemeAppTest(
|
||||
@Test
|
||||
fun imeLayerExistsEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.IME)
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ class LaunchAppShowImeAndDialogThemeAppTest(
|
||||
@Test
|
||||
fun imeSnapshotNotVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(ComponentMatcher.IME_SNAPSHOT)
|
||||
this.isInvisible(ComponentNameMatcher.IME_SNAPSHOT)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.ImeStateInitializeHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -114,7 +114,7 @@ class LaunchAppShowImeOnStartTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun imeLayerNotExistsStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isInvisible(ComponentMatcher.IME)
|
||||
this.isInvisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ class LaunchAppShowImeOnStartTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun imeLayerExistsEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.IME)
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisibleAtStartAndEnd
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisibleAtStartAndEnd
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.WindowManagerConditionsFactory
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.Assume
|
||||
@@ -138,10 +138,10 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
Assume.assumeTrue(testSpec.isGesturalNavigation)
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(ComponentMatcher.NAV_BAR)
|
||||
this.isVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(ComponentMatcher.NAV_BAR)
|
||||
this.isInvisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,10 +156,10 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
Assume.assumeTrue(testSpec.isGesturalNavigation)
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isVisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isInvisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,10 +215,10 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isVisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isInvisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun imeLayerIsVisibleAndAssociatedWithAppWidow() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(ComponentMatcher.IME).visibleRegion(ComponentMatcher.IME)
|
||||
isVisible(ComponentNameMatcher.IME).visibleRegion(ComponentNameMatcher.IME)
|
||||
.coversAtMost(
|
||||
isVisible(imeTestApp)
|
||||
.visibleRegion(imeTestApp).region
|
||||
@@ -243,10 +243,10 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
}
|
||||
testSpec.assertLayers {
|
||||
this.invoke("imeLayerIsVisibleAndAlignAppWidow") {
|
||||
val imeVisibleRegion = it.visibleRegion(ComponentMatcher.IME)
|
||||
val imeVisibleRegion = it.visibleRegion(ComponentNameMatcher.IME)
|
||||
val appVisibleRegion = it.visibleRegion(imeTestApp)
|
||||
if (imeVisibleRegion.region.isNotEmpty) {
|
||||
it.isVisible(ComponentMatcher.IME)
|
||||
it.isVisible(ComponentNameMatcher.IME)
|
||||
imeVisibleRegion.coversAtMost(appVisibleRegion.region)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -84,11 +84,11 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
// depends on how much of the animation transactions are sent to SF at once
|
||||
// sometimes this layer appears for 2-3 frames, sometimes for only 1
|
||||
val recentTaskComponent = ComponentMatcher("", "RecentTaskScreenshotSurface")
|
||||
val recentTaskComponent = ComponentNameMatcher("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(ComponentMatcher.SPLASH_SCREEN,
|
||||
ComponentMatcher.SNAPSHOT, recentTaskComponent)
|
||||
listOf(ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT, recentTaskComponent)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -97,11 +97,11 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Presubmit
|
||||
@Test
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
val component = ComponentMatcher("", "RecentTaskScreenshotSurface")
|
||||
val component = ComponentNameMatcher("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
ignoreWindows = listOf(ComponentMatcher.SPLASH_SCREEN,
|
||||
ComponentMatcher.SNAPSHOT,
|
||||
ignoreWindows = listOf(ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT,
|
||||
component)
|
||||
)
|
||||
}
|
||||
@@ -111,9 +111,9 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Test
|
||||
fun launcherWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(ComponentMatcher.LAUNCHER)
|
||||
this.isAppWindowVisible(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isAppWindowInvisible(ComponentMatcher.LAUNCHER)
|
||||
.isAppWindowInvisible(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,11 +157,11 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
fun imeLayerIsBecomesVisibleLegacy() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(ComponentMatcher.IME)
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isInvisible(ComponentMatcher.IME)
|
||||
.isInvisible(ComponentNameMatcher.IME)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.IME)
|
||||
.isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
fun imeLayerBecomesVisibleShellTransit() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(ComponentMatcher.IME)
|
||||
this.isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,9 +178,9 @@ open class ReOpenImeWindowTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Test
|
||||
fun appLayerReplacesLauncher() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(ComponentMatcher.LAUNCHER)
|
||||
this.isVisible(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -177,20 +177,20 @@ open class SwitchImeWindowsFromGestureNavTest(
|
||||
@Test
|
||||
open fun imeLayerIsVisibleWhenSwitchingToImeApp() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(ComponentMatcher.IME)
|
||||
isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
testSpec.assertLayersTag(TAG_IME_VISIBLE) {
|
||||
isVisible(ComponentMatcher.IME)
|
||||
isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(ComponentMatcher.IME)
|
||||
isVisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun imeLayerIsInvisibleWhenSwitchingToTestApp() {
|
||||
testSpec.assertLayersTag(TAG_IME_INVISIBLE) {
|
||||
isInvisible(ComponentMatcher.IME)
|
||||
isInvisible(ComponentNameMatcher.IME)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ 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
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.TwoActivitiesAppHelper
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -118,7 +118,7 @@ class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Test
|
||||
fun launcherWindowNotOnTop() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowNotOnTop(ComponentMatcher.LAUNCHER)
|
||||
this.isAppWindowNotOnTop(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherLayerNotVisible() {
|
||||
testSpec.assertLayers { this.isInvisible(ComponentMatcher.LAUNCHER) }
|
||||
testSpec.assertLayers { this.isInvisible(ComponentNameMatcher.LAUNCHER) }
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -19,7 +19,7 @@ package com.android.server.wm.flicker.launch
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.replacesLayer
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ abstract class OpenAppFromLauncherTransition(
|
||||
*/
|
||||
open fun appLayerReplacesLauncher() {
|
||||
testSpec.replacesLayer(
|
||||
ComponentMatcher.LAUNCHER, testApp,
|
||||
ComponentNameMatcher.LAUNCHER, testApp,
|
||||
ignoreEntriesWithRotationLayer = true, ignoreSnapshot = true,
|
||||
ignoreSplashscreen = true
|
||||
)
|
||||
@@ -61,12 +61,12 @@ abstract class OpenAppFromLauncherTransition(
|
||||
@Test
|
||||
open fun appWindowReplacesLauncherAsTopWindow() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(ComponentMatcher.LAUNCHER)
|
||||
this.isAppWindowOnTop(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isAppWindowOnTop(
|
||||
testApp
|
||||
.or(ComponentMatcher.SNAPSHOT)
|
||||
.or(ComponentMatcher.SPLASH_SCREEN)
|
||||
.or(ComponentNameMatcher.SNAPSHOT)
|
||||
.or(ComponentNameMatcher.SPLASH_SCREEN)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtEnd
|
||||
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Ignore
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtEnd
|
||||
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Ignore
|
||||
@@ -86,9 +86,9 @@ open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
|
||||
testSpec.assertWm {
|
||||
this.hasNoVisibleAppWindow()
|
||||
.then()
|
||||
.isAppWindowOnTop(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowOnTop(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowOnTop(ComponentMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.isAppWindowOnTop(ComponentNameMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowOnTop(testApp)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ShowWhenLockedAppHelper
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -88,7 +88,7 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet
|
||||
testSpec.assertWm {
|
||||
this.hasNoVisibleAppWindow()
|
||||
.then()
|
||||
.isAppWindowOnTop(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowOnTop(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowOnTop(showWhenLockedApp)
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(showWhenLockedApp)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(showWhenLockedApp)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtEnd
|
||||
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assume
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
@@ -77,9 +77,9 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
|
||||
testSpec.assertWm {
|
||||
this.hasNoVisibleAppWindow()
|
||||
.then()
|
||||
.isAppWindowOnTop(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowOnTop(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowOnTop(ComponentMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.isAppWindowOnTop(ComponentNameMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowOnTop(testApp)
|
||||
}
|
||||
@@ -152,7 +152,7 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
|
||||
@Test
|
||||
fun statusBarLayerIsVisibleAtEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isVisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ 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
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.android.server.wm.flicker.annotation.FlickerServiceCompatible
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Ignore
|
||||
@@ -76,9 +76,9 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) :
|
||||
fun navBarLayerVisibilityChanges() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(ComponentMatcher.NAV_BAR)
|
||||
this.isInvisible(ComponentNameMatcher.NAV_BAR)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.NAV_BAR)
|
||||
.isVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,9 +102,9 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) :
|
||||
fun navBarWindowsVisibilityChanges() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.assertWm {
|
||||
this.isNonAppWindowInvisible(ComponentMatcher.NAV_BAR)
|
||||
this.isNonAppWindowInvisible(ComponentNameMatcher.NAV_BAR)
|
||||
.then()
|
||||
.isAboveAppWindowVisible(ComponentMatcher.NAV_BAR)
|
||||
.isAboveAppWindowVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) :
|
||||
fun taskBarLayerIsVisibleAtEnd() {
|
||||
Assume.assumeTrue(testSpec.isTablet)
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.TASK_BAR)
|
||||
this.isVisible(ComponentNameMatcher.TASK_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) :
|
||||
@Test
|
||||
override fun statusBarLayerIsVisibleAtStartAndEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isVisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) :
|
||||
fun navBarLayerIsVisibleAtEnd() {
|
||||
Assume.assumeFalse(testSpec.isTablet)
|
||||
testSpec.assertLayersEnd {
|
||||
this.isVisible(ComponentMatcher.NAV_BAR)
|
||||
this.isVisible(ComponentNameMatcher.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
@@ -65,9 +65,9 @@ abstract class OpenAppTransition(testSpec: FlickerTestParameter) : BaseTest(test
|
||||
.then()
|
||||
.isInvisible(testApp, isOptional = true)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp)
|
||||
}
|
||||
@@ -77,9 +77,9 @@ abstract class OpenAppTransition(testSpec: FlickerTestParameter) : BaseTest(test
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(testApp)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp)
|
||||
}
|
||||
@@ -110,9 +110,9 @@ abstract class OpenAppTransition(testSpec: FlickerTestParameter) : BaseTest(test
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(testApp)
|
||||
.then()
|
||||
.isAppWindowVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(ComponentMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.SPLASH_SCREEN, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp)
|
||||
}
|
||||
@@ -130,8 +130,8 @@ abstract class OpenAppTransition(testSpec: FlickerTestParameter) : BaseTest(test
|
||||
.then()
|
||||
.isAppWindowOnTop(
|
||||
testApp
|
||||
.or(ComponentMatcher.SNAPSHOT)
|
||||
.or(ComponentMatcher.SPLASH_SCREEN)
|
||||
.or(ComponentNameMatcher.SNAPSHOT)
|
||||
.or(ComponentNameMatcher.SPLASH_SCREEN)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ import com.android.server.wm.flicker.helpers.NewTasksAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions.LAUNCH_NEW_TASK_ACTIVITY_COMPONENT_NAME
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentMatcher.Companion.SPLASH_SCREEN
|
||||
import com.android.server.wm.traces.common.ComponentMatcher.Companion.WALLPAPER_BBQ_WRAPPER
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher.Companion.SPLASH_SCREEN
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher.Companion.WALLPAPER_BBQ_WRAPPER
|
||||
import com.android.server.wm.traces.common.IComponentMatcher
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -117,7 +117,7 @@ class TaskTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
@Test
|
||||
fun launcherWindowIsNeverVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(ComponentMatcher.LAUNCHER)
|
||||
this.isAppWindowInvisible(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class TaskTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
@Test
|
||||
fun launcherLayerIsNeverVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(ComponentMatcher.LAUNCHER)
|
||||
this.isInvisible(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ class TaskTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun colorLayerIsVisibleDuringTransition() {
|
||||
val bgColorLayer = ComponentMatcher("", "colorBackgroundLayer")
|
||||
val bgColorLayer = ComponentNameMatcher("", "colorBackgroundLayer")
|
||||
val displayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
|
||||
testSpec.assertLayers {
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.Rect
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
@@ -178,7 +178,7 @@ open class QuickSwitchBetweenTwoAppsBackTest(
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(testApp1)
|
||||
.then()
|
||||
.isAppWindowVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp1)
|
||||
}
|
||||
@@ -238,9 +238,9 @@ open class QuickSwitchBetweenTwoAppsBackTest(
|
||||
this.isAppWindowVisible(testApp2)
|
||||
.then()
|
||||
// TODO: Do we actually want to test this? Seems too implementation specific...
|
||||
.isAppWindowVisible(ComponentMatcher.LAUNCHER, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.LAUNCHER, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp1)
|
||||
}
|
||||
@@ -257,9 +257,9 @@ open class QuickSwitchBetweenTwoAppsBackTest(
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp2)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.LAUNCHER, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.LAUNCHER, isOptional = true)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp1)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ 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
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.Rect
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
@@ -112,7 +112,7 @@ open class QuickSwitchBetweenTwoAppsForwardTest(
|
||||
@Test
|
||||
open fun startsWithApp1WindowsCoverFullScreen() {
|
||||
testSpec.assertWmStart {
|
||||
this.visibleRegion(testApp1.or(ComponentMatcher.LETTERBOX))
|
||||
this.visibleRegion(testApp1.or(ComponentNameMatcher.LETTERBOX))
|
||||
.coversExactly(startDisplayBounds)
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ open class QuickSwitchBetweenTwoAppsForwardTest(
|
||||
@Test
|
||||
open fun endsWithApp2LayersCoveringFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.visibleRegion(testApp2.or(ComponentMatcher.LETTERBOX))
|
||||
this.visibleRegion(testApp2.or(ComponentNameMatcher.LETTERBOX))
|
||||
.coversExactly(startDisplayBounds)
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,7 @@ open class QuickSwitchBetweenTwoAppsForwardTest(
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(testApp2)
|
||||
.then()
|
||||
.isAppWindowVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp2)
|
||||
}
|
||||
@@ -246,9 +246,9 @@ open class QuickSwitchBetweenTwoAppsForwardTest(
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(testApp1)
|
||||
.then()
|
||||
.isAppWindowVisible(ComponentMatcher.LAUNCHER, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.LAUNCHER, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp2)
|
||||
}
|
||||
@@ -265,9 +265,9 @@ open class QuickSwitchBetweenTwoAppsForwardTest(
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp1)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.LAUNCHER, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.LAUNCHER, isOptional = true)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp2)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ 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
|
||||
|
||||
@@ -30,7 +30,7 @@ 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.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.Rect
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -152,7 +152,7 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun startsWithLauncherWindowsCoverFullScreen() {
|
||||
testSpec.assertWmStart {
|
||||
this.visibleRegion(ComponentMatcher.LAUNCHER).coversExactly(startDisplayBounds)
|
||||
this.visibleRegion(ComponentNameMatcher.LAUNCHER).coversExactly(startDisplayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun startsWithLauncherLayersCoverFullScreen() {
|
||||
testSpec.assertLayersStart {
|
||||
this.visibleRegion(ComponentMatcher.LAUNCHER).coversExactly(startDisplayBounds)
|
||||
this.visibleRegion(ComponentNameMatcher.LAUNCHER).coversExactly(startDisplayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun startsWithLauncherBeingOnTop() {
|
||||
testSpec.assertWmStart {
|
||||
this.isAppWindowOnTop(ComponentMatcher.LAUNCHER)
|
||||
this.isAppWindowOnTop(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,9 +228,9 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun launcherWindowBecomesAndStaysInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(ComponentMatcher.LAUNCHER)
|
||||
this.isAppWindowOnTop(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isAppWindowNotOnTop(ComponentMatcher.LAUNCHER)
|
||||
.isAppWindowNotOnTop(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,9 +243,9 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun launcherLayerBecomesAndStaysInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(ComponentMatcher.LAUNCHER)
|
||||
this.isVisible(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isInvisible(ComponentMatcher.LAUNCHER)
|
||||
.isInvisible(ComponentNameMatcher.LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,9 +258,9 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun appWindowIsVisibleOnceLauncherWindowIsInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(ComponentMatcher.LAUNCHER)
|
||||
this.isAppWindowOnTop(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isAppWindowVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isAppWindowVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp)
|
||||
}
|
||||
@@ -275,9 +275,9 @@ class QuickSwitchFromLauncherTest(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
@Test
|
||||
fun appLayerIsVisibleOnceLauncherLayerIsInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(ComponentMatcher.LAUNCHER)
|
||||
this.isVisible(ComponentNameMatcher.LAUNCHER)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.SNAPSHOT, isOptional = true)
|
||||
.isVisible(ComponentNameMatcher.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ 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.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -106,10 +106,10 @@ class ChangeAppRotationTest(
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp)
|
||||
.then()
|
||||
.isVisible(ComponentMatcher.ROTATION)
|
||||
.isVisible(ComponentNameMatcher.ROTATION)
|
||||
.then()
|
||||
.isVisible(testApp)
|
||||
.isInvisible(ComponentMatcher.ROTATION)
|
||||
.isInvisible(ComponentNameMatcher.ROTATION)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
@@ -55,9 +55,9 @@ abstract class RotationTransition(testSpec: FlickerTestParameter) : BaseTest(tes
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
ignoreLayers = listOf(
|
||||
ComponentMatcher.SPLASH_SCREEN,
|
||||
ComponentMatcher.SNAPSHOT,
|
||||
ComponentMatcher("", "SecondaryHomeHandle")
|
||||
ComponentNameMatcher.SPLASH_SCREEN,
|
||||
ComponentNameMatcher.SNAPSHOT,
|
||||
ComponentNameMatcher("", "SecondaryHomeHandle")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -27,7 +27,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.common.ComponentMatcher
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
@@ -186,7 +186,7 @@ open class SeamlessAppRotationTest(
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAboveAppWindowInvisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isAboveAppWindowInvisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ open class SeamlessAppRotationTest(
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(ComponentMatcher.STATUS_BAR)
|
||||
this.isInvisible(ComponentNameMatcher.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user