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

Commit 574551e2 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Add logs for uninstallWorkspaceIcon() test

Bug: 319501259
Change-Id: I2ac5c849e4551527eaf7f09a202f00a414d9d980
parent 1abc0a7f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -167,6 +167,8 @@ public final class TestProtocol {
    public static final String TWO_NEXUS_LAUNCHER_ACTIVITY_WHILE_UNLOCKING = "b/273347463";
    public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
    public static final String ICON_MISSING = "b/282963545";
    public static final String OVERVIEW_OVER_HOME = "b/279059025";
    public static final String UIOBJECT_STALE_ELEMENT = "b/319501259";

    public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
    public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
+13 −2
Original line number Diff line number Diff line
@@ -21,6 +21,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.NORMAL_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.UIOBJECT_STALE_ELEMENT;

import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertTrue;
@@ -28,6 +29,7 @@ import static junit.framework.TestCase.assertTrue;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.SystemClock;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;

@@ -315,8 +317,17 @@ public final class Workspace extends Home {
        return workspaceIcons.stream()
                .collect(
                        Collectors.toMap(
                                /* keyMapper= */ UiObject2::getText,
                                /* valueMapper= */ UiObject2::getVisibleCenter,
                                /* keyMapper= */ uiObject21 -> {
                                    Log.d(UIOBJECT_STALE_ELEMENT, "keyText: " +
                                            uiObject21.getText());
                                    return uiObject21.getText();
                                },
                                /* valueMapper= */ uiObject2 -> {
                                    Log.d(UIOBJECT_STALE_ELEMENT, uiObject2.getText() +
                                            " dispId" + uiObject2.getDisplayId() +
                                            " parent" + uiObject2.getParent());
                                    return uiObject2.getVisibleCenter();
                                },
                                /* mergeFunction= */ (p1, p2) -> p1.x < p2.x ? p1 : p2));
    }

+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
package com.android.launcher3.dragging;

import static com.android.launcher3.testing.shared.TestProtocol.ICON_MISSING;
import static com.android.launcher3.testing.shared.TestProtocol.UIOBJECT_STALE_ELEMENT;
import static com.android.launcher3.ui.AbstractLauncherUiTest.initialize;
import static com.android.launcher3.util.TestConstants.AppNames.DUMMY_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.GMAIL_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.MAPS_APP_NAME;
@@ -154,6 +156,7 @@ public class TaplUninstallRemoveTest extends AbstractLauncherUiTest {
                    0, Math.min(gridPositions.length, appNameCandidates.length));

            for (int i = 0; i < appNames.length; ++i) {
                Log.d(UIOBJECT_STALE_ELEMENT, "creatingShortcut for: " + appNames[i]);
                createShortcutIfNotExist(appNames[i], gridPositions[i]);
            }

@@ -166,6 +169,7 @@ public class TaplUninstallRemoveTest extends AbstractLauncherUiTest {
                    DUMMY_APP_NAME + " was expected to disappear after uninstall.", DUMMY_APP_NAME);

            if (!TestStabilityRule.isPresubmit()) { // b/315847371
                Log.d(UIOBJECT_STALE_ELEMENT, "second getWorkspaceIconsPositions()");
                Map<String, Point> finalPositions =
                        mLauncher.getWorkspace().getWorkspaceIconsPositions();
                assertThat(finalPositions).doesNotContainKey(DUMMY_APP_NAME);