use of com.android.launcher3.tapl.AppIcon in project android_packages_apps_Trebuchet by LineageOS.
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.tapl.AppIcon in project android_packages_apps_Launcher3 by ArrowOS.
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.tapl.AppIcon in project android_packages_apps_Launcher3 by ArrowOS.
the class TaplTestsLauncher3 method testDeleteFromWorkspace.
@Test
@PortraitLandscape
public void testDeleteFromWorkspace() throws Exception {
// test delete both built-in apps and user-installed app from workspace
for (String appName : new String[] { "Gmail", "Play Store", APP_NAME }) {
final AppIcon appIcon = createShortcutIfNotExist(appName);
Workspace workspace = mLauncher.getWorkspace().deleteAppIcon(appIcon);
assertNull(appName + " app was found after being deleted from workspace", workspace.tryGetWorkspaceAppIcon(appName));
}
}
use of com.android.launcher3.tapl.AppIcon in project android_packages_apps_Launcher3 by ProtonAOSP.
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.tapl.AppIcon in project android_packages_apps_Launcher3 by ProtonAOSP.
the class TaplTestsLauncher3 method testWorkspace.
@Test
public void testWorkspace() throws Exception {
final Workspace workspace = mLauncher.getWorkspace();
// Test that ensureWorkspaceIsScrollable adds a page by dragging an icon there.
executeOnLauncher(launcher -> assertFalse("Initial workspace state is scrollable", isWorkspaceScrollable(launcher)));
assertNull("Chrome app was found on empty workspace", workspace.tryGetWorkspaceAppIcon("Chrome"));
workspace.ensureWorkspaceIsScrollable();
executeOnLauncher(launcher -> assertEquals("Ensuring workspace scrollable didn't switch to next screen", workspace.pagesPerScreen(), getCurrentWorkspacePage(launcher)));
executeOnLauncher(launcher -> assertTrue("ensureScrollable didn't make workspace scrollable", isWorkspaceScrollable(launcher)));
assertNotNull("ensureScrollable didn't add Chrome app", workspace.getWorkspaceAppIcon("Chrome"));
// Test flinging workspace.
workspace.flingBackward();
assertTrue("Launcher internal state is not Home", isInState(() -> LauncherState.NORMAL));
executeOnLauncher(launcher -> assertEquals("Flinging back didn't switch workspace to page #0", 0, getCurrentWorkspacePage(launcher)));
workspace.flingForward();
executeOnLauncher(launcher -> assertEquals("Flinging forward didn't switch workspace to next screen", workspace.pagesPerScreen(), getCurrentWorkspacePage(launcher)));
assertTrue("Launcher internal state is not Home", isInState(() -> LauncherState.NORMAL));
// Test starting a workspace app.
final AppIcon app = workspace.getWorkspaceAppIcon("Chrome");
assertNotNull("No Chrome app in workspace", app);
}
Aggregations