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

Commit b88093ff authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Fix EnterSplitScreenTest app helper

There were 2 app helpers for the same action

Fixes: 249027753
Test: atest WMShellFlickerTests
Change-Id: Ic7060e9b06e9e502ec477ebaab7e0517755971db
parent d20b5436
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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()
+1 −8
Original line number Diff line number Diff line
@@ -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)
            }
+4 −4
Original line number Diff line number Diff line
@@ -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) {
+0 −30
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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.
  -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@android:color/black">

        <Button
            android:id="@+id/button_send_notification"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:text="Send Notification" />
</RelativeLayout>
+0 −6
Original line number Diff line number Diff line
@@ -177,12 +177,6 @@ public class ActivityOptions {
        }
    }

    public static class SendNotificationActivity {
        public static final String LABEL = "SendNotificationActivity";
        public static final ComponentName COMPONENT = new ComponentName(FLICKER_APP_PACKAGE,
                FLICKER_APP_PACKAGE + ".SendNotificationActivity");
    }

    public static class Bubbles {
        public static class LaunchBubble {
            public static final String LABEL = "LaunchBubbleActivity";
Loading