use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project Neo-Launcher by NeoApplications.
the class AddWidgetTest method testDragIcon.
@Test
@PortraitLandscape
public void testDragIcon() throws Throwable {
clearHomescreen();
mDevice.pressHome();
final LauncherAppWidgetProviderInfo widgetInfo = TestViewHelpers.findWidgetProvider(this, false);
mLauncher.getWorkspace().openAllWidgets().getWidget(widgetInfo.getLabel(mTargetContext.getPackageManager())).dragToWorkspace();
assertTrue(mActivityMonitor.itemExists((info, view) -> info instanceof LauncherAppWidgetInfo && ((LauncherAppWidgetInfo) info).providerName.getClassName().equals(widgetInfo.provider.getClassName())).call());
final Widget widget = mLauncher.getWorkspace().tryGetWidget(widgetInfo.label, DEFAULT_UI_TIMEOUT);
assertNotNull("Widget not found on the workspace", widget);
widget.launch(getAppPackageName());
}
use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project Neo-Launcher by NeoApplications.
the class TaplTestsLauncher3 method testLaunchMenuItem.
@Test
@PortraitLandscape
public void testLaunchMenuItem() throws Exception {
final AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
try {
final AppIconMenu menu = allApps.getAppIcon(APP_NAME).openMenu();
executeOnLauncher(launcher -> assertTrue("Launcher internal state didn't switch to Showing Menu", isOptionsPopupVisible(launcher)));
menu.getMenuItem(1).launch(getAppPackageName());
} finally {
allApps.unfreeze();
}
}
use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project Neo-Launcher by NeoApplications.
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 AppIconMenuItem menuItem = allApps.getAppIcon(APP_NAME).openMenu().getMenuItem(0);
final String shortcutName = menuItem.getText();
menuItem.dragToWorkspace();
mLauncher.getWorkspace().getWorkspaceAppIcon(shortcutName).launch(getAppPackageName());
} finally {
allApps.unfreeze();
}
}
use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project Neo-Launcher by NeoApplications.
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();
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)));
}
use of com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName in project android_packages_apps_Trebuchet by LineageOS.
the class AddWidgetTest method testDragIcon.
@Test
@PortraitLandscape
public void testDragIcon() throws Throwable {
clearHomescreen();
mDevice.pressHome();
final LauncherAppWidgetProviderInfo widgetInfo = TestViewHelpers.findWidgetProvider(this, false);
mLauncher.getWorkspace().openAllWidgets().getWidget(widgetInfo.getLabel(mTargetContext.getPackageManager())).dragToWorkspace(false, false);
assertTrue(mActivityMonitor.itemExists((info, view) -> info instanceof LauncherAppWidgetInfo && ((LauncherAppWidgetInfo) info).providerName.getClassName().equals(widgetInfo.provider.getClassName())).call());
final Widget widget = mLauncher.getWorkspace().tryGetWidget(widgetInfo.label, DEFAULT_UI_TIMEOUT);
assertNotNull("Widget not found on the workspace", widget);
widget.launch(getAppPackageName());
}
Aggregations