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

Commit 4e10800b authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Wait for split screen apps to be visible

Previously used a fixed timeout, which was not reliable. Now wait for both apps or for the non-resizeable one

Test: atest WMShellFlickerTests
Bug: 189997782
Change-Id: I60d79317d5d1f684b8a4a75b3f3e6ad7d1048bcd
parent 516f3d1a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.flicker.apppairs

import android.os.SystemClock
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
@@ -61,7 +60,7 @@ class AppPairsTestCannotPairNonResizeableApps(
                // TODO pair apps through normal UX flow
                executeShellCommand(
                    composePairsCommand(primaryTaskId, nonResizeableTaskId, pair = true))
                SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
                nonResizeableApp?.run { wmHelper.waitForFullScreenApp(nonResizeableApp.component) }
            }
        }

+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.flicker.apppairs

import android.os.SystemClock
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
@@ -29,6 +28,7 @@ import com.android.server.wm.flicker.traces.layers.getVisibleBounds
import com.android.wm.shell.flicker.APP_PAIR_SPLIT_DIVIDER
import com.android.wm.shell.flicker.appPairsDividerIsVisible
import com.android.wm.shell.flicker.helpers.AppPairsHelper
import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.waitAppsShown
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -54,7 +54,7 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
                // TODO pair apps through normal UX flow
                executeShellCommand(
                    composePairsCommand(primaryTaskId, secondaryTaskId, pair = true))
                SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
                waitAppsShown(primaryApp, secondaryApp)
            }
        }

+1 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.flicker.apppairs

import android.os.SystemClock
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
@@ -61,7 +60,7 @@ class AppPairsTestSupportPairNonResizeableApps(
                // TODO pair apps through normal UX flow
                executeShellCommand(
                        composePairsCommand(primaryTaskId, nonResizeableTaskId, pair = true))
                SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
                nonResizeableApp?.run { wmHelper.waitForFullScreenApp(nonResizeableApp.component) }
            }
        }

+6 −3
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.server.wm.flicker.traces.layers.getVisibleBounds
import com.android.wm.shell.flicker.APP_PAIR_SPLIT_DIVIDER
import com.android.wm.shell.flicker.appPairsDividerIsInvisible
import com.android.wm.shell.flicker.helpers.AppPairsHelper
import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.waitAppsShown
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -51,9 +52,11 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
        get() = {
            super.transition(this, it)
            setup {
                eachRun {
                    executeShellCommand(
                            composePairsCommand(primaryTaskId, secondaryTaskId, pair = true))
                SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
                    waitAppsShown(primaryApp, secondaryApp)
                }
            }
            transitions {
                // TODO pair apps through normal UX flow
+2 −3
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.wm.shell.flicker.apppairs

import android.os.SystemClock
import android.platform.test.annotations.Presubmit
import android.view.Surface
import androidx.test.filters.FlakyTest
@@ -31,7 +30,7 @@ import com.android.server.wm.flicker.helpers.setRotation
import com.android.wm.shell.flicker.appPairsDividerIsVisible
import com.android.wm.shell.flicker.appPairsPrimaryBoundsIsVisible
import com.android.wm.shell.flicker.appPairsSecondaryBoundsIsVisible
import com.android.wm.shell.flicker.helpers.AppPairsHelper
import com.android.wm.shell.flicker.helpers.AppPairsHelper.Companion.waitAppsShown
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
import org.junit.FixMethodOrder
import org.junit.Test
@@ -57,7 +56,7 @@ class RotateTwoLaunchedAppsInAppPairsMode(
            transitions {
                executeShellCommand(composePairsCommand(
                    primaryTaskId, secondaryTaskId, true /* pair */))
                SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
                waitAppsShown(primaryApp, secondaryApp)
                setRotation(testSpec.config.endRotation)
            }
        }
Loading