summaryrefslogtreecommitdiffstats
path: root/tests/tapl
diff options
context:
space:
mode:
authorVadim Tryshev <vadimt@google.com>2018-09-18 20:01:43 -0700
committerVadim Tryshev <vadimt@google.com>2018-09-18 20:03:28 -0700
commit3c6607e29814837d23222fe22994a7a4a142f5be (patch)
treefcb808ab9bbed3388b024fa00ff7b43ed92a4a8d /tests/tapl
parentee598ada7995e6797298617efad2dac42fb73bab (diff)
downloadandroid_packages_apps_Trebuchet-3c6607e29814837d23222fe22994a7a4a142f5be.tar.gz
android_packages_apps_Trebuchet-3c6607e29814837d23222fe22994a7a4a142f5be.tar.bz2
android_packages_apps_Trebuchet-3c6607e29814837d23222fe22994a7a4a142f5be.zip
Add more checks to AppIcon.launch()
Apparently, one platform tests starts Messages, and Messages simply doesn't start. This check will help to hunt down the problem. Bug: 110103162 Test: affected tests Change-Id: I8d781647a2e680e31e96db40d94b89e7728aaf11
Diffstat (limited to 'tests/tapl')
-rw-r--r--tests/tapl/com/android/launcher3/tapl/AppIcon.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AppIcon.java b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
index ea47503eb..a11f6df0a 100644
--- a/tests/tapl/com/android/launcher3/tapl/AppIcon.java
+++ b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
@@ -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(
@@ -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;
}