diff options
author | vadimt <vadimt@google.com> | 2019-03-27 11:06:10 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-03-27 11:06:10 -0700 |
commit | 64df57944649626fd20d05335a333c4012b89ddf (patch) | |
tree | 418fdef5f6d1afaff06c37339ab5fe357fe22c1e /tests/tapl | |
parent | 522cc2ff0c2eca5414302ab8262efffb2256f43e (diff) | |
download | android_packages_apps_Trebuchet-64df57944649626fd20d05335a333c4012b89ddf.tar.gz android_packages_apps_Trebuchet-64df57944649626fd20d05335a333c4012b89ddf.tar.bz2 android_packages_apps_Trebuchet-64df57944649626fd20d05335a333c4012b89ddf.zip |
Improving TAPL diags
Bug: 128531133
Change-Id: Iba33011b5cb315731b5104005ef5773e539a21ea
Diffstat (limited to 'tests/tapl')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 19b368f4f..652322e55 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -320,20 +320,21 @@ public final class LauncherInstrumentation { // We need waiting for any accessibility event generated after pressing Home because // otherwise waitForIdle may return immediately in case when there was a big enough pause in // accessibility events prior to pressing Home. + final String action; if (getNavigationModel() == NavigationModel.ZERO_BUTTON) { if (hasLauncherObject(WORKSPACE_RES_ID)) { - log("0-button pressHome: already in workspace"); + log(action = "0-button: already in workspace"); } else if (hasLauncherObject(OVERVIEW_RES_ID)) { - log("0-button pressHome: overview"); + log(action = "0-button: from overview"); mDevice.pressHome(); } else if (hasLauncherObject(WIDGETS_RES_ID)) { - log("0-button pressHome: widgets"); + log(action = "0-button: from widgets"); mDevice.pressHome(); } else if (hasLauncherObject(APPS_RES_ID)) { - log("0-button pressHome: all apps"); + log(action = "0-button: from all apps"); mDevice.pressHome(); } else { - log("0-button pressHome: another app"); + log(action = "0-button: from another app"); assertTrue("Launcher is visible, don't know how to go home", !mDevice.hasObject(By.pkg(getLauncherPackageName()))); final UiObject2 navBar = waitForSystemUiObject("navigation_bar_frame"); @@ -344,6 +345,7 @@ public final class LauncherInstrumentation { BACKGROUND_APP_STATE_ORDINAL, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME); } } else { + log(action = "clicking home button"); executeAndWaitForEvent( () -> { log("LauncherInstrumentation.pressHome before clicking"); @@ -363,7 +365,10 @@ public final class LauncherInstrumentation { "Pressing Home didn't produce any events"); mDevice.waitForIdle(); } - return getWorkspace(); + try (LauncherInstrumentation.Closable c = addContextLayer( + "performed action to switch to Home - " + action)) { + return getWorkspace(); + } } /** |