2/ Fix flaky in WMShellFlickerTest legacySplitScreen tests
b/177374067 indicate OpenAppToLegacySplitScreenTest still flaky 1) Extend the filter in visibleLayersShownMoreThanOneConsecutiveEntry() - Toast window 2) When going split transition, waitForAppTransitionIdle() at end 3) Enable navBarLayerIsAlwaysVisible() & statusBarLayerIsAlwaysVisible() Test: atest com.android.wm.shell.flicker.legacysplitscreen Test: Set TEST_REPETITIONS to 100 and run flicker test stressfully Bug: 177374067 Bug: 176923301 Bug: 176134495 Change-Id: I1caface176f4af591d5383877c81b786eb23ba58
This commit is contained in:
@@ -155,7 +155,9 @@ class EnterLegacySplitScreenTest(
|
||||
showsAppWindow(splitScreenApp.defaultWindowName)
|
||||
.and().showsAppWindow(secondaryApp.defaultWindowName)
|
||||
}
|
||||
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(LAUNCHER_PACKAGE_NAME))
|
||||
visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
|
||||
secondaryApp.defaultWindowName))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,7 +189,8 @@ class EnterLegacySplitScreenTest(
|
||||
end {
|
||||
hidesAppWindow(nonResizeableApp.defaultWindowName)
|
||||
}
|
||||
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(LAUNCHER_PACKAGE_NAME))
|
||||
visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
listOf(LAUNCHER_PACKAGE_NAME, nonResizeableApp.defaultWindowName))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
@@ -45,6 +46,7 @@ import org.junit.runners.Parameterized
|
||||
* Test open app to split screen.
|
||||
* To run this test: `atest WMShellFlickerTests:ExitLegacySplitScreenFromBottomTest`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.dsl.runWithFlicker
|
||||
@@ -34,6 +35,7 @@ import org.junit.runners.Parameterized
|
||||
* Test open app to split screen.
|
||||
* To run this test: `atest WMShellFlickerTests:NonResizableDismissInLegacySplitScreenTest`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@@ -64,7 +66,8 @@ class NonResizableDismissInLegacySplitScreenTest(
|
||||
}
|
||||
visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
|
||||
nonResizeableApp.defaultWindowName, LETTER_BOX_NAME)
|
||||
nonResizeableApp.defaultWindowName, LETTER_BOX_NAME,
|
||||
TOAST_NAME, LIVE_WALLPAPER_PACKAGE_NAME)
|
||||
)
|
||||
}
|
||||
windowManagerTrace {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.dsl.runWithFlicker
|
||||
@@ -34,6 +35,7 @@ import org.junit.runners.Parameterized
|
||||
* Test open app to split screen.
|
||||
* To run this test: `atest WMShellFlickerTests:NonResizableLaunchInLegacySplitScreenTest`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@@ -44,7 +46,7 @@ class NonResizableLaunchInLegacySplitScreenTest(
|
||||
|
||||
@Test
|
||||
fun testNonResizableLaunchInLegacySplitScreenTest() {
|
||||
val testTag = "NonResizableLaunchInLegacySplitScreenTest"
|
||||
val testTag = "testNonResizableLaunchInLegacySplitScreenTest"
|
||||
|
||||
runWithFlicker(transitionSetup) {
|
||||
withTestName { testTag }
|
||||
@@ -64,7 +66,8 @@ class NonResizableLaunchInLegacySplitScreenTest(
|
||||
}
|
||||
visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
|
||||
nonResizeableApp.defaultWindowName, LETTER_BOX_NAME)
|
||||
nonResizeableApp.defaultWindowName, LETTER_BOX_NAME,
|
||||
TOAST_NAME, LIVE_WALLPAPER_PACKAGE_NAME)
|
||||
)
|
||||
}
|
||||
windowManagerTrace {
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.android.server.wm.flicker.dsl.runWithFlicker
|
||||
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
|
||||
import com.android.server.wm.flicker.noUncoveredRegions
|
||||
import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.appPairsDividerBecomesVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -41,8 +42,7 @@ import org.junit.runners.Parameterized
|
||||
* Test open app to split screen.
|
||||
* To run this test: `atest WMShellFlickerTests:OpenAppToLegacySplitScreenTest`
|
||||
*/
|
||||
// TODO: Add back to pre-submit when stable.
|
||||
//@Presubmit
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@@ -53,28 +53,37 @@ class OpenAppToLegacySplitScreenTest(
|
||||
@Test
|
||||
fun OpenAppToLegacySplitScreenTest() {
|
||||
val testTag = "OpenAppToLegacySplitScreenTest"
|
||||
|
||||
val helper = WindowManagerStateHelper()
|
||||
runWithFlicker(transitionSetup) {
|
||||
withTestName { testTag }
|
||||
repeat { SplitScreenHelper.TEST_REPETITIONS }
|
||||
setup {
|
||||
eachRun {
|
||||
splitScreenApp.launchViaIntent()
|
||||
device.pressHome()
|
||||
this.setRotation(rotation)
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
splitScreenApp.launchViaIntent()
|
||||
device.pressHome()
|
||||
this.setRotation(rotation)
|
||||
device.launchSplitScreen()
|
||||
helper.waitForAppTransitionIdle()
|
||||
}
|
||||
assertions {
|
||||
windowManagerTrace {
|
||||
visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
|
||||
LETTER_BOX_NAME)
|
||||
)
|
||||
appWindowBecomesVisible(splitScreenApp.getPackage())
|
||||
}
|
||||
|
||||
layersTrace {
|
||||
navBarLayerIsAlwaysVisible(bugId = 140855415)
|
||||
navBarLayerIsAlwaysVisible()
|
||||
noUncoveredRegions(rotation, enabled = false)
|
||||
statusBarLayerIsAlwaysVisible(bugId = 140855415)
|
||||
statusBarLayerIsAlwaysVisible()
|
||||
visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(LAUNCHER_PACKAGE_NAME))
|
||||
listOf(LAUNCHER_PACKAGE_NAME, splitScreenApp.defaultWindowName,
|
||||
LETTER_BOX_NAME))
|
||||
appPairsDividerBecomesVisible()
|
||||
layerBecomesVisible(splitScreenApp.getPackage())
|
||||
}
|
||||
@@ -92,7 +101,8 @@ class OpenAppToLegacySplitScreenTest(
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<Array<Any>> {
|
||||
val supportedRotations = intArrayOf(Surface.ROTATION_0, Surface.ROTATION_90)
|
||||
// TODO(b/161435597) causes the test not to work on 90 degrees
|
||||
val supportedRotations = intArrayOf(Surface.ROTATION_0)
|
||||
return supportedRotations.map { arrayOf(Surface.rotationToString(it), it) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.graphics.Region
|
||||
import android.util.Rational
|
||||
import android.view.Surface
|
||||
@@ -61,6 +62,7 @@ import org.junit.runners.Parameterized
|
||||
*
|
||||
* Currently it runs only in 0 degrees because of b/156100803
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
@@ -42,6 +43,7 @@ import org.junit.runners.Parameterized
|
||||
* Test open app to split screen.
|
||||
* To run this test: `atest WMShellFlickerTests:RotateOneLaunchedAppTest`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
@@ -43,6 +44,7 @@ import org.junit.runners.Parameterized
|
||||
* Test open app to split screen.
|
||||
* To run this test: `atest WMShellFlickerTests:RotateTwoLaunchedAppTest`
|
||||
*/
|
||||
@Presubmit
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
|
||||
@@ -52,6 +52,7 @@ abstract class SplitScreenTestBase(
|
||||
protected val LIVE_WALLPAPER_PACKAGE_NAME =
|
||||
"com.breel.wallpapers18.soundviz.wallpaper.variations.SoundVizWallpaperV2"
|
||||
protected val LETTER_BOX_NAME = "Letterbox"
|
||||
protected val TOAST_NAME = "Toast"
|
||||
|
||||
protected val transitionSetup: FlickerBuilder
|
||||
get() = FlickerBuilder(instrumentation).apply {
|
||||
|
||||
Reference in New Issue
Block a user