3/ Update flicker tests to compatibilize with new apps
Test: atest FlickerLibTest && atest FlickerTests Change-Id: I9306a2a3905026a5eee53c8ae6f0aa0f87bc42c9
This commit is contained in:
@@ -48,6 +48,6 @@ android_test {
|
||||
"wm-flicker-common-assertions",
|
||||
"wm-flicker-common-app-helpers",
|
||||
"platform-test-annotations",
|
||||
"wmshell-flicker-test-components",
|
||||
"flickertestapplib",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
|
||||
<option name="cleanup-apks" value="true"/>
|
||||
<option name="test-file-name" value="WMShellFlickerTests.apk"/>
|
||||
<option name="test-file-name" value="WMShellFlickerTestApp.apk" />
|
||||
<option name="test-file-name" value="FlickerTestApp.apk" />
|
||||
</target_preparer>
|
||||
<test class="com.android.tradefed.testtype.AndroidJUnitTest">
|
||||
<option name="package" value="com.android.wm.shell.flicker"/>
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.bubble
|
||||
import android.app.INotificationManager
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.ServiceManager
|
||||
import android.view.Surface
|
||||
import androidx.test.uiautomator.By
|
||||
@@ -28,9 +29,9 @@ import com.android.server.wm.flicker.Flicker
|
||||
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.LaunchBubbleHelper
|
||||
import com.android.server.wm.flicker.helpers.SYSTEMUI_PACKAGE
|
||||
import com.android.wm.shell.flicker.BaseTest
|
||||
import com.android.wm.shell.flicker.helpers.LaunchBubbleHelper
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
@@ -47,7 +48,7 @@ abstract class BaseBubbleScreen(
|
||||
ServiceManager.getService(Context.NOTIFICATION_SERVICE))
|
||||
|
||||
private val uid = context.packageManager.getApplicationInfo(
|
||||
testApp.`package`, 0).uid
|
||||
testApp.`package`, PackageManager.ApplicationInfoFlags.of(0)).uid
|
||||
|
||||
@JvmOverloads
|
||||
protected open fun buildTransition(
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("CommonAssertions")
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
internal const val PIP_WINDOW_COMPONENT = "PipMenuActivity"
|
||||
@@ -28,16 +28,17 @@ 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.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.navBarLayerPositionAtStartAndEnd
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions.Pip.ACTION_ENTER_PIP
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions.PortraitOnlyActivity.EXTRA_FIXED_ORIENTATION
|
||||
import com.android.server.wm.traces.common.ComponentNameMatcher
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_PORTRAIT
|
||||
import com.android.wm.shell.flicker.testapp.Components.FixedActivity.EXTRA_FIXED_ORIENTATION
|
||||
import com.android.wm.shell.flicker.testapp.Components.PipActivity.ACTION_ENTER_PIP
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -72,7 +73,7 @@ import org.junit.runners.Parameterized
|
||||
class EnterPipToOtherOrientationTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : PipTransition(testSpec) {
|
||||
private val testApp = FixedAppHelper(instrumentation)
|
||||
private val testApp = FixedOrientationAppHelper(instrumentation)
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_90)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_0)
|
||||
|
||||
@@ -127,7 +128,7 @@ class EnterPipToOtherOrientationTest(
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.NAV_BAR] has the correct position at
|
||||
* Checks that the [ComponentNameMatcher.NAV_BAR] has the correct position at
|
||||
* the start and end of the transition
|
||||
*/
|
||||
@FlakyTest
|
||||
|
||||
@@ -18,14 +18,14 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Base class for pip expand tests
|
||||
*/
|
||||
abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
protected val testApp = FixedAppHelper(instrumentation)
|
||||
protected val testApp = FixedOrientationAppHelper(instrumentation)
|
||||
|
||||
/**
|
||||
* Checks that the pip app window remains inside the display bounds throughout the whole
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper
|
||||
import com.android.server.wm.flicker.traces.region.RegionSubject
|
||||
import com.android.wm.shell.flicker.Direction
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ import org.junit.Test
|
||||
abstract class MovePipShelfHeightTransition(
|
||||
testSpec: FlickerTestParameter
|
||||
) : PipTransition(testSpec) {
|
||||
protected val testApp = FixedAppHelper(instrumentation)
|
||||
protected val testApp = FixedOrientationAppHelper(instrumentation)
|
||||
|
||||
/**
|
||||
* Checks [pipApp] window remains visible throughout the animation
|
||||
|
||||
@@ -24,11 +24,11 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.ImeAppHelper
|
||||
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.ComponentNameMatcher
|
||||
import com.android.wm.shell.flicker.helpers.ImeAppHelper
|
||||
import org.junit.Assume.assumeFalse
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
|
||||
@@ -25,10 +25,10 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
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.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -62,7 +62,7 @@ import org.junit.runners.Parameterized
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group4
|
||||
open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
private val fixedApp = FixedAppHelper(instrumentation)
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
private val screenBoundsStart = WindowUtils.getDisplayBounds(testSpec.startRotation)
|
||||
private val screenBoundsEnd = WindowUtils.getDisplayBounds(testSpec.endRotation)
|
||||
|
||||
@@ -74,7 +74,7 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition {
|
||||
setup {
|
||||
fixedApp.launchViaIntent(wmHelper)
|
||||
testApp.launchViaIntent(wmHelper)
|
||||
setRotation(testSpec.startRotation)
|
||||
}
|
||||
transitions {
|
||||
@@ -90,48 +90,48 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks that [fixedApp] layer is within [screenBoundsStart] at the start of the transition
|
||||
* Checks that [testApp] layer is within [screenBoundsStart] at the start of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun fixedAppLayer_StartingBounds() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(fixedApp).coversAtMost(screenBoundsStart)
|
||||
visibleRegion(testApp).coversAtMost(screenBoundsStart)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [fixedApp] layer is within [screenBoundsEnd] at the end of the transition
|
||||
* Checks that [testApp] layer is within [screenBoundsEnd] at the end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun fixedAppLayer_EndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(fixedApp).coversAtMost(screenBoundsEnd)
|
||||
visibleRegion(testApp).coversAtMost(screenBoundsEnd)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [fixedApp] plus [pipApp] layers are within [screenBoundsEnd] at the start
|
||||
* Checks that [testApp] plus [pipApp] layers are within [screenBoundsEnd] at the start
|
||||
* of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayers_StartingBounds() {
|
||||
testSpec.assertLayersStart {
|
||||
visibleRegion(fixedApp.or(pipApp)).coversExactly(screenBoundsStart)
|
||||
visibleRegion(testApp.or(pipApp)).coversExactly(screenBoundsStart)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [fixedApp] plus [pipApp] layers are within [screenBoundsEnd] at the end
|
||||
* Checks that [testApp] plus [pipApp] layers are within [screenBoundsEnd] at the end
|
||||
* of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayers_EndingBounds() {
|
||||
testSpec.assertLayersEnd {
|
||||
visibleRegion(fixedApp.or(pipApp)).coversExactly(screenBoundsEnd)
|
||||
visibleRegion(testApp.or(pipApp)).coversExactly(screenBoundsEnd)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,26 +165,26 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the [pipApp] window does not obscure the [fixedApp] at the start of the
|
||||
* Ensure that the [pipApp] window does not obscure the [testApp] at the start of the
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipIsAboveFixedAppWindow_Start() {
|
||||
testSpec.assertWmStart {
|
||||
isAboveWindow(pipApp, fixedApp)
|
||||
isAboveWindow(pipApp, testApp)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the [pipApp] window does not obscure the [fixedApp] at the end of the
|
||||
* Ensure that the [pipApp] window does not obscure the [testApp] at the end of the
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun pipIsAboveFixedAppWindow_End() {
|
||||
testSpec.assertWmEnd {
|
||||
isAboveWindow(pipApp, fixedApp)
|
||||
isAboveWindow(pipApp, testApp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@ import android.content.Intent
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.PipAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.wm.shell.flicker.BaseTest
|
||||
import com.android.wm.shell.flicker.helpers.PipAppHelper
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
|
||||
abstract class PipTransition(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
protected val pipApp = PipAppHelper(instrumentation)
|
||||
@@ -61,11 +61,11 @@ abstract class PipTransition(testSpec: FlickerTestParameter) : BaseTest(testSpec
|
||||
*
|
||||
* @param eachRun If the pip app should be launched in each run (otherwise only 1x per test)
|
||||
* @param stringExtras Arguments to pass to the PIP launch intent
|
||||
* @param extraSpec Addicional segment of flicker specification
|
||||
* @param extraSpec Additional segment of flicker specification
|
||||
*/
|
||||
@JvmOverloads
|
||||
protected open fun buildTransition(
|
||||
stringExtras: Map<String, String> = mapOf(Components.PipActivity.EXTRA_ENTER_PIP to "true"),
|
||||
stringExtras: Map<String, String> = mapOf(ActivityOptions.Pip.EXTRA_ENTER_PIP to "true"),
|
||||
extraSpec: FlickerBuilder.() -> Unit = {}
|
||||
): FlickerBuilder.() -> Unit {
|
||||
return {
|
||||
|
||||
@@ -31,9 +31,9 @@ import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions.PortraitOnlyActivity.EXTRA_FIXED_ORIENTATION
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
import com.android.wm.shell.flicker.testapp.Components.FixedActivity.EXTRA_FIXED_ORIENTATION
|
||||
import org.junit.Assume
|
||||
import org.junit.Before
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -68,7 +68,7 @@ open class SetRequestedOrientationWhilePinnedTest(
|
||||
pipApp.launchViaIntent(wmHelper, stringExtras = mapOf(
|
||||
EXTRA_FIXED_ORIENTATION to ORIENTATION_LANDSCAPE.toString()))
|
||||
// Enter PiP.
|
||||
broadcastActionTrigger.doAction(Components.PipActivity.ACTION_ENTER_PIP)
|
||||
broadcastActionTrigger.doAction(ActivityOptions.Pip.ACTION_ENTER_PIP)
|
||||
// System bar may fade out during fixed rotation.
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withPipShown()
|
||||
|
||||
@@ -21,7 +21,6 @@ import android.content.pm.PackageManager
|
||||
import android.view.Surface
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import com.android.wm.shell.flicker.helpers.PipAppHelper
|
||||
import org.junit.Before
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
@@ -38,7 +37,7 @@ abstract class PipTestBase(
|
||||
hasSystemFeature(PackageManager.FEATURE_LEANBACK_ONLY)
|
||||
}
|
||||
}
|
||||
protected val testApp = PipAppHelper(instrumentation)
|
||||
protected val testApp = PipAppHelperTv(instrumentation)
|
||||
|
||||
@Before
|
||||
open fun televisionSetUp() {
|
||||
|
||||
@@ -19,8 +19,8 @@ package com.android.wm.shell.flicker.pip.tv
|
||||
import android.graphics.Rect
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.uiautomator.UiObject2
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.wm.shell.flicker.SYSTEM_UI_PACKAGE_NAME
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
import com.android.wm.shell.flicker.wait
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
@@ -165,44 +165,44 @@ class TvPipMenuTests : TvPipTestBase() {
|
||||
enterPip_openMenu_assertShown()
|
||||
|
||||
// PiP menu should contain "No-Op", "Off" and "Clear" buttons...
|
||||
uiDevice.findTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_NO_OP)
|
||||
uiDevice.findTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_NO_OP)
|
||||
?: fail("\"No-Op\" button should be shown in Pip menu")
|
||||
uiDevice.findTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_OFF)
|
||||
uiDevice.findTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_OFF)
|
||||
?: fail("\"Off\" button should be shown in Pip menu")
|
||||
uiDevice.findTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_CLEAR)
|
||||
uiDevice.findTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_CLEAR)
|
||||
?: fail("\"Clear\" button should be shown in Pip menu")
|
||||
// ... and should also contain the "Full screen" and "Close" buttons.
|
||||
assertFullscreenAndCloseButtonsAreShown()
|
||||
|
||||
uiDevice.clickTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_OFF)
|
||||
uiDevice.clickTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_OFF)
|
||||
// Invoking the "Off" action should replace it with the "On" action/button and should
|
||||
// remove the "No-Op" action/button. "Clear" action/button should remain in the menu ...
|
||||
uiDevice.waitForTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_ON)
|
||||
uiDevice.waitForTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_ON)
|
||||
?: fail("\"On\" button should be shown in Pip for a corresponding custom action")
|
||||
assertNull("\"No-Op\" button should not be shown in Pip menu",
|
||||
uiDevice.findTvPipMenuElementWithDescription(
|
||||
Components.PipActivity.MENU_ACTION_NO_OP))
|
||||
uiDevice.findTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_CLEAR)
|
||||
ActivityOptions.Pip.MENU_ACTION_NO_OP))
|
||||
uiDevice.findTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_CLEAR)
|
||||
?: fail("\"Clear\" button should be shown in Pip menu")
|
||||
// ... as well as the "Full screen" and "Close" buttons.
|
||||
assertFullscreenAndCloseButtonsAreShown()
|
||||
|
||||
uiDevice.clickTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_CLEAR)
|
||||
uiDevice.clickTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_CLEAR)
|
||||
// Invoking the "Clear" action should remove all the custom actions and their corresponding
|
||||
// buttons, ...
|
||||
uiDevice.waitUntilTvPipMenuElementWithDescriptionIsGone(
|
||||
Components.PipActivity.MENU_ACTION_ON)?.also {
|
||||
ActivityOptions.Pip.MENU_ACTION_ON)?.also {
|
||||
isGone -> if (!isGone) fail("\"On\" button should not be shown in Pip menu")
|
||||
}
|
||||
assertNull("\"Off\" button should not be shown in Pip menu",
|
||||
uiDevice.findTvPipMenuElementWithDescription(
|
||||
Components.PipActivity.MENU_ACTION_OFF))
|
||||
ActivityOptions.Pip.MENU_ACTION_OFF))
|
||||
assertNull("\"Clear\" button should not be shown in Pip menu",
|
||||
uiDevice.findTvPipMenuElementWithDescription(
|
||||
Components.PipActivity.MENU_ACTION_CLEAR))
|
||||
ActivityOptions.Pip.MENU_ACTION_CLEAR))
|
||||
assertNull("\"No-Op\" button should not be shown in Pip menu",
|
||||
uiDevice.findTvPipMenuElementWithDescription(
|
||||
Components.PipActivity.MENU_ACTION_NO_OP))
|
||||
ActivityOptions.Pip.MENU_ACTION_NO_OP))
|
||||
// ... but the menu should still contain the "Full screen" and "Close" buttons.
|
||||
assertFullscreenAndCloseButtonsAreShown()
|
||||
|
||||
@@ -217,11 +217,11 @@ class TvPipMenuTests : TvPipTestBase() {
|
||||
enterPip_openMenu_assertShown()
|
||||
|
||||
// PiP menu should contain "No-Op", "Off" and "Clear" buttons for the custom actions...
|
||||
uiDevice.findTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_NO_OP)
|
||||
uiDevice.findTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_NO_OP)
|
||||
?: fail("\"No-Op\" button should be shown in Pip menu")
|
||||
uiDevice.findTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_OFF)
|
||||
uiDevice.findTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_OFF)
|
||||
?: fail("\"Off\" button should be shown in Pip menu")
|
||||
uiDevice.findTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_CLEAR)
|
||||
uiDevice.findTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_CLEAR)
|
||||
?: fail("\"Clear\" button should be shown in Pip menu")
|
||||
// ... should also contain the "Full screen" and "Close" buttons, ...
|
||||
assertFullscreenAndCloseButtonsAreShown()
|
||||
@@ -231,7 +231,7 @@ class TvPipMenuTests : TvPipTestBase() {
|
||||
assertNull("\"Pause\" button should not be shown in menu when there are custom actions",
|
||||
uiDevice.findTvPipMenuElementWithDescription(pauseButtonDescription))
|
||||
|
||||
uiDevice.clickTvPipMenuElementWithDescription(Components.PipActivity.MENU_ACTION_CLEAR)
|
||||
uiDevice.clickTvPipMenuElementWithDescription(ActivityOptions.Pip.MENU_ACTION_CLEAR)
|
||||
// Invoking the "Clear" action should remove all the custom actions, which should bring up
|
||||
// media buttons...
|
||||
uiDevice.waitForTvPipMenuElementWithDescription(pauseButtonDescription)
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowKeepVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerKeepVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsKeepVisible
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -48,16 +47,16 @@ import org.junit.runners.Parameterized
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
class CopyContentInSplit(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
private val textEditApp = SplitScreenHelper.getIme(instrumentation)
|
||||
private val textEditApp = SplitScreenUtils.getIme(instrumentation)
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, textEditApp)
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, primaryApp, textEditApp)
|
||||
}
|
||||
transitions {
|
||||
SplitScreenHelper.copyContentInSplit(
|
||||
SplitScreenUtils.copyContentInSplit(
|
||||
instrumentation, device, primaryApp, textEditApp)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowBecomesInvisible
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesInvisible
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesInvisible
|
||||
@@ -57,14 +56,14 @@ class DismissSplitScreenByDivider (testSpec: FlickerTestParameter) : SplitScreen
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
}
|
||||
transitions {
|
||||
if (tapl.isTablet) {
|
||||
SplitScreenHelper.dragDividerToDismissSplit(device, wmHelper,
|
||||
SplitScreenUtils.dragDividerToDismissSplit(device, wmHelper,
|
||||
dragToRight = false, dragToBottom = true)
|
||||
} else {
|
||||
SplitScreenHelper.dragDividerToDismissSplit(device, wmHelper,
|
||||
SplitScreenUtils.dragDividerToDismissSplit(device, wmHelper,
|
||||
dragToRight = true, dragToBottom = true)
|
||||
}
|
||||
wmHelper.StateSyncBuilder()
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.appWindowBecomesInvisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesInvisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesInvisible
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesInvisible
|
||||
@@ -56,7 +55,7 @@ class DismissSplitScreenByGoHome(
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
}
|
||||
transitions {
|
||||
tapl.goHome()
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowKeepVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerKeepVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsChanges
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -54,10 +53,10 @@ class DragDividerToResize (testSpec: FlickerTestParameter) : SplitScreenBase(tes
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
}
|
||||
transitions {
|
||||
SplitScreenHelper.dragDividerToResizeAndWait(device, wmHelper)
|
||||
SplitScreenUtils.dragDividerToResizeAndWait(device, wmHelper)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisibleByDrag
|
||||
@@ -76,7 +75,7 @@ class EnterSplitScreenByDragFromAllApps(
|
||||
.openAllApps()
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisibleByDrag
|
||||
@@ -60,7 +59,7 @@ class EnterSplitScreenByDragFromNotification(
|
||||
testSpec: FlickerTestParameter
|
||||
) : SplitScreenBase(testSpec) {
|
||||
|
||||
private val sendNotificationApp = SplitScreenHelper.getSendNotification(instrumentation)
|
||||
private val sendNotificationApp = SplitScreenUtils.getSendNotification(instrumentation)
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
@@ -76,7 +75,7 @@ class EnterSplitScreenByDragFromNotification(
|
||||
sendNotificationApp.launchViaIntent(wmHelper)
|
||||
val sendNotification = device.wait(
|
||||
Until.findObject(By.text("Send Notification")),
|
||||
SplitScreenHelper.TIMEOUT_MS
|
||||
SplitScreenUtils.TIMEOUT_MS
|
||||
)
|
||||
sendNotification?.click() ?: error("Send notification button not found")
|
||||
|
||||
@@ -84,8 +83,8 @@ class EnterSplitScreenByDragFromNotification(
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
}
|
||||
transitions {
|
||||
SplitScreenHelper.dragFromNotificationToSplit(instrumentation, device, wmHelper)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, sendNotificationApp)
|
||||
SplitScreenUtils.dragFromNotificationToSplit(instrumentation, device, wmHelper)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, sendNotificationApp)
|
||||
}
|
||||
teardown {
|
||||
sendNotificationApp.exit(wmHelper)
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisibleByDrag
|
||||
@@ -70,7 +69,7 @@ class EnterSplitScreenByDragFromTaskbar(
|
||||
super.transition(this)
|
||||
setup {
|
||||
tapl.goHome()
|
||||
SplitScreenHelper.createShortcutOnHotseatIfNotExist(
|
||||
SplitScreenUtils.createShortcutOnHotseatIfNotExist(
|
||||
tapl, secondaryApp.appName
|
||||
)
|
||||
primaryApp.launchViaIntent(wmHelper)
|
||||
@@ -79,7 +78,7 @@ class EnterSplitScreenByDragFromTaskbar(
|
||||
tapl.launchedAppState.taskbar
|
||||
.getAppIcon(secondaryApp.appName)
|
||||
.dragToSplitscreen(secondaryApp.`package`, primaryApp.`package`)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsBecomesVisible
|
||||
@@ -64,8 +63,8 @@ class EnterSplitScreenFromOverview(testSpec: FlickerTestParameter) : SplitScreen
|
||||
.waitForAndVerify()
|
||||
}
|
||||
transitions {
|
||||
SplitScreenHelper.splitFromOverview(tapl)
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.splitFromOverview(tapl)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,11 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.wm.shell.flicker.BaseTest
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
|
||||
abstract class SplitScreenBase(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
protected val context: Context = instrumentation.context
|
||||
protected val primaryApp = SplitScreenHelper.getPrimary(instrumentation)
|
||||
protected val secondaryApp = SplitScreenHelper.getSecondary(instrumentation)
|
||||
protected val primaryApp = SplitScreenUtils.getPrimary(instrumentation)
|
||||
protected val secondaryApp = SplitScreenUtils.getSecondary(instrumentation)
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
|
||||
@@ -40,7 +40,7 @@ import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.SYSTEM_UI_PACKAGE_NAME
|
||||
|
||||
internal object SplitScreenHelper {
|
||||
internal object SplitScreenUtils {
|
||||
internal const val TIMEOUT_MS = 3_000L
|
||||
private const val DRAG_DURATION_MS = 1_000L
|
||||
private const val NOTIFICATION_SCROLLER = "notification_stack_scroller"
|
||||
@@ -29,7 +29,6 @@ import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.SPLIT_SCREEN_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.layerKeepVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
@@ -55,10 +54,10 @@ class SwitchAppByDoubleTapDivider (testSpec: FlickerTestParameter) : SplitScreen
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
}
|
||||
transitions {
|
||||
SplitScreenHelper.doubleTapDividerToSwitch(device)
|
||||
SplitScreenUtils.doubleTapDividerToSwitch(device)
|
||||
wmHelper.StateSyncBuilder()
|
||||
.withAppTransitionIdle()
|
||||
.waitForAndVerify()
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible
|
||||
@@ -48,13 +47,13 @@ import org.junit.runners.Parameterized
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScreenBase(testSpec) {
|
||||
val thirdApp = SplitScreenHelper.getNonResizeable(instrumentation)
|
||||
val thirdApp = SplitScreenUtils.getNonResizeable(instrumentation)
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
|
||||
thirdApp.launchViaIntent(wmHelper)
|
||||
wmHelper.StateSyncBuilder()
|
||||
@@ -63,7 +62,7 @@ class SwitchBackToSplitFromAnotherApp(testSpec: FlickerTestParameter) : SplitScr
|
||||
}
|
||||
transitions {
|
||||
tapl.launchedAppState.quickSwitchToPreviousApp()
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible
|
||||
@@ -53,7 +52,7 @@ class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBas
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
@@ -62,7 +61,7 @@ class SwitchBackToSplitFromHome(testSpec: FlickerTestParameter) : SplitScreenBas
|
||||
}
|
||||
transitions {
|
||||
tapl.workspace.quickSwitchToPreviousApp()
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.wm.shell.flicker.appWindowBecomesVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import com.android.wm.shell.flicker.layerBecomesVisible
|
||||
import com.android.wm.shell.flicker.splitAppLayerBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.splitScreenDividerBecomesVisible
|
||||
@@ -53,7 +52,7 @@ class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
get() = {
|
||||
super.transition(this)
|
||||
setup {
|
||||
SplitScreenHelper.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.enterSplit(wmHelper, tapl, primaryApp, secondaryApp)
|
||||
|
||||
tapl.goHome()
|
||||
wmHelper.StateSyncBuilder()
|
||||
@@ -64,7 +63,7 @@ class SwitchBackToSplitFromRecent(testSpec: FlickerTestParameter) : SplitScreenB
|
||||
tapl.workspace.switchToOverview()
|
||||
.currentTask
|
||||
.open()
|
||||
SplitScreenHelper.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
SplitScreenUtils.waitForSplitComplete(wmHelper, primaryApp, secondaryApp)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,14 @@ 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.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.Assume
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Base test class containing common assertions for [ComponentMatcher.NAV_BAR],
|
||||
* [ComponentMatcher.TASK_BAR], [ComponentMatcher.STATUS_BAR], and general assertions
|
||||
* Base test class containing common assertions for [ComponentNameMatcher.NAV_BAR],
|
||||
* [ComponentNameMatcher.TASK_BAR], [ComponentNameMatcher.STATUS_BAR], and general assertions
|
||||
* (layers visible in consecutive states, entire screen covered, etc.)
|
||||
*/
|
||||
abstract class BaseTest @JvmOverloads constructor(
|
||||
@@ -72,7 +73,7 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
open fun entireScreenCovered() = testSpec.entireScreenCovered()
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.NAV_BAR] layer is visible during the whole transition
|
||||
* Checks that the [ComponentNameMatcher.NAV_BAR] layer is visible during the whole transition
|
||||
*
|
||||
* Note: Phones only
|
||||
*/
|
||||
@@ -84,7 +85,8 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the position of the [ComponentMatcher.NAV_BAR] at the start and end of the transition
|
||||
* Checks the position of the [ComponentNameMatcher.NAV_BAR] at the start and end of the
|
||||
* transition
|
||||
*
|
||||
* Note: Phones only
|
||||
*/
|
||||
@@ -96,7 +98,7 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.NAV_BAR] window is visible during the whole transition
|
||||
* Checks that the [ComponentNameMatcher.NAV_BAR] window is visible during the whole transition
|
||||
*
|
||||
* Note: Phones only
|
||||
*/
|
||||
@@ -108,8 +110,8 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.TASK_BAR] window is visible at the start and end of the
|
||||
* transition
|
||||
* Checks that the [ComponentNameMatcher.TASK_BAR] window is visible at the start and end of
|
||||
* the transition
|
||||
*
|
||||
* Note: Large screen only
|
||||
*/
|
||||
@@ -121,7 +123,8 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.TASK_BAR] window is visible during the whole transition
|
||||
* Checks that the [ComponentNameMatcher.TASK_BAR] window is visible during the whole
|
||||
* transition
|
||||
*
|
||||
* Note: Large screen only
|
||||
*/
|
||||
@@ -133,7 +136,7 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.STATUS_BAR] layer is visible at the start and end
|
||||
* Checks that the [ComponentNameMatcher.STATUS_BAR] layer is visible at the start and end
|
||||
* of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@@ -142,7 +145,7 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
testSpec.statusBarLayerIsVisibleAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks the position of the [ComponentMatcher.STATUS_BAR] at the start and end of the
|
||||
* Checks the position of the [ComponentNameMatcher.STATUS_BAR] at the start and end of the
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@@ -150,7 +153,8 @@ abstract class BaseTest @JvmOverloads constructor(
|
||||
open fun statusBarLayerPositionAtStartAndEnd() = testSpec.statusBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.STATUS_BAR] window is visible during the whole transition
|
||||
* Checks that the [ComponentNameMatcher.STATUS_BAR] window is visible during the whole
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -83,19 +83,17 @@ class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||
|
||||
/**
|
||||
* Checks that the [ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME] activity is visible at
|
||||
* the start of the transition, that
|
||||
* [ActivityOptions.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME] becomes visible during the
|
||||
* transition, and that [ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME] is again visible
|
||||
* at the end
|
||||
* Checks that the [ActivityOptions.LaunchNewActivity] activity is visible at
|
||||
* the start of the transition, that [ActivityOptions.SimpleActivity] becomes visible during
|
||||
* the transition, and that [ActivityOptions.LaunchNewActivity] is again visible at the end
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun finishSubActivity() {
|
||||
val buttonActivityComponent = ActivityOptions
|
||||
.BUTTON_ACTIVITY_COMPONENT_NAME.toFlickerComponent()
|
||||
val imeAutoFocusActivityComponent = ActivityOptions
|
||||
.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent()
|
||||
val buttonActivityComponent =
|
||||
ActivityOptions.LaunchNewActivity.COMPONENT.toFlickerComponent()
|
||||
val imeAutoFocusActivityComponent =
|
||||
ActivityOptions.SimpleActivity.COMPONENT.toFlickerComponent()
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(buttonActivityComponent)
|
||||
.then()
|
||||
@@ -106,7 +104,7 @@ class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.LAUNCHER] window is not on top. The launcher cannot be
|
||||
* Checks that the [ComponentNameMatcher.LAUNCHER] window is not on top. The launcher cannot be
|
||||
* asserted with `isAppWindowVisible` because it contains 2 windows with the exact same name,
|
||||
* and both are never simultaneously visible
|
||||
*/
|
||||
@@ -119,7 +117,7 @@ class ActivitiesTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSp
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.LAUNCHER] layer is never visible during the transition
|
||||
* Checks that the [ComponentNameMatcher.LAUNCHER] layer is never visible during the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -28,8 +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.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.flicker.testapp.ActivityOptions
|
||||
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
|
||||
@@ -105,7 +104,7 @@ class TaskTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the [ComponentMatcher.LAUNCHER] window is never visible when performing task
|
||||
* Check that the [ComponentNameMatcher.LAUNCHER] window is never visible when performing task
|
||||
* transitions.
|
||||
* A solid color background should be shown above it.
|
||||
*/
|
||||
@@ -118,7 +117,7 @@ class TaskTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.LAUNCHER] layer is never visible when performing task
|
||||
* Checks that the [ComponentNameMatcher.LAUNCHER] layer is never visible when performing task
|
||||
* transitions.
|
||||
* A solid color background should be shown above it.
|
||||
*/
|
||||
@@ -246,8 +245,8 @@ class TaskTransitionTest(testSpec: FlickerTestParameter) : BaseTest(testSpec) {
|
||||
|
||||
companion object {
|
||||
private val LAUNCH_NEW_TASK_ACTIVITY =
|
||||
LAUNCH_NEW_TASK_ACTIVITY_COMPONENT_NAME.toFlickerComponent()
|
||||
private val SIMPLE_ACTIVITY = SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent()
|
||||
ActivityOptions.LaunchNewActivity.COMPONENT.toFlickerComponent()
|
||||
private val SIMPLE_ACTIVITY = ActivityOptions.SimpleActivity.COMPONENT.toFlickerComponent()
|
||||
|
||||
private fun getWallpaperPackage(instrumentation: Instrumentation): IComponentMatcher? {
|
||||
val wallpaperManager = WallpaperManager.getInstance(instrumentation.targetContext)
|
||||
|
||||
@@ -90,7 +90,7 @@ open class SeamlessAppRotationTest(
|
||||
testApp.launchViaIntent(
|
||||
wmHelper,
|
||||
stringExtras = mapOf(
|
||||
ActivityOptions.EXTRA_STARVE_UI_THREAD
|
||||
ActivityOptions.SeamlessRotation.EXTRA_STARVE_UI_THREAD
|
||||
to testSpec.starveUiThread.toString()
|
||||
)
|
||||
)
|
||||
@@ -164,20 +164,23 @@ open class SeamlessAppRotationTest(
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@Ignore("Not applicable to this CUJ. App is full screen")
|
||||
override fun statusBarLayerPositionAtStartAndEnd() { }
|
||||
override fun statusBarLayerPositionAtStartAndEnd() {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@Ignore("Not applicable to this CUJ. App is full screen")
|
||||
override fun statusBarLayerIsVisibleAtStartAndEnd() { }
|
||||
override fun statusBarLayerIsVisibleAtStartAndEnd() {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Test
|
||||
@Ignore("Not applicable to this CUJ. App is full screen")
|
||||
override fun statusBarWindowIsAlwaysVisible() { }
|
||||
override fun statusBarWindowIsAlwaysVisible() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.STATUS_BAR] window is invisible during the whole
|
||||
* Checks that the [ComponentNameMatcher.STATUS_BAR] window is invisible during the whole
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@@ -189,7 +192,7 @@ open class SeamlessAppRotationTest(
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ComponentMatcher.STATUS_BAR] layer is invisible during the whole
|
||||
* Checks that the [ComponentNameMatcher.STATUS_BAR] layer is invisible during the whole
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@@ -218,14 +221,17 @@ open class SeamlessAppRotationTest(
|
||||
|
||||
companion object {
|
||||
private val FlickerTestParameter.starveUiThread
|
||||
get() = config.getOrDefault(ActivityOptions.EXTRA_STARVE_UI_THREAD, false) as Boolean
|
||||
get() = config.getOrDefault(
|
||||
ActivityOptions.SeamlessRotation.EXTRA_STARVE_UI_THREAD, false) as Boolean
|
||||
|
||||
private fun createConfig(
|
||||
sourceConfig: FlickerTestParameter,
|
||||
starveUiThread: Boolean
|
||||
): FlickerTestParameter {
|
||||
val newConfig = sourceConfig.config.toMutableMap()
|
||||
.also { it[ActivityOptions.EXTRA_STARVE_UI_THREAD] = starveUiThread }
|
||||
.also {
|
||||
it[ActivityOptions.SeamlessRotation.EXTRA_STARVE_UI_THREAD] = starveUiThread
|
||||
}
|
||||
val nameExt = if (starveUiThread) "_BUSY_UI_THREAD" else ""
|
||||
return FlickerTestParameter(newConfig, nameOverride = "$sourceConfig$nameExt")
|
||||
}
|
||||
@@ -233,8 +239,8 @@ open class SeamlessAppRotationTest(
|
||||
/**
|
||||
* Creates the test configurations for seamless rotation based on the default rotation
|
||||
* tests from [FlickerTestParameterFactory.getConfigRotationTests], but adding an
|
||||
* additional flag ([ActivityOptions.EXTRA_STARVE_UI_THREAD]) to indicate if the app
|
||||
* should starve the UI thread of not
|
||||
* additional flag ([ActivityOptions.SeamlessRotation.EXTRA_STARVE_UI_THREAD]) to indicate
|
||||
* if the app should starve the UI thread of not
|
||||
*/
|
||||
@JvmStatic
|
||||
private fun getConfigurations(): List<FlickerTestParameter> {
|
||||
|
||||
Reference in New Issue
Block a user