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

Commit e5f02039 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Debugging Logs for TaplDragTest#testDragAppIconToMultipleWorkspaceCells" into main

parents 544f6e22 872b9f9a
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -175,6 +175,7 @@ public final class TestProtocol {
    public static final String ACTIVITY_NOT_RESUMED_AFTER_BACK = "b/322823209";
    public static final String ACTIVITY_NOT_RESUMED_AFTER_BACK = "b/322823209";
    public static final String GET_FROM_RECENTS_FAILURE = "b/321775748";
    public static final String GET_FROM_RECENTS_FAILURE = "b/321775748";
    public static final String SUCCESSFUL_GESTURE_MISMATCH_EVENTS = "b/324940434";
    public static final String SUCCESSFUL_GESTURE_MISMATCH_EVENTS = "b/324940434";
    public static final String TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE = "b/326908466";
    public static final String TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE = "b/326073471";
    public static final String TEST_TAPL_OVERVIEW_ACTIONS_MENU_FAILURE = "b/326073471";


    public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
    public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
+6 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,9 @@


package com.android.launcher3.tapl;
package com.android.launcher3.tapl;


import static com.android.launcher3.testing.shared.TestProtocol.TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE;

import android.util.Log;
import android.widget.TextView;
import android.widget.TextView;


import androidx.annotation.NonNull;
import androidx.annotation.NonNull;
@@ -95,6 +98,8 @@ public abstract class AppIcon extends Launchable {


    @Override
    @Override
    protected void waitForLongPressConfirmation() {
    protected void waitForLongPressConfirmation() {
        Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                "AppIcon.waitForLongPressConfirmation, resName: popupContainer");
        mLauncher.waitForLauncherObject("popup_container");
        mLauncher.waitForLauncherObject("popup_container");
    }
    }


+10 −4
Original line number Original line Diff line number Diff line
@@ -17,8 +17,10 @@
package com.android.launcher3.tapl;
package com.android.launcher3.tapl;


import static com.android.launcher3.testing.shared.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE;


import android.graphics.Point;
import android.graphics.Point;
import android.util.Log;
import android.view.MotionEvent;
import android.view.MotionEvent;


import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.UiObject2;
@@ -113,6 +115,10 @@ public abstract class Launchable {
                iconCenter.y - getStartDragThreshold());
                iconCenter.y - getStartDragThreshold());


        if (runToSpringLoadedState) {
        if (runToSpringLoadedState) {
            Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                    "Launchable.startDrag: actionName: long-pressing and triggering drag start"
                            + " iconCenter: " + iconCenter + " dragStartCenter: "
                            + dragStartCenter);
            mLauncher.runToState(() -> movePointerForStartDrag(
            mLauncher.runToState(() -> movePointerForStartDrag(
                            downTime,
                            downTime,
                            iconCenter,
                            iconCenter,
+19 −1
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORD
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_GET_SPLIT_SELECTION_ACTIVE;
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_GET_SPLIT_SELECTION_ACTIVE;
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_NUM_ALL_APPS_COLUMNS;
import static com.android.launcher3.testing.shared.TestProtocol.REQUEST_NUM_ALL_APPS_COLUMNS;
import static com.android.launcher3.testing.shared.TestProtocol.SUCCESSFUL_GESTURE_MISMATCH_EVENTS;
import static com.android.launcher3.testing.shared.TestProtocol.SUCCESSFUL_GESTURE_MISMATCH_EVENTS;
import static com.android.launcher3.testing.shared.TestProtocol.TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE;
import static com.android.launcher3.testing.shared.TestProtocol.TEST_INFO_RESPONSE_FIELD;
import static com.android.launcher3.testing.shared.TestProtocol.TEST_INFO_RESPONSE_FIELD;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;


@@ -1165,7 +1166,11 @@ public final class LauncherInstrumentation {
                log("Hierarchy before clicking home:");
                log("Hierarchy before clicking home:");
                dumpViewHierarchy();
                dumpViewHierarchy();
                action = "clicking home button";
                action = "clicking home button";

                Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                        "LauncherInstrumentation.goHome: isThreeFingerTrackpadGesture: "
                                + isThreeFingerTrackpadGesture
                                + "getNavigationModel() == NavigationModel.ZERO_BUTTON: " + (
                                getNavigationModel() == NavigationModel.ZERO_BUTTON));
                runToState(
                runToState(
                        getHomeButton()::click,
                        getHomeButton()::click,
                        NORMAL_STATE_ORDINAL,
                        NORMAL_STATE_ORDINAL,
@@ -1512,6 +1517,8 @@ public final class LauncherInstrumentation {


    @NonNull
    @NonNull
    UiObject2 waitForLauncherObject(String resName) {
    UiObject2 waitForLauncherObject(String resName) {
        Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                "LauncherInstrumentation.waitForLauncherObject");
        return waitForObjectBySelector(getLauncherObjectSelector(resName));
        return waitForObjectBySelector(getLauncherObjectSelector(resName));
    }
    }


@@ -1541,12 +1548,16 @@ public final class LauncherInstrumentation {


    @NonNull
    @NonNull
    List<UiObject2> waitForObjectsBySelector(BySelector selector) {
    List<UiObject2> waitForObjectsBySelector(BySelector selector) {
        Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                "LauncherInstrumentation.waitForObjectsBySelector");
        final List<UiObject2> objects = mDevice.wait(Until.findObjects(selector), WAIT_TIME_MS);
        final List<UiObject2> objects = mDevice.wait(Until.findObjects(selector), WAIT_TIME_MS);
        assertNotNull("Can't find any view in Launcher, selector: " + selector, objects);
        assertNotNull("Can't find any view in Launcher, selector: " + selector, objects);
        return objects;
        return objects;
    }
    }


    private UiObject2 waitForObjectBySelector(BySelector selector) {
    private UiObject2 waitForObjectBySelector(BySelector selector) {
        Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                "LauncherInstrumentation.waitForObjectBySelector");
        final UiObject2 object = mDevice.wait(Until.findObject(selector), WAIT_TIME_MS);
        final UiObject2 object = mDevice.wait(Until.findObject(selector), WAIT_TIME_MS);
        assertNotNull("Can't find a view in Launcher, selector: " + selector, object);
        assertNotNull("Can't find a view in Launcher, selector: " + selector, object);
        return object;
        return object;
@@ -1589,6 +1600,9 @@ public final class LauncherInstrumentation {


    void runToState(Runnable command, int expectedState, boolean requireEvent, String actionName) {
    void runToState(Runnable command, int expectedState, boolean requireEvent, String actionName) {
        if (requireEvent) {
        if (requireEvent) {
            Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                    "LauncherInstrumentation.runToState: command: " + command + " expectedState: "
                            + expectedState + " actionName: " + actionName + "requireEvent: true");
            runToState(command, expectedState, actionName);
            runToState(command, expectedState, actionName);
        } else {
        } else {
            command.run();
            command.run();
@@ -1966,11 +1980,15 @@ public final class LauncherInstrumentation {
                    mPointerCount = 1;
                    mPointerCount = 1;
                    pointerCount = mPointerCount;
                    pointerCount = mPointerCount;
                }
                }
                Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                        "LauncherInstrumentation.sendPointer: ACTION_DOWN");
                break;
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_UP:
                if (hasTIS && gestureScope == GestureScope.EXPECT_PILFER) {
                if (hasTIS && gestureScope == GestureScope.EXPECT_PILFER) {
                    expectEvent(TestProtocol.SEQUENCE_PILFER, EVENT_PILFER_POINTERS);
                    expectEvent(TestProtocol.SEQUENCE_PILFER, EVENT_PILFER_POINTERS);
                }
                }
                Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                        "LauncherInstrumentation.sendPointer: ACTION_UP");
                break;
                break;
            case MotionEvent.ACTION_POINTER_DOWN:
            case MotionEvent.ACTION_POINTER_DOWN:
                mPointerCount++;
                mPointerCount++;
+3 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_SCROLLED;
import static com.android.launcher3.testing.shared.TestProtocol.ALL_APPS_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.ALL_APPS_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE;
import static com.android.launcher3.testing.shared.TestProtocol.UIOBJECT_STALE_ELEMENT;
import static com.android.launcher3.testing.shared.TestProtocol.UIOBJECT_STALE_ELEMENT;


import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNotNull;
@@ -626,6 +627,8 @@ public final class Workspace extends Home {
        try (LauncherInstrumentation.Closable ignored = launcher.addContextLayer(
        try (LauncherInstrumentation.Closable ignored = launcher.addContextLayer(
                "want to drag icon to workspace")) {
                "want to drag icon to workspace")) {
            final long downTime = SystemClock.uptimeMillis();
            final long downTime = SystemClock.uptimeMillis();
            Log.d(TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE,
                    "Workspace.dragIconToWorkspace: starting drag | downtime: " + downTime);
            Point dragStart = launchable.startDrag(
            Point dragStart = launchable.startDrag(
                    downTime,
                    downTime,
                    expectLongClickEvents,
                    expectLongClickEvents,
Loading