diff options
author | Winson Chung <winsonc@google.com> | 2019-06-04 12:20:05 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2019-06-04 12:20:05 -0700 |
commit | a3ed49d566d9c2cabe17d5d4f0026f3d59f0a785 (patch) | |
tree | 09139ba2bf4725ca17c959fca1739034cbfa5053 /tests | |
parent | 0ef6fe00b0e2a7ef59db149b5031a0fbcdde86b2 (diff) | |
parent | 8789aa05a1b5af25c727814331ac126a3007c528 (diff) | |
download | android_packages_apps_Trebuchet-a3ed49d566d9c2cabe17d5d4f0026f3d59f0a785.tar.gz android_packages_apps_Trebuchet-a3ed49d566d9c2cabe17d5d4f0026f3d59f0a785.tar.bz2 android_packages_apps_Trebuchet-a3ed49d566d9c2cabe17d5d4f0026f3d59f0a785.zip |
Merging ub-launcher3-qt-dev, build 5633311
Test: Manual
Bug:119330044 P1 [STOPSHIP] Add back shape detection in Launcher icons
Bug:123900446 P1 App to home animation should zoom into the app icon
Bug:132298752 P1 Adding widget locks home screen page
Bug:132757019 P1 Swipe up twice quickly from app in 2 button mode; can't access all apps
Bug:133518678 P1 In 2 button mode, flinging up strongly favours quickswitch
Bug:133806285 P1 All apps causes overview to peek in
Bug:133844237 P1 Respect limited width Exclusion Rects in bottom area?
Bug:133867119 P2 Lab-only flake: want to switch from workspace to all apps; Swipe failed to receive an event for the swipe end
Bug:134062513 P1 Quickswitch sends lifecycle events to -1
Bug:134094839 P1 Launcher kept crashing on OTA update
Bug:134096917 P1 Launcher animation component gets stuck during swipe up
Bug:134164918 P1 STOPSHIP: Disable chips hard-coded value in qt_dev Launcher
Bug:134172603 P1 Tracing for lab-only flakes
Bug:134442147 P1 Sometimes All Apps won't update on app install/uninstall/update
Change-Id: Ia530fbf9bb5fa67b602ce44aef0cc4a1d1494e13
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/AllApps.java | 8 | ||||
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 22 |
2 files changed, 19 insertions, 11 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index 18a8f2755..d03035a87 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -20,8 +20,10 @@ import static com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel import android.graphics.Point; import android.graphics.Rect; +import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.test.uiautomator.By; import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.Direction; import androidx.test.uiautomator.UiObject2; @@ -42,6 +44,10 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { super(launcher); final UiObject2 allAppsContainer = verifyActiveContainer(); mHeight = allAppsContainer.getVisibleBounds().height(); + final UiObject2 appListRecycler = mLauncher.waitForObjectInContainer(allAppsContainer, + "apps_list_view"); + // Wait for the recycler to populate. + mLauncher.waitForObjectInContainer(appListRecycler, By.clazz(TextView.class)); } @Override @@ -115,7 +121,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { verifyActiveContainer(); } - final UiObject2 appIcon = mLauncher.getObjectInContainer(allAppsContainer, + final UiObject2 appIcon = mLauncher.getObjectInContainer(appListRecycler, appIconSelector); ensureIconVisible(appIcon, allAppsContainer, appListRecycler); return new AppIcon(mLauncher, appIcon); diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index f7befd140..e45fca8c0 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -21,9 +21,9 @@ import static android.content.pm.PackageManager.DONT_KILL_APP; import static android.content.pm.PackageManager.MATCH_ALL; import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS; +import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName; import static com.android.launcher3.testing.TestProtocol.BACKGROUND_APP_STATE_ORDINAL; import static com.android.launcher3.testing.TestProtocol.NORMAL_STATE_ORDINAL; -import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName; import android.app.ActivityManager; import android.app.Instrumentation; @@ -257,6 +257,7 @@ public final class LauncherInstrumentation { } private void fail(String message) { + log("Hierarchy dump for: " + getContextDescription() + message); dumpViewHierarchy(); Assert.fail("http://go/tapl : " + getContextDescription() + message); } @@ -570,6 +571,16 @@ public final class LauncherInstrumentation { return object; } + @NonNull + UiObject2 waitForObjectInContainer(UiObject2 container, BySelector selector) { + final UiObject2 object = container.wait( + Until.findObject(selector), + WAIT_TIME_MS); + assertNotNull("Can't find a launcher object id: " + selector + " in container: " + + container.getResourceName(), object); + return object; + } + @Nullable private boolean hasLauncherObject(String resId) { return mDevice.hasObject(getLauncherObjectSelector(resId)); @@ -581,11 +592,6 @@ public final class LauncherInstrumentation { } @NonNull - UiObject2 waitForLauncherObjectByClass(String clazz) { - return waitForObjectBySelector(getLauncherObjectSelectorByClass(clazz)); - } - - @NonNull UiObject2 waitForFallbackLauncherObject(String resName) { return waitForObjectBySelector(getFallbackLauncherObjectSelector(resName)); } @@ -600,10 +606,6 @@ public final class LauncherInstrumentation { return By.res(getLauncherPackageName(), resName); } - BySelector getLauncherObjectSelectorByClass(String clazz) { - return By.pkg(getLauncherPackageName()).clazz(clazz); - } - BySelector getFallbackLauncherObjectSelector(String resName) { return By.res(getOverviewPackageName(), resName); } |