diff options
author | vadimt <vadimt@google.com> | 2019-06-20 14:26:19 -0700 |
---|---|---|
committer | vadimt <vadimt@google.com> | 2019-06-20 14:26:19 -0700 |
commit | e244a5802d48c1d57279e5a95eacc97156f96a04 (patch) | |
tree | 39a982c1c1f7ced22ae74ddcbd67aef65c4dd2f6 /tests | |
parent | 3bd876ba906e2df5873d1bdada0342a145999aef (diff) | |
download | android_packages_apps_Trebuchet-e244a5802d48c1d57279e5a95eacc97156f96a04.tar.gz android_packages_apps_Trebuchet-e244a5802d48c1d57279e5a95eacc97156f96a04.tar.bz2 android_packages_apps_Trebuchet-e244a5802d48c1d57279e5a95eacc97156f96a04.zip |
Tests: waiting for nav bar to match nav mode
Change-Id: Ib17fce4577e1e2c585108f0e95a98fad710e5eb2
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 22b04fb04..9336806ae 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -315,18 +315,26 @@ public final class LauncherInstrumentation { mExpectedRotation = expectedRotation; } - private UiObject2 verifyContainerType(ContainerType containerType) { - assertEquals("Unexpected display rotation", - mExpectedRotation, mDevice.getDisplayRotation()); + public String getNavigationModeMismatchError() { final NavigationModel navigationModel = getNavigationModel(); final boolean hasRecentsButton = hasSystemUiObject("recent_apps"); final boolean hasHomeButton = hasSystemUiObject("home"); - assertTrue("Presence of recents button doesn't match the interaction mode, mode=" - + navigationModel.name() + ", hasRecents=" + hasRecentsButton, - (navigationModel == NavigationModel.THREE_BUTTON) == hasRecentsButton); - assertTrue("Presence of home button doesn't match the interaction mode, mode=" - + navigationModel.name() + ", hasHome=" + hasHomeButton, - (navigationModel != NavigationModel.ZERO_BUTTON) == hasHomeButton); + if ((navigationModel == NavigationModel.THREE_BUTTON) != hasRecentsButton) { + return "Presence of recents button doesn't match the interaction mode, mode=" + + navigationModel.name() + ", hasRecents=" + hasRecentsButton; + } + if ((navigationModel != NavigationModel.ZERO_BUTTON) != hasHomeButton) { + return "Presence of home button doesn't match the interaction mode, mode=" + + navigationModel.name() + ", hasHome=" + hasHomeButton; + } + return null; + } + + private UiObject2 verifyContainerType(ContainerType containerType) { + assertEquals("Unexpected display rotation", + mExpectedRotation, mDevice.getDisplayRotation()); + final String error = getNavigationModeMismatchError(); + assertTrue(error, error == null); log("verifyContainerType: " + containerType); try (Closable c = addContextLayer( |