use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project android_packages_apps_Launcher3 by crdroidandroid.
the class TaplTestsLauncher3 method testDragShortcut.
@Test
@PortraitLandscape
public void testDragShortcut() throws Throwable {
// 1. Open all apps and wait for load complete.
// 2. Find the app and long press it to show shortcuts.
// 3. Press icon center until shortcuts appear
final AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
try {
final AppIconMenu menu = allApps.getAppIcon(APP_NAME).openDeepShortcutMenu();
final AppIconMenuItem menuItem0 = menu.getMenuItem(0);
final AppIconMenuItem menuItem2 = menu.getMenuItem(2);
final AppIconMenuItem menuItem;
final String expectedShortcutName = "Shortcut 3";
if (menuItem0.getText().equals(expectedShortcutName)) {
menuItem = menuItem0;
} else {
final String shortcutName2 = menuItem2.getText();
assertEquals("Wrong menu item", expectedShortcutName, shortcutName2);
menuItem = menuItem2;
}
menuItem.dragToWorkspace(false, false);
mLauncher.getWorkspace().getWorkspaceAppIcon(expectedShortcutName).launch(getAppPackageName());
} finally {
allApps.unfreeze();
}
}
use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project android_packages_apps_Launcher3 by AOSPA.
the class TaplTestsLauncher3 method testDragShortcut.
@Test
@PortraitLandscape
public void testDragShortcut() throws Throwable {
// 1. Open all apps and wait for load complete.
// 2. Find the app and long press it to show shortcuts.
// 3. Press icon center until shortcuts appear
final AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
try {
final AppIconMenu menu = allApps.getAppIcon(APP_NAME).openDeepShortcutMenu();
final AppIconMenuItem menuItem0 = menu.getMenuItem(0);
final AppIconMenuItem menuItem2 = menu.getMenuItem(2);
final AppIconMenuItem menuItem;
final String expectedShortcutName = "Shortcut 3";
if (menuItem0.getText().equals(expectedShortcutName)) {
menuItem = menuItem0;
} else {
final String shortcutName2 = menuItem2.getText();
assertEquals("Wrong menu item", expectedShortcutName, shortcutName2);
menuItem = menuItem2;
}
menuItem.dragToWorkspace(false, false);
mLauncher.getWorkspace().getWorkspaceAppIcon(expectedShortcutName).launch(getAppPackageName());
} finally {
allApps.unfreeze();
}
}
use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project android_packages_apps_Launcher3 by AOSPA.
the class TaplTestsLauncher3 method runIconLaunchFromAllAppsTest.
public static void runIconLaunchFromAllAppsTest(AbstractLauncherUiTest test, AllApps allApps) {
allApps.freeze();
try {
final AppIcon app = allApps.getAppIcon("TestActivity7");
assertNotNull("AppIcon.launch returned null", app.launch(getAppPackageName()));
test.executeOnLauncher(launcher -> assertTrue("Launcher activity is the top activity; expecting another activity to be the " + "top " + "one", test.isInBackground(launcher)));
} finally {
allApps.unfreeze();
}
}
use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project android_packages_apps_Launcher3 by AOSPA.
the class TaplTestsLauncher3 method testPressBack.
@Ignore("b/205027405")
@Test
@PortraitLandscape
public void testPressBack() throws Exception {
mLauncher.getWorkspace().switchToAllApps();
mLauncher.pressBack();
mLauncher.getWorkspace();
waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
try {
allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
} finally {
allApps.unfreeze();
}
mLauncher.getWorkspace().getWorkspaceAppIcon(APP_NAME).launch(getAppPackageName());
mLauncher.pressBack();
mLauncher.getWorkspace();
waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
}
use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project android_packages_apps_Launcher3 by AOSPA.
the class TaplTestsLauncher3 method testDragAppIcon.
@Test
@PortraitLandscape
public void testDragAppIcon() throws Throwable {
// 1. Open all apps and wait for load complete.
// 2. Drag icon to homescreen.
// 3. Verify that the icon works on homescreen.
final AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
try {
allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
mLauncher.getWorkspace().getWorkspaceAppIcon(APP_NAME).launch(getAppPackageName());
} finally {
allApps.unfreeze();
}
executeOnLauncher(launcher -> assertTrue("Launcher activity is the top activity; expecting another activity to be the top " + "one", isInBackground(launcher)));
}
Aggregations