Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92f15b66 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "2/ Fix flaky in WMShellFlickerTest legacySplitScreen tests"

parents c042f1bf c9522102
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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))
                }
            }
        }
+2 −0
Original line number Diff line number Diff line
@@ -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)
+4 −1
Original line number Diff line number Diff line
@@ -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 {
+5 −2
Original line number Diff line number Diff line
@@ -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 {
+21 −11
Original line number Diff line number Diff line
@@ -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 }
            transitions {
            setup {
                eachRun {
                    splitScreenApp.launchViaIntent()
                    device.pressHome()
                    this.setRotation(rotation)
                }
            }
            transitions {
                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) }
        }
    }
Loading