Merge "Cleanup quick switch shelltransit tests" into udc-dev am: fcfe8c256e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21957088 Change-Id: Iaee2bd3e6ecb7e309b3c2a0670d30713413dcc9f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -16,11 +16,11 @@
|
|||||||
|
|
||||||
package com.android.server.wm.flicker.quickswitch
|
package com.android.server.wm.flicker.quickswitch
|
||||||
|
|
||||||
|
import android.platform.test.annotations.FlakyTest
|
||||||
import android.platform.test.annotations.Presubmit
|
import android.platform.test.annotations.Presubmit
|
||||||
import android.tools.common.NavBar
|
import android.tools.common.NavBar
|
||||||
import android.tools.common.datatypes.Rect
|
import android.tools.common.datatypes.Rect
|
||||||
import android.tools.common.datatypes.component.ComponentNameMatcher
|
import android.tools.common.datatypes.component.ComponentNameMatcher
|
||||||
import android.tools.device.flicker.isShellTransitionsEnabled
|
|
||||||
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
|
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
|
||||||
import android.tools.device.flicker.legacy.FlickerBuilder
|
import android.tools.device.flicker.legacy.FlickerBuilder
|
||||||
import android.tools.device.flicker.legacy.FlickerTest
|
import android.tools.device.flicker.legacy.FlickerTest
|
||||||
@@ -29,9 +29,8 @@ import androidx.test.filters.RequiresDevice
|
|||||||
import com.android.server.wm.flicker.BaseTest
|
import com.android.server.wm.flicker.BaseTest
|
||||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||||
import org.junit.Assume
|
|
||||||
import org.junit.Before
|
|
||||||
import org.junit.FixMethodOrder
|
import org.junit.FixMethodOrder
|
||||||
|
import org.junit.Ignore
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
import org.junit.runners.MethodSorters
|
import org.junit.runners.MethodSorters
|
||||||
@@ -57,11 +56,6 @@ open class QuickSwitchBetweenTwoAppsBackTest(flicker: FlickerTest) : BaseTest(fl
|
|||||||
private val testApp1 = SimpleAppHelper(instrumentation)
|
private val testApp1 = SimpleAppHelper(instrumentation)
|
||||||
private val testApp2 = NonResizeableAppHelper(instrumentation)
|
private val testApp2 = NonResizeableAppHelper(instrumentation)
|
||||||
|
|
||||||
@Before
|
|
||||||
open fun before() {
|
|
||||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
override val transition: FlickerBuilder.() -> Unit = {
|
override val transition: FlickerBuilder.() -> Unit = {
|
||||||
setup {
|
setup {
|
||||||
@@ -102,7 +96,7 @@ open class QuickSwitchBetweenTwoAppsBackTest(flicker: FlickerTest) : BaseTest(fl
|
|||||||
* Checks that the transition starts with [testApp2]'s layers filling/covering exactly the
|
* Checks that the transition starts with [testApp2]'s layers filling/covering exactly the
|
||||||
* entirety of the display.
|
* entirety of the display.
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
@FlakyTest(bugId = 250520840)
|
||||||
@Test
|
@Test
|
||||||
open fun startsWithApp2LayersCoverFullScreen() {
|
open fun startsWithApp2LayersCoverFullScreen() {
|
||||||
flicker.assertLayersStart { this.visibleRegion(testApp2).coversExactly(startDisplayBounds) }
|
flicker.assertLayersStart { this.visibleRegion(testApp2).coversExactly(startDisplayBounds) }
|
||||||
@@ -230,6 +224,20 @@ open class QuickSwitchBetweenTwoAppsBackTest(flicker: FlickerTest) : BaseTest(fl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Ignore("Nav bar window becomes invisible during quick switch")
|
||||||
|
@Test
|
||||||
|
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||||
|
|
||||||
|
@FlakyTest(bugId = 246284708)
|
||||||
|
@Test
|
||||||
|
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||||
|
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||||
|
|
||||||
|
@FlakyTest(bugId = 250518877)
|
||||||
|
@Test
|
||||||
|
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private var startDisplayBounds = Rect.EMPTY
|
private var startDisplayBounds = Rect.EMPTY
|
||||||
|
|
||||||
|
|||||||
@@ -1,74 +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.FlakyTest
|
|
||||||
import android.tools.device.flicker.isShellTransitionsEnabled
|
|
||||||
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
|
|
||||||
import android.tools.device.flicker.legacy.FlickerTest
|
|
||||||
import androidx.test.filters.RequiresDevice
|
|
||||||
import org.junit.Assume
|
|
||||||
import org.junit.Before
|
|
||||||
import org.junit.FixMethodOrder
|
|
||||||
import org.junit.Ignore
|
|
||||||
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: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)
|
|
||||||
open class QuickSwitchBetweenTwoAppsBackTest_ShellTransit(flicker: FlickerTest) :
|
|
||||||
QuickSwitchBetweenTwoAppsBackTest(flicker) {
|
|
||||||
@Before
|
|
||||||
override fun before() {
|
|
||||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Ignore("Nav bar window becomes invisible during quick switch")
|
|
||||||
@Test
|
|
||||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@FlakyTest(bugId = 250520840)
|
|
||||||
@Test
|
|
||||||
override fun startsWithApp2LayersCoverFullScreen() = super.startsWithApp2LayersCoverFullScreen()
|
|
||||||
|
|
||||||
@FlakyTest(bugId = 246284708)
|
|
||||||
@Test
|
|
||||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
|
||||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
|
||||||
|
|
||||||
@FlakyTest(bugId = 250518877)
|
|
||||||
@Test
|
|
||||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
|
||||||
}
|
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
|
|
||||||
package com.android.server.wm.flicker.quickswitch
|
package com.android.server.wm.flicker.quickswitch
|
||||||
|
|
||||||
|
import android.platform.test.annotations.FlakyTest
|
||||||
import android.platform.test.annotations.Presubmit
|
import android.platform.test.annotations.Presubmit
|
||||||
import android.tools.common.NavBar
|
import android.tools.common.NavBar
|
||||||
import android.tools.common.datatypes.Rect
|
import android.tools.common.datatypes.Rect
|
||||||
import android.tools.common.datatypes.component.ComponentNameMatcher
|
import android.tools.common.datatypes.component.ComponentNameMatcher
|
||||||
import android.tools.device.flicker.isShellTransitionsEnabled
|
|
||||||
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
|
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
|
||||||
import android.tools.device.flicker.legacy.FlickerBuilder
|
import android.tools.device.flicker.legacy.FlickerBuilder
|
||||||
import android.tools.device.flicker.legacy.FlickerTest
|
import android.tools.device.flicker.legacy.FlickerTest
|
||||||
@@ -29,9 +29,8 @@ import androidx.test.filters.RequiresDevice
|
|||||||
import com.android.server.wm.flicker.BaseTest
|
import com.android.server.wm.flicker.BaseTest
|
||||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||||
import org.junit.Assume
|
|
||||||
import org.junit.Before
|
|
||||||
import org.junit.FixMethodOrder
|
import org.junit.FixMethodOrder
|
||||||
|
import org.junit.Ignore
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
import org.junit.runners.MethodSorters
|
import org.junit.runners.MethodSorters
|
||||||
@@ -58,11 +57,6 @@ open class QuickSwitchBetweenTwoAppsForwardTest(flicker: FlickerTest) : BaseTest
|
|||||||
private val testApp1 = SimpleAppHelper(instrumentation)
|
private val testApp1 = SimpleAppHelper(instrumentation)
|
||||||
private val testApp2 = NonResizeableAppHelper(instrumentation)
|
private val testApp2 = NonResizeableAppHelper(instrumentation)
|
||||||
|
|
||||||
@Before
|
|
||||||
open fun before() {
|
|
||||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
override val transition: FlickerBuilder.() -> Unit = {
|
override val transition: FlickerBuilder.() -> Unit = {
|
||||||
setup {
|
setup {
|
||||||
@@ -113,7 +107,7 @@ open class QuickSwitchBetweenTwoAppsForwardTest(flicker: FlickerTest) : BaseTest
|
|||||||
* Checks that the transition starts with [testApp1]'s layers filling/covering exactly the
|
* Checks that the transition starts with [testApp1]'s layers filling/covering exactly the
|
||||||
* entirety of the display.
|
* entirety of the display.
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
@FlakyTest(bugId = 250522691)
|
||||||
@Test
|
@Test
|
||||||
open fun startsWithApp1LayersCoverFullScreen() {
|
open fun startsWithApp1LayersCoverFullScreen() {
|
||||||
flicker.assertLayersStart { this.visibleRegion(testApp1).coversExactly(startDisplayBounds) }
|
flicker.assertLayersStart { this.visibleRegion(testApp1).coversExactly(startDisplayBounds) }
|
||||||
@@ -248,6 +242,20 @@ open class QuickSwitchBetweenTwoAppsForwardTest(flicker: FlickerTest) : BaseTest
|
|||||||
@Test
|
@Test
|
||||||
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd()
|
||||||
|
|
||||||
|
/** {@inheritDoc} */
|
||||||
|
@Ignore("Nav bar window becomes invisible during quick switch")
|
||||||
|
@Test
|
||||||
|
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
||||||
|
|
||||||
|
@FlakyTest(bugId = 246284708)
|
||||||
|
@Test
|
||||||
|
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||||
|
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||||
|
|
||||||
|
@FlakyTest(bugId = 250518877)
|
||||||
|
@Test
|
||||||
|
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private var startDisplayBounds = Rect.EMPTY
|
private var startDisplayBounds = Rect.EMPTY
|
||||||
|
|
||||||
|
|||||||
@@ -1,74 +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.FlakyTest
|
|
||||||
import android.tools.device.flicker.isShellTransitionsEnabled
|
|
||||||
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
|
|
||||||
import android.tools.device.flicker.legacy.FlickerTest
|
|
||||||
import androidx.test.filters.RequiresDevice
|
|
||||||
import org.junit.Assume
|
|
||||||
import org.junit.Before
|
|
||||||
import org.junit.FixMethodOrder
|
|
||||||
import org.junit.Ignore
|
|
||||||
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:QuickSwitchBetweenTwoAppsForwardTest`
|
|
||||||
*
|
|
||||||
* 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)
|
|
||||||
open class QuickSwitchBetweenTwoAppsForwardTest_ShellTransit(flicker: FlickerTest) :
|
|
||||||
QuickSwitchBetweenTwoAppsForwardTest(flicker) {
|
|
||||||
@Before
|
|
||||||
override fun before() {
|
|
||||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
|
||||||
@Ignore("Nav bar window becomes invisible during quick switch")
|
|
||||||
@Test
|
|
||||||
override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
|
|
||||||
|
|
||||||
@FlakyTest(bugId = 246284708)
|
|
||||||
@Test
|
|
||||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
|
||||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
|
||||||
|
|
||||||
@FlakyTest(bugId = 250518877)
|
|
||||||
@Test
|
|
||||||
override fun navBarLayerPositionAtStartAndEnd() = super.navBarLayerPositionAtStartAndEnd()
|
|
||||||
|
|
||||||
@FlakyTest(bugId = 250522691)
|
|
||||||
@Test
|
|
||||||
override fun startsWithApp1LayersCoverFullScreen() = super.startsWithApp1LayersCoverFullScreen()
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user