From d7fdcab612d9c8136283ea432a24800a9cdbfdc8 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Thu, 3 Oct 2019 10:15:30 -0700 Subject: [PATCH] correct naming and add comments for test case of custom shortcut. Bug: 141934188 Change-Id: I69ce5f05214df10e2a376ff68c713efe8874df15 --- tests/AndroidManifest-common.xml | 2 +- ...ctivity.java => CustomShortcutConfigActivity.java} | 6 +++++- .../com/android/launcher3/ui/TaplTestsLauncher3.java | 11 +++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) rename tests/src/com/android/launcher3/testcomponent/{ShortcutWidgetConfigActivity.java => CustomShortcutConfigActivity.java} (91%) diff --git a/tests/AndroidManifest-common.xml b/tests/AndroidManifest-common.xml index 6802152c76..ffa90b9c5b 100644 --- a/tests/AndroidManifest-common.xml +++ b/tests/AndroidManifest-common.xml @@ -62,7 +62,7 @@ - + diff --git a/tests/src/com/android/launcher3/testcomponent/ShortcutWidgetConfigActivity.java b/tests/src/com/android/launcher3/testcomponent/CustomShortcutConfigActivity.java similarity index 91% rename from tests/src/com/android/launcher3/testcomponent/ShortcutWidgetConfigActivity.java rename to tests/src/com/android/launcher3/testcomponent/CustomShortcutConfigActivity.java index f9d5f2d435..b673faa6f3 100644 --- a/tests/src/com/android/launcher3/testcomponent/ShortcutWidgetConfigActivity.java +++ b/tests/src/com/android/launcher3/testcomponent/CustomShortcutConfigActivity.java @@ -27,7 +27,11 @@ import com.android.launcher3.R; import java.util.UUID; -public class ShortcutWidgetConfigActivity extends BaseTestingActivity { +/** + * A custom shortcut is a 1x1 widget that launches a specific intent when user tap on it. + * Custom shortcuts are replaced by deep shortcuts after api 25. + */ +public class CustomShortcutConfigActivity extends BaseTestingActivity { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java index 38dba16280..709822bbbf 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java @@ -342,10 +342,17 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { } } + /** + * Test dragging a custom shortcut to the workspace and launch it. + * + * A custom shortcut is a 1x1 widget that launches a specific intent when user tap on it. + * Custom shortcuts are replaced by deep shortcuts after api 25. + */ @Test - public void testDragShortcutWidget() { + @PortraitLandscape + public void testDragCustomShortcut() { mLauncher.getWorkspace().openAllWidgets() - .getWidget("com.android.launcher3.testcomponent.ShortcutWidgetConfigActivity") + .getWidget("com.android.launcher3.testcomponent.CustomShortcutConfigActivity") .dragToWorkspace(); mLauncher.getWorkspace().getWorkspaceAppIcon("Shortcut") .launch(getAppPackageName());