commit | a03c3d35be5282fbf3b173de5f6e74dd6d381a69 | [log] [tgz] |
---|---|---|
author | Vadim Tryshev <vadimt@google.com> | Fri Jun 04 20:03:36 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Jun 04 20:03:36 2021 +0000 |
tree | 14f730aeee63723bd5a4b47798b290ee80536091 | |
parent | 1242e666f71bd70771fc29cf54e294200bdefb95 [diff] | |
parent | 7ab7138fb10267b14100c47ab5399fb8e7a756eb [diff] |
Merge "Improve diagnostics when cannot install wellbeing test apk" into sc-dev am: 1ba5a68e31 am: 301ffa6502 am: 7ab7138fb1 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14682231 Change-Id: If084188e4d7ef4e4303bf67bf1553124b2bb9708
diff --git a/tests/src/com/android/launcher3/util/TestUtil.java b/tests/src/com/android/launcher3/util/TestUtil.java index 55e5744..67f3902 100644 --- a/tests/src/com/android/launcher3/util/TestUtil.java +++ b/tests/src/com/android/launcher3/util/TestUtil.java
@@ -22,6 +22,8 @@ import androidx.test.uiautomator.UiDevice; +import org.junit.Assert; + import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -48,7 +50,10 @@ in.close(); out.close(); - UiDevice.getInstance(getInstrumentation()).executeShellCommand("pm install " + apkFilename); + final String result = UiDevice.getInstance(getInstrumentation()) + .executeShellCommand("pm install " + apkFilename); + Assert.assertTrue("Failed to install wellbeing test apk; make sure the device is rooted", + "Success".equals(result.replaceAll("\\s+", ""))); } public static void uninstallDummyApp() throws IOException {