diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt index 55979905cc4f4..2ccf1216d7c1b 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt @@ -114,14 +114,14 @@ fun FlickerTestParameter.splitAppLayerBoundsBecomesVisibleByDrag( ) { assertLayers { if (isShellTransitionsEnabled) { - this.notContains(SPLIT_SCREEN_DIVIDER_COMPONENT.or(component)) + this.notContains(SPLIT_SCREEN_DIVIDER_COMPONENT.or(component), isOptional = true) .then() .isInvisible(SPLIT_SCREEN_DIVIDER_COMPONENT.or(component)) .then() // TODO(b/245472831): Verify the component should snap to divider. .isVisible(component) } else { - this.notContains(SPLIT_SCREEN_DIVIDER_COMPONENT.or(component)) + this.notContains(SPLIT_SCREEN_DIVIDER_COMPONENT.or(component), isOptional = true) .then() .isInvisible(SPLIT_SCREEN_DIVIDER_COMPONENT.or(component)) .then() diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromNotification.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromNotification.kt index 047bcfe6d2004..2ee12f1f0af2c 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromNotification.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenByDragFromNotification.kt @@ -21,8 +21,6 @@ import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import android.view.WindowManagerPolicyConstants import androidx.test.filters.RequiresDevice -import androidx.test.uiautomator.By -import androidx.test.uiautomator.Until import com.android.server.wm.flicker.FlickerParametersRunnerFactory import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory @@ -73,12 +71,7 @@ class EnterSplitScreenByDragFromNotification( setup { // Send a notification sendNotificationApp.launchViaIntent(wmHelper) - val sendNotification = device.wait( - Until.findObject(By.text("Send Notification")), - SplitScreenUtils.TIMEOUT_MS - ) - sendNotification?.click() ?: error("Send notification button not found") - + sendNotificationApp.postNotification(wmHelper) tapl.goHome() primaryApp.launchViaIntent(wmHelper) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenUtils.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenUtils.kt index 96b9faabd8fe2..e57ac91617b77 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenUtils.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenUtils.kt @@ -41,7 +41,7 @@ import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelpe import com.android.wm.shell.flicker.SYSTEM_UI_PACKAGE_NAME internal object SplitScreenUtils { - internal const val TIMEOUT_MS = 3_000L + private const val TIMEOUT_MS = 3_000L private const val DRAG_DURATION_MS = 1_000L private const val NOTIFICATION_SCROLLER = "notification_stack_scroller" private const val DIVIDER_BAR = "docked_divider_handle" @@ -52,7 +52,7 @@ internal object SplitScreenUtils { private val notificationScrollerSelector: BySelector get() = By.res(SYSTEM_UI_PACKAGE_NAME, NOTIFICATION_SCROLLER) private val notificationContentSelector: BySelector - get() = By.text("Notification content") + get() = By.text("Flicker Test Notification") private val dividerBarSelector: BySelector get() = By.res(SYSTEM_UI_PACKAGE_NAME, DIVIDER_BAR) @@ -140,14 +140,14 @@ internal object SplitScreenUtils { // Pull down the notifications device.swipe( displayBounds.centerX(), 5, - displayBounds.centerX(), displayBounds.bottom, 20 /* steps */ + displayBounds.centerX(), displayBounds.bottom, 50 /* steps */ ) SystemClock.sleep(TIMEOUT_MS) // Find the target notification val notificationScroller = device.wait( Until.findObject(notificationScrollerSelector), TIMEOUT_MS - ) + ) ?: error ("Unable to find view $notificationScrollerSelector") var notificationContent = notificationScroller.findObject(notificationContentSelector) while (notificationContent == null) { diff --git a/tests/FlickerTests/test-apps/flickerapp/res/layout/activity_notification.xml b/tests/FlickerTests/test-apps/flickerapp/res/layout/activity_notification.xml deleted file mode 100644 index 7c11984163347..0000000000000 --- a/tests/FlickerTests/test-apps/flickerapp/res/layout/activity_notification.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - -