commit | 749e5071092d3f6bc0ac0df23308e13ba89ec780 | [log] [tgz] |
---|---|---|
author | Vadim Tryshev <vadimt@google.com> | Fri Jun 04 19:33:03 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Jun 04 19:33:03 2021 +0000 |
tree | 9bf35444cadcbcecf096769e1b67a2d9b1d2d7f7 | |
parent | d4ccaa1de6c5f3b6cb6155c1979b4829c4ef1a0a [diff] | |
parent | 1ba5a68e31f9c0666857002a76bdd191a0c72a38 [diff] |
Merge "Improve diagnostics when cannot install wellbeing test apk" into sc-dev am: 1ba5a68e31 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14682231 Change-Id: I118d84ba28a4af3eb2f6eec7c9af691e34f1a694
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 {