Enable passing shell transition tests

- App close: with home / with back
- Launch app: cold / warm / from overview
- Bubbles: expand / launch / dismiss

Bug: 214452854
Bug: 213852103
Bug: 219690120
Bug: 217777115
Bug: 205288792
Fixes: 219693385
Fixes: 219688533
Fixes: 218604389
Test: atest FlickerTests:com.android.server.wm.flicker.close
Change-Id: Ib9b290baac911d42fdc8ac87755fd8df98fdb272
This commit is contained in:
Nataniel Borges
2022-03-28 11:22:59 +02:00
parent acf4d5a89d
commit 786e62ef54
24 changed files with 11 additions and 737 deletions

View File

@@ -28,9 +28,6 @@ import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.runner.RunWith
import org.junit.Test
import org.junit.runners.Parameterized
@@ -52,11 +49,6 @@ open class DismissBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScree
private val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
private val displaySize = DisplayMetrics()
@Before
open fun before() {
Assume.assumeFalse(isShellTransitionsEnabled)
}
override val transition: FlickerBuilder.() -> Unit
get() = buildTransition {
setup {

View File

@@ -1,44 +0,0 @@
/*
* Copyright (C) 2022 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.bubble
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
@RequiresDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@Group4
@FlakyTest(bugId = 217777115)
class DismissBubbleScreenShellTransit(
testSpec: FlickerTestParameter
) : DismissBubbleScreen(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
}

View File

@@ -24,9 +24,6 @@ import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.runner.RunWith
import org.junit.Test
import org.junit.runners.Parameterized
@@ -47,11 +44,6 @@ import org.junit.runners.Parameterized
@Group4
open class ExpandBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
@Before
open fun before() {
Assume.assumeFalse(isShellTransitionsEnabled)
}
override val transition: FlickerBuilder.() -> Unit
get() = buildTransition {
setup {

View File

@@ -1,42 +0,0 @@
/*
* Copyright (C) 2022 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.bubble
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
@RequiresDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@Group4
@FlakyTest(bugId = 217777115)
class ExpandBubbleScreenShellTransit(
testSpec: FlickerTestParameter
) : ExpandBubbleScreen(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
}

View File

@@ -17,15 +17,11 @@
package com.android.wm.shell.flicker.bubble
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
@@ -45,11 +41,6 @@ import org.junit.runners.Parameterized
@Group4
open class LaunchBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
@Before
open fun before() {
Assume.assumeFalse(isShellTransitionsEnabled)
}
override val transition: FlickerBuilder.() -> Unit
get() = buildTransition {
transitions {
@@ -61,16 +52,6 @@ open class LaunchBubbleScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen
@Presubmit
@Test
open fun testAppIsAlwaysVisible() {
Assume.assumeFalse(isShellTransitionsEnabled)
testSpec.assertLayers {
this.isVisible(testApp.component)
}
}
@FlakyTest(bugId = 218642026)
@Test
open fun testAppIsAlwaysVisible_ShellTransit() {
Assume.assumeTrue(isShellTransitionsEnabled)
testSpec.assertLayers {
this.isVisible(testApp.component)
}

View File

@@ -1,42 +0,0 @@
/*
* Copyright (C) 2022 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.bubble
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
@RequiresDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@Group4
@FlakyTest(bugId = 217777115)
class LaunchBubbleScreenShellTransit(
testSpec: FlickerTestParameter
) : LaunchBubbleScreen(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
}

View File

@@ -24,10 +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.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.traces.region.RegionSubject
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -61,11 +58,6 @@ import org.junit.runners.Parameterized
open class MovePipDownShelfHeightChangeTest(
testSpec: FlickerTestParameter
) : MovePipShelfHeightTransition(testSpec) {
@Before
open fun before() {
Assume.assumeFalse(isShellTransitionsEnabled)
}
/**
* Defines the transition used to run the test
*/

View File

@@ -1,64 +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.
*/
package com.android.wm.shell.flicker.pip
import androidx.test.filters.FlakyTest
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group3
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
/**
* Test Pip movement with Launcher shelf height change (decrease).
*
* To run this test: `atest WMShellFlickerTests:MovePipDownShelfHeightChangeTest`
*
* Actions:
* Launch [pipApp] in pip mode
* Launch [testApp]
* Press home
* Check if pip window moves down (visually)
*
* Notes:
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
* are inherited [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)
@Group3
@FlakyTest(bugId = 219693385)
class MovePipDownShelfHeightChangeTest_ShellTransit(
testSpec: FlickerTestParameter
) : MovePipDownShelfHeightChangeTest(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
}

View File

@@ -64,7 +64,6 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group4
@FlakyTest(bugId = 218604389)
open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
private val fixedApp = FixedAppHelper(instrumentation)
private val screenBoundsStart = WindowUtils.getDisplayBounds(testSpec.startRotation)
@@ -138,7 +137,7 @@ open class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testS
*/
@Presubmit
@Test
fun pipLayerRotates_StartingBounds() {
open fun pipLayerRotates_StartingBounds() {
testSpec.assertLayersStart {
visibleRegion(pipApp.component).coversAtMost(screenBoundsStart)
}

View File

@@ -34,10 +34,12 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group4
@FlakyTest(bugId = 217777115)
class PipRotationTestShellTransit(testSpec: FlickerTestParameter) : PipRotationTest(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
@FlakyTest(bugId = 227214914)
override fun pipLayerRotates_StartingBounds() = super.pipLayerRotates_StartingBounds()
}

View File

@@ -28,13 +28,10 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
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
import org.junit.Test
import org.junit.runner.RunWith
@@ -57,11 +54,6 @@ open class SetRequestedOrientationWhilePinnedTest(
private val startingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_0)
private val endingBounds = WindowUtils.getDisplayBounds(Surface.ROTATION_90)
@Before
open fun before() {
Assume.assumeFalse(isShellTransitionsEnabled)
}
override val transition: FlickerBuilder.() -> Unit
get() = {
setup {

View File

@@ -1,49 +0,0 @@
/*
* Copyright (C) 2022 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.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
/**
* Test exiting Pip with orientation changes.
* To run this test: `atest WMShellFlickerTests:SetRequestedOrientationWhilePinnedTestShellTransit`
*/
@RequiresDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group4
@FlakyTest(bugId = 217777115)
class SetRequestedOrientationWhilePinnedTestShellTransit(
testSpec: FlickerTestParameter
) : SetRequestedOrientationWhilePinnedTest(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
}

View File

@@ -17,7 +17,6 @@
package com.android.server.wm.flicker.close
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
@@ -99,38 +98,6 @@ class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.statusBarLayerRotatesScales()
}
/** {@inheritDoc} */
@Presubmit
@Test
override fun launcherLayerReplacesApp() {
// This test doesn't work in shell transitions because of b/206086894
assumeFalse(isShellTransitionsEnabled)
super.launcherLayerReplacesApp()
}
@FlakyTest(bugId = 214452854)
@Test
fun launcherLayerReplacesApp_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.launcherLayerReplacesApp()
}
/** {@inheritDoc} */
@Presubmit
@Test
override fun entireScreenCovered() {
// This test doesn't work in shell transitions because of b/206086894
assumeFalse(isShellTransitionsEnabled)
super.entireScreenCovered()
}
@FlakyTest(bugId = 214452854)
@Test
fun entireScreenCovered_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.entireScreenCovered()
}
companion object {
/**
* Creates the test configurations.

View File

@@ -16,7 +16,6 @@
package com.android.server.wm.flicker.close
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
@@ -98,54 +97,6 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
super.statusBarLayerRotatesScales()
}
/** {@inheritDoc} */
@Presubmit
@Test
override fun launcherLayerReplacesApp() {
// This test doesn't work in shell transitions because of b/206086894
assumeFalse(isShellTransitionsEnabled)
super.launcherLayerReplacesApp()
}
@FlakyTest(bugId = 214452854)
@Test
fun launcherLayerReplacesApp_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.launcherLayerReplacesApp()
}
/** {@inheritDoc} */
@Presubmit
@Test
override fun entireScreenCovered() {
// This test doesn't work in shell transitions because of b/206086894
assumeFalse(isShellTransitionsEnabled)
super.entireScreenCovered()
}
@FlakyTest(bugId = 214452854)
@Test
fun entireScreenCovered_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.entireScreenCovered()
}
/** {@inheritDoc} */
@Presubmit
@Test
override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
// This test doesn't work in shell transitions because of b/215885246
assumeFalse(isShellTransitionsEnabled)
super.visibleLayersShownMoreThanOneConsecutiveEntry()
}
@FlakyTest(bugId = 214452854)
@Test
fun visibleLayersShownMoreThanOneConsecutiveEntry_shellTransit() {
assumeTrue(isShellTransitionsEnabled)
super.visibleLayersShownMoreThanOneConsecutiveEntry()
}
companion object {
/**
* Creates the test configurations.

View File

@@ -24,11 +24,8 @@ import com.android.server.wm.flicker.FlickerTestParameter
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.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.rules.RemoveAllTasksButHomeRule.Companion.removeAllTasksButHome
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -59,11 +56,6 @@ import org.junit.runners.Parameterized
@Group1
open class OpenAppColdTest(testSpec: FlickerTestParameter)
: OpenAppFromLauncherTransition(testSpec) {
@Before
open fun before() {
Assume.assumeFalse(isShellTransitionsEnabled)
}
/**
* Defines the transition used to run the test
*/
@@ -121,7 +113,7 @@ open class OpenAppColdTest(testSpec: FlickerTestParameter)
override fun navBarWindowIsVisible() = super.navBarWindowIsVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 213852103)
@Presubmit
@Test
override fun entireScreenCovered() = super.entireScreenCovered()

View File

@@ -1,60 +0,0 @@
/*
* 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.server.wm.flicker.launch
import androidx.test.filters.FlakyTest
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
/**
* Test cold launching an app from launcher
*
* To run this test: `atest FlickerTests:OpenAppColdTest`
*
* Actions:
* Make sure no apps are running on the device
* Launch an app [testApp] and wait animation to complete
*
* Notes:
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
* are inherited [OpenAppTransition]
* 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)
@Group1
@FlakyTest(bugId = 219688533)
class OpenAppColdTest_ShellTransit(testSpec: FlickerTestParameter) : OpenAppColdTest(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
}

View File

@@ -135,7 +135,7 @@ open class OpenAppFromOverviewTest(testSpec: FlickerTestParameter)
override fun appLayerBecomesVisible() = super.appLayerBecomesVisible_warmStart()
/** {@inheritDoc} */
@FlakyTest(bugId = 218624176)
@Presubmit
@Test
override fun appWindowBecomesVisible() = super.appWindowBecomesVisible_warmStart()

View File

@@ -54,7 +54,6 @@ import org.junit.runners.Parameterized
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group1
@FlakyTest(bugId = 219688533)
class OpenAppFromOverviewTest_ShellTransit(testSpec: FlickerTestParameter)
: OpenAppFromOverviewTest(testSpec) {
@Before
@@ -62,6 +61,11 @@ class OpenAppFromOverviewTest_ShellTransit(testSpec: FlickerTestParameter)
assumeTrue(isShellTransitionsEnabled)
}
/** {@inheritDoc} */
@FlakyTest(bugId = 216266712)
@Test
override fun appWindowBecomesTopWindow() = super.appWindowBecomesTopWindow()
/** {@inheritDoc} */
@FlakyTest(bugId = 216266712)
@Test

View File

@@ -24,10 +24,7 @@ import com.android.server.wm.flicker.FlickerTestParameter
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.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.helpers.setRotation
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -59,11 +56,6 @@ import org.junit.runners.Parameterized
@Group1
open class OpenAppWarmTest(testSpec: FlickerTestParameter)
: OpenAppFromLauncherTransition(testSpec) {
@Before
open fun before() {
Assume.assumeFalse(isShellTransitionsEnabled)
}
/**
* Defines the transition used to run the test
*/

View File

@@ -1,62 +0,0 @@
/*
* 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.server.wm.flicker.launch
import androidx.test.filters.FlakyTest
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
/**
* Test warm launching an app from launcher
*
* To run this test: `atest FlickerTests:OpenAppWarmTest`
*
* Actions:
* Launch [testApp]
* Press home
* Relaunch an app [testApp] and wait animation to complete (only this action is traced)
*
* Notes:
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
* are inherited [OpenAppTransition]
* 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)
@Group1
@FlakyTest(bugId = 219688533)
class OpenAppWarmTest_ShellTransit(testSpec: FlickerTestParameter)
: OpenAppWarmTest(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
}

View File

@@ -33,15 +33,12 @@ 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.WindowUtils
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import com.android.server.wm.flicker.navBarLayerIsVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsVisible
import com.android.server.wm.flicker.statusBarLayerIsVisible
import com.android.server.wm.flicker.statusBarWindowIsVisible
import com.android.server.wm.traces.common.FlickerComponentName
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -73,11 +70,6 @@ open class QuickSwitchBetweenTwoAppsBackTest(private val testSpec: FlickerTestPa
private val startDisplayBounds = WindowUtils.getDisplayBounds(testSpec.startRotation)
@Before
open fun before() {
Assume.assumeFalse(isShellTransitionsEnabled)
}
@FlickerBuilderProvider
fun buildFlicker(): FlickerBuilder {
return FlickerBuilder(instrumentation).apply {

View File

@@ -1,55 +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.
*/
package com.android.server.wm.flicker.quickswitch
import androidx.test.filters.FlakyTest
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
/**
* Test quick switching back to previous app from last opened app
*
* To run this test: `atest FlickerTests:QuickSwitchBetweenTwoAppsBackTest`
*
* Actions:
* Launch an app [testApp1]
* Launch another app [testApp2]
* Swipe right from the bottom of the screen to quick switch back to the first app [testApp1]
*
*/
@RequiresDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group1
@FlakyTest(bugId = 219690120)
class QuickSwitchBetweenTwoAppsBackTest_ShellTransit(testSpec: FlickerTestParameter)
: QuickSwitchBetweenTwoAppsBackTest(testSpec) {
@Before
override fun before() {
Assume.assumeTrue(isShellTransitionsEnabled)
}
}

View File

@@ -32,7 +32,6 @@ import com.android.server.wm.flicker.annotation.Group1
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.flicker.navBarLayerIsVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsVisible
@@ -40,8 +39,6 @@ import com.android.server.wm.flicker.statusBarLayerIsVisible
import com.android.server.wm.flicker.statusBarWindowIsVisible
import com.android.server.wm.traces.common.FlickerComponentName
import com.android.server.wm.traces.common.Rect
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -114,12 +111,6 @@ open class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTes
}
}
@Before
open fun setup() {
// This test doesn't work in shell transitions because of b/213867585
Assume.assumeFalse(isShellTransitionsEnabled)
}
/**
* Checks that the transition starts with [testApp1]'s windows filling/covering exactly the
* entirety of the display.

View File

@@ -1,147 +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.
*/
package com.android.server.wm.flicker.quickswitch
import android.platform.test.annotations.RequiresDevice
import androidx.test.filters.FlakyTest
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume
import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.junit.runners.Parameterized
/**
* Test quick switching back to previous app from last opened app
*
* To run this test: `atest FlickerTests:QuickSwitchBetweenTwoAppsForwardTestShellTransit`
*
* Actions:
* Launch an app [testApp1]
* Launch another app [testApp2]
* Swipe right from the bottom of the screen to quick switch back to the first app [testApp1]
* Swipe left from the bottom of the screen to quick switch forward to the second app [testApp2]
*/
@RequiresDevice
@RunWith(Parameterized::class)
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group1
class QuickSwitchBetweenTwoAppsForwardTestShellTransit(private val testSpec: FlickerTestParameter)
: QuickSwitchBetweenTwoAppsForwardTest(testSpec) {
@Before
override fun setup() {
// This test class should be removed after b/213867585 is fixed.
Assume.assumeTrue(isShellTransitionsEnabled)
}
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun startsWithApp1WindowsCoverFullScreen() =
super.startsWithApp1WindowsCoverFullScreen()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun startsWithApp1LayersCoverFullScreen() = super.startsWithApp1LayersCoverFullScreen()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun startsWithApp1WindowBeingOnTop() = super.startsWithApp1WindowBeingOnTop()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun endsWithApp2WindowsCoveringFullScreen() =
super.endsWithApp2WindowsCoveringFullScreen()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun endsWithApp2LayersCoveringFullScreen() =
super.endsWithApp2LayersCoveringFullScreen()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun endsWithApp2BeingOnTop() = super.endsWithApp2BeingOnTop()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app2WindowBecomesAndStaysVisible() = super.app2WindowBecomesAndStaysVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app2LayerBecomesAndStaysVisible() = super.app2LayerBecomesAndStaysVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app1WindowBecomesAndStaysInvisible() = super.app1WindowBecomesAndStaysInvisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app1LayerBecomesAndStaysInvisible() = super.app1LayerBecomesAndStaysInvisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app2WindowIsVisibleOnceApp1WindowIsInvisible() =
super.app2WindowIsVisibleOnceApp1WindowIsInvisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun app2LayerIsVisibleOnceApp1LayerIsInvisible() =
super.app2LayerIsVisibleOnceApp1LayerIsInvisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun navBarLayerAlwaysIsVisible() = super.navBarLayerAlwaysIsVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun navbarIsAlwaysInRightPosition() = super.navbarIsAlwaysInRightPosition()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
/** {@inheritDoc} */
@FlakyTest(bugId = 214452854)
@Test
override fun statusBarLayerIsAlwaysVisible() = super.statusBarLayerIsAlwaysVisible()
}