Merge "Improve pip test naming"
This commit is contained in:
committed by
Android (Google) Code Review
commit
bdff0f3a9e
@@ -54,7 +54,7 @@ import org.junit.runners.Parameterized
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@FlakyTest(bugId = 238367575)
|
||||
class AutoEnterPipOnGoToHomeTest(flicker: FlickerTest) : EnterPipTest(flicker) {
|
||||
class AutoEnterPipOnGoToHomeTest(flicker: FlickerTest) : EnterPipViaAppUiButtonTest(flicker) {
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
|
||||
@@ -20,10 +20,8 @@ import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -54,7 +52,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class ExitPipWithSwipeDownTest(flicker: FlickerTest) : ExitPipTransition(flicker) {
|
||||
open class ClosePipBySwipingDownTest(flicker: FlickerTest) : ClosePipTransition(flicker) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
@@ -96,20 +94,4 @@ open class ExitPipWithSwipeDownTest(flicker: FlickerTest) : ExitPipTransition(fl
|
||||
fun focusDoesNotChange() {
|
||||
flicker.assertEventLog { this.focusDoesNotChange() }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExitPipViaIntentTestCfArm(flicker: FlickerTest) : ExitPipViaIntentTest(flicker) {
|
||||
class ClosePipBySwipingDownTestCfArm(flicker: FlickerTest) : ClosePipBySwipingDownTest(flicker) {
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
@@ -19,14 +19,16 @@ package com.android.wm.shell.flicker.pip
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher.Companion.LAUNCHER
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Test
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/** Base class for exiting pip (closing pip window) without returning to the app */
|
||||
abstract class ExitPipTransition(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
abstract class ClosePipTransition(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition {
|
||||
setup { this.setRotation(flicker.scenario.startRotation) }
|
||||
@@ -77,4 +79,20 @@ abstract class ExitPipTransition(flicker: FlickerTest) : PipTransition(flicker)
|
||||
.isVisible(LAUNCHER)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,7 @@ import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -54,7 +52,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class ExitPipWithDismissButtonTest(flicker: FlickerTest) : ExitPipTransition(flicker) {
|
||||
open class ClosePipWithDismissButtonTest(flicker: FlickerTest) : ClosePipTransition(flicker) {
|
||||
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
@@ -71,20 +69,4 @@ open class ExitPipWithDismissButtonTest(flicker: FlickerTest) : ExitPipTransitio
|
||||
fun focusChanges() {
|
||||
flicker.assertEventLog { this.focusChanges("PipMenuView", "NexusLauncherActivity") }
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,8 +28,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class ExitPipWithDismissButtonTestCfArm(flicker: FlickerTest) :
|
||||
ExitPipWithDismissButtonTest(flicker) {
|
||||
open class ClosePipWithDismissButtonTestCfArm(flicker: FlickerTest) :
|
||||
ClosePipWithDismissButtonTest(flicker) {
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
@@ -52,7 +52,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTest(flicker) {
|
||||
open class EnterPipOnUserLeaveHintTest(flicker: FlickerTest) : EnterPipTransition(flicker) {
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
|
||||
@@ -67,7 +67,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
open class EnterPipToOtherOrientation(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
private val testApp = FixedOrientationAppHelper(instrumentation)
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_90)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_0)
|
||||
@@ -179,8 +179,7 @@ open class EnterPipToOtherOrientationTest(flicker: FlickerTest) : PipTransition(
|
||||
fun pipAppLayerPlusLetterboxCoversFullScreenOnStartTablet() {
|
||||
Assume.assumeFalse(tapl.isTablet)
|
||||
flicker.assertLayersStart {
|
||||
visibleRegion(pipApp.or(ComponentNameMatcher.LETTERBOX))
|
||||
.coversExactly(startingBounds)
|
||||
visibleRegion(pipApp.or(ComponentNameMatcher.LETTERBOX)).coversExactly(startingBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class EnterPipToOtherOrientationTestCfArm(flicker: FlickerTest) :
|
||||
EnterPipToOtherOrientationTest(flicker) {
|
||||
open class EnterPipToOtherOrientationCfArm(flicker: FlickerTest) :
|
||||
EnterPipToOtherOrientation(flicker) {
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
* Copyright (C) 2023 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.
|
||||
@@ -17,51 +17,20 @@
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test entering pip from an app by interacting with the app UI
|
||||
*
|
||||
* To run this test: `atest WMShellFlickerTests:EnterPipTest`
|
||||
*
|
||||
* Actions:
|
||||
* ```
|
||||
* Launch an app in full screen
|
||||
* Press an "enter pip" button to put [pipApp] in pip mode
|
||||
* ```
|
||||
* Notes:
|
||||
* ```
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited from [PipTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
* ```
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
|
||||
abstract class EnterPipTransition(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
setup { pipApp.launchViaIntent(wmHelper) }
|
||||
teardown { pipApp.exit(wmHelper) }
|
||||
transitions { pipApp.clickEnterPipButton(wmHelper) }
|
||||
}
|
||||
|
||||
/** Checks [pipApp] window remains visible throughout the animation */
|
||||
@@ -101,7 +70,7 @@ open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun pipLayerOrOverlayRemainInsideVisibleBounds() {
|
||||
flicker.assertLayersVisibleRegion(pipApp.or(ComponentNameMatcher.PIP_CONTENT_OVERLAY) ) {
|
||||
flicker.assertLayersVisibleRegion(pipApp.or(ComponentNameMatcher.PIP_CONTENT_OVERLAY)) {
|
||||
coversAtMost(displayBounds)
|
||||
}
|
||||
}
|
||||
@@ -129,7 +98,7 @@ open class EnterPipTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks [ComponentMatcher.LAUNCHER] layer remains visible throughout the animation */
|
||||
/** Checks [ComponentNameMatcher.LAUNCHER] layer remains visible throughout the animation */
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherLayerBecomesVisible() {
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2020 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.
|
||||
*/
|
||||
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test entering pip from an app by interacting with the app UI
|
||||
*
|
||||
* To run this test: `atest WMShellFlickerTests:EnterPipTest`
|
||||
*
|
||||
* Actions:
|
||||
* ```
|
||||
* Launch an app in full screen
|
||||
* Press an "enter pip" button to put [pipApp] in pip mode
|
||||
* ```
|
||||
* Notes:
|
||||
* ```
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited from [PipTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
* ```
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class EnterPipViaAppUiButtonTest(flicker: FlickerTest) : EnterPipTransition(flicker) {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = {
|
||||
super.transition(this)
|
||||
transitions { pipApp.clickEnterPipButton(wmHelper) }
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExitPipWithSwipeDownTestCfArm(flicker: FlickerTest) : ExitPipWithSwipeDownTest(flicker) {
|
||||
class EnterPipViaAppUiButtonTestCfArm(flicker: FlickerTest) : EnterPipViaAppUiButtonTest(flicker) {
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
@@ -18,9 +18,12 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.traces.common.component.matchers.ComponentNameMatcher
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Test
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/** Base class for pip expand tests */
|
||||
abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
@@ -80,7 +83,8 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic
|
||||
isVisible(testApp)
|
||||
.isVisible(pipApp.or(ComponentNameMatcher.TRANSITION_SNAPSHOT))
|
||||
.then()
|
||||
.isInvisible(testApp).isVisible(pipApp)
|
||||
.isInvisible(testApp)
|
||||
.isVisible(pipApp)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,4 +125,20 @@ abstract class ExitPipToAppTransition(flicker: FlickerTest) : PipTransition(flic
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,8 @@ import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -58,7 +56,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class ExitPipViaExpandButtonClickTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) {
|
||||
open class ExitPipToAppViaExpandButtonTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) {
|
||||
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -89,20 +87,4 @@ open class ExitPipViaExpandButtonClickTest(flicker: FlickerTest) : ExitPipToAppT
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
super.pipLayerExpands()
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,8 +28,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExitPipViaExpandButtonClickTestCfArm(flicker: FlickerTest) :
|
||||
ExitPipViaExpandButtonClickTest(flicker) {
|
||||
class ExitPipToAppViaExpandButtonTestCfArm(flicker: FlickerTest) :
|
||||
ExitPipToAppViaExpandButtonTest(flicker) {
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
@@ -21,10 +21,8 @@ import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -57,7 +55,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class ExitPipViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) {
|
||||
open class ExitPipToAppViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(flicker) {
|
||||
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -106,20 +104,4 @@ open class ExitPipViaIntentTest(flicker: FlickerTest) : ExitPipToAppTransition(f
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
super.pipLayerExpands()
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring repetitions, screen orientation
|
||||
* and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class EnterPipTestCfArm(flicker: FlickerTest) : EnterPipTest(flicker) {
|
||||
class ExitPipToAppViaIntentTestCfArm(flicker: FlickerTest) : ExitPipToAppViaIntentTest(flicker) {
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
@@ -31,7 +31,7 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test expanding a pip window by double clicking it
|
||||
* Test expanding a pip window by double-clicking it
|
||||
*
|
||||
* To run this test: `atest WMShellFlickerTests:ExpandPipOnDoubleClickTest`
|
||||
*
|
||||
|
||||
@@ -28,7 +28,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class ExpandPipOnDoubleClickTestCfArm(flicker: FlickerTest) : ExpandPipOnDoubleClickTest(flicker) {
|
||||
class ExpandPipOnDoubleClickTestTestCfArm(flicker: FlickerTest) :
|
||||
ExpandPipOnDoubleClickTest(flicker) {
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
@@ -20,9 +20,7 @@ import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.Direction
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -56,8 +54,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class MovePipDownShelfHeightChangeTest(flicker: FlickerTest) :
|
||||
MovePipShelfHeightTransition(flicker) {
|
||||
class MovePipDownOnShelfHeightChange(flicker: FlickerTest) : MovePipShelfHeightTransition(flicker) {
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
get() = buildTransition {
|
||||
@@ -73,20 +70,4 @@ class MovePipDownShelfHeightChangeTest(flicker: FlickerTest) :
|
||||
|
||||
/** Checks that the visible region of [pipApp] layer always moves down during the animation. */
|
||||
@Presubmit @Test fun pipLayerMovesDown() = pipLayerMoves(Direction.DOWN)
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class PipKeyboardTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
open class MovePipOnImeVisibilityChangeTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
private val imeApp = ImeAppHelper(instrumentation)
|
||||
|
||||
@Before
|
||||
@@ -28,7 +28,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class PipKeyboardTestCfArm(flicker: FlickerTest) : PipKeyboardTest(flicker) {
|
||||
class MovePipOnImeVisibilityChangeTestCfArm(flicker: FlickerTest) :
|
||||
MovePipOnImeVisibilityChangeTest(flicker) {
|
||||
companion object {
|
||||
private const val TAG_IME_VISIBLE = "imeIsVisible"
|
||||
|
||||
@@ -33,7 +33,8 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class PipKeyboardTestShellTransit(flicker: FlickerTest) : PipKeyboardTest(flicker) {
|
||||
class MovePipOnImeVisibilityChangeTestShellTransit(flicker: FlickerTest) :
|
||||
MovePipOnImeVisibilityChangeTest(flicker) {
|
||||
|
||||
@Before
|
||||
override fun before() {
|
||||
@@ -18,10 +18,13 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.helpers.FixedOrientationAppHelper
|
||||
import com.android.server.wm.flicker.traces.region.RegionSubject
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.Direction
|
||||
import org.junit.Test
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/** Base class for pip tests with Launcher shelf height change */
|
||||
abstract class MovePipShelfHeightTransition(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
@@ -103,4 +106,20 @@ abstract class MovePipShelfHeightTransition(flicker: FlickerTest) : PipTransitio
|
||||
regions.zipWithNext { previous, current -> current.isHigherOrEqual(previous.region) }
|
||||
regions.last().isHigher(regions.first())
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,7 @@ import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerBuilder
|
||||
import com.android.server.wm.flicker.FlickerTest
|
||||
import com.android.server.wm.flicker.FlickerTestFactory
|
||||
import com.android.server.wm.flicker.junit.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.traces.common.service.PlatformConsts
|
||||
import com.android.wm.shell.flicker.Direction
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -56,7 +54,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class MovePipUpShelfHeightChangeTest(flicker: FlickerTest) :
|
||||
open class MovePipUpOnShelfHeightChangeTest(flicker: FlickerTest) :
|
||||
MovePipShelfHeightTransition(flicker) {
|
||||
/** Defines the transition used to run the test */
|
||||
override val transition: FlickerBuilder.() -> Unit
|
||||
@@ -72,20 +70,4 @@ open class MovePipUpShelfHeightChangeTest(flicker: FlickerTest) :
|
||||
|
||||
/** Checks that the visible region of [pipApp] layer always moves up during the animation. */
|
||||
@Presubmit @Test fun pipLayerMovesUp() = pipLayerMoves(Direction.UP)
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestFactory.nonRotationTests] for configuring screen orientation and
|
||||
* navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTest> {
|
||||
return FlickerTestFactory.nonRotationTests(
|
||||
supportedRotations = listOf(PlatformConsts.Rotation.ROTATION_0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class SetRequestedOrientationWhilePinnedTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
open class SetRequestedOrientationWhilePinned(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
private val startingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_0)
|
||||
private val endingBounds = WindowUtils.getDisplayBounds(PlatformConsts.Rotation.ROTATION_90)
|
||||
|
||||
@@ -71,9 +71,7 @@ open class SetRequestedOrientationWhilePinnedTest(flicker: FlickerTest) : PipTra
|
||||
.withStatusBarVisible()
|
||||
.waitForAndVerify()
|
||||
}
|
||||
teardown {
|
||||
pipApp.exit(wmHelper)
|
||||
}
|
||||
teardown { pipApp.exit(wmHelper) }
|
||||
transitions {
|
||||
// Launch the activity back into fullscreen and ensure that it is now in landscape
|
||||
pipApp.launchViaIntent(wmHelper)
|
||||
@@ -57,7 +57,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
open class PipRotationTest(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
open class ShowPipAndRotateDisplay(flicker: FlickerTest) : PipTransition(flicker) {
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
private val screenBoundsStart = WindowUtils.getDisplayBounds(flicker.scenario.startRotation)
|
||||
private val screenBoundsEnd = WindowUtils.getDisplayBounds(flicker.scenario.endRotation)
|
||||
@@ -27,7 +27,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
class PipRotationTestCfArm(flicker: FlickerTest) : PipRotationTest(flicker) {
|
||||
class ShowPipAndRotateDisplayCfArm(flicker: FlickerTest) : ShowPipAndRotateDisplay(flicker) {
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
@@ -116,7 +116,6 @@ class CopyContentInSplit(flicker: FlickerTest) : SplitScreenBase(flicker) {
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit @Test override fun entireScreenCovered() = super.entireScreenCovered()
|
||||
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user