Loading tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java +2 −0 Original line number Diff line number Diff line Loading @@ -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"; Loading tests/multivalentTests/tapl/com/android/launcher3/tapl/Workspace.java +13 −2 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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)); } Loading tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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]); } Loading @@ -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); Loading Loading
tests/multivalentTests/shared/com/android/launcher3/testing/shared/TestProtocol.java +2 −0 Original line number Diff line number Diff line Loading @@ -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"; Loading
tests/multivalentTests/tapl/com/android/launcher3/tapl/Workspace.java +13 −2 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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)); } Loading
tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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]); } Loading @@ -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); Loading