diff options
author | Vadim Tryshev <vadimt@google.com> | 2019-06-28 21:56:10 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-06-28 21:56:10 +0000 |
commit | 026914e1901fa337c93e4249976b215ba287654a (patch) | |
tree | 3eb63f196c42235c1477825fa6142efd70e79abb /tests/tapl | |
parent | b63693ba3e6cd41e7e012b24e39ba39cf62570f4 (diff) | |
parent | 881a31560d79c1fa963c8c9d129cc89f1456cd60 (diff) | |
download | android_packages_apps_Trebuchet-026914e1901fa337c93e4249976b215ba287654a.tar.gz android_packages_apps_Trebuchet-026914e1901fa337c93e4249976b215ba287654a.tar.bz2 android_packages_apps_Trebuchet-026914e1901fa337c93e4249976b215ba287654a.zip |
Merge "Diagnosing launcher visible state in TAPL" into ub-launcher3-qt-r1-dev
Diffstat (limited to 'tests/tapl')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 2cda7b766..11b0665d9 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -270,11 +270,21 @@ public final class LauncherInstrumentation { return "System alert popup is visible: " + object.getText(); } + if (hasSystemUiObject("keyguard_status_view")) return "Phone is locked"; + if (!mDevice.hasObject(By.textStartsWith(""))) return "Screen is empty"; return null; } + private String getVisibleStateMessage() { + if (hasLauncherObject(WIDGETS_RES_ID)) return "Widgets"; + if (hasLauncherObject(OVERVIEW_RES_ID)) return "Overview"; + if (hasLauncherObject(WORKSPACE_RES_ID)) return "Workspace"; + if (hasLauncherObject(APPS_RES_ID)) return "AllApps"; + return "Background"; + } + private static String truncateCrash(String text, int maxLines) { String[] lines = text.split("\\r?\\n"); StringBuilder ret = new StringBuilder(); @@ -354,7 +364,11 @@ public final class LauncherInstrumentation { message = "http://go/tapl : " + getContextDescription() + message; final String anomaly = getAnomalyMessage(); - if (anomaly != null) message = anomaly + ", which causes:\n" + message; + if (anomaly != null) { + message = anomaly + ", which causes:\n" + message; + } else { + message = message + " (visible state: " + getVisibleStateMessage() + ")"; + } final String systemHealth = getSystemHealthMessage(); if (systemHealth != null) { |