Loading tests/tapl/com/android/launcher3/tapl/AppIcon.java +15 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public final class AppIcon { /** * Clicks the icon to launch its app. */ @Deprecated public Background launch() { LauncherInstrumentation.log("AppIcon.launch before click"); LauncherInstrumentation.assertTrue( Loading @@ -50,6 +51,20 @@ public final class AppIcon { return new Background(mLauncher); } /** * Clicks the icon to launch its app. */ public Background launch(String packageName) { LauncherInstrumentation.log("AppIcon.launch before click"); LauncherInstrumentation.assertTrue( "Launching an app didn't open a new window: " + mIcon.getText(), mIcon.clickAndWait(Until.newWindow(), LauncherInstrumentation.WAIT_TIME_MS)); LauncherInstrumentation.assertTrue( "App didn't start: " + packageName, mLauncher.getDevice().wait(Until.hasObject( By.pkg(packageName).depth(0)), LauncherInstrumentation.WAIT_TIME_MS)); return new Background(mLauncher); } UiObject2 getIcon() { return mIcon; } Loading Loading
tests/tapl/com/android/launcher3/tapl/AppIcon.java +15 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public final class AppIcon { /** * Clicks the icon to launch its app. */ @Deprecated public Background launch() { LauncherInstrumentation.log("AppIcon.launch before click"); LauncherInstrumentation.assertTrue( Loading @@ -50,6 +51,20 @@ public final class AppIcon { return new Background(mLauncher); } /** * Clicks the icon to launch its app. */ public Background launch(String packageName) { LauncherInstrumentation.log("AppIcon.launch before click"); LauncherInstrumentation.assertTrue( "Launching an app didn't open a new window: " + mIcon.getText(), mIcon.clickAndWait(Until.newWindow(), LauncherInstrumentation.WAIT_TIME_MS)); LauncherInstrumentation.assertTrue( "App didn't start: " + packageName, mLauncher.getDevice().wait(Until.hasObject( By.pkg(packageName).depth(0)), LauncherInstrumentation.WAIT_TIME_MS)); return new Background(mLauncher); } UiObject2 getIcon() { return mIcon; } Loading