summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mohammad Samiul Islam <samiul@google.com> 2020-07-27 20:02:58 +0100
committer Mohammad Samiul Islam <samiul@google.com> 2020-08-05 11:23:54 +0100
commitc34b5738f13da8a8fbf0628cb70c98fcd5928c86 (patch)
tree11af5e117c1ffc9e40fa367ecd85039996986d78
parent22e36b1ac0c83e5803da51e3e494aa23f42edef2 (diff)
Remove duplicate logic from ModuleTestUtils
Bug: 160296318 Test: atest StagedInstallInternalTest Change-Id: Ia31fc9d5246203da1869cc6d0e6ffcfc8d794080
-rw-r--r--tests/StagedInstallTest/Android.bp1
-rw-r--r--tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java8
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/StagedInstallTest/Android.bp b/tests/StagedInstallTest/Android.bp
index da6018e2e2c9..530d0e492f2e 100644
--- a/tests/StagedInstallTest/Android.bp
+++ b/tests/StagedInstallTest/Android.bp
@@ -29,6 +29,7 @@ java_test_host {
"compatibility-tradefed",
"frameworks-base-hostutils",
"module_test_util",
+ "cts-install-lib-host",
],
data: [
":com.android.apex.cts.shim.v2_prebuilt",
diff --git a/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java b/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
index 7cfbdc2b5062..5285b04f67d7 100644
--- a/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
+++ b/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
+import com.android.cts.install.lib.host.InstallUtilsHost;
import com.android.ddmlib.Log;
import com.android.tests.rollback.host.AbandonSessionsRule;
import com.android.tests.util.ModuleTestUtils;
@@ -49,6 +50,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
private static final String APK_A = "TestAppAv1.apk";
private final ModuleTestUtils mTestUtils = new ModuleTestUtils(this);
+ private final InstallUtilsHost mHostUtils = new InstallUtilsHost(this);
/**
* Runs the given phase of a test by calling into the device.
@@ -93,7 +95,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
@Test
public void testAdbStagedInstallWaitForReadyFlagWorks() throws Exception {
assumeTrue("Device does not support updating APEX",
- mTestUtils.isApexUpdateSupported());
+ mHostUtils.isApexUpdateSupported());
File apexFile = mTestUtils.getTestFile(SHIM_V2);
String output = getDevice().executeAdbCommand("install", "--staged",
@@ -107,7 +109,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
@Test
public void testAdbStagedInstallNoWaitFlagWorks() throws Exception {
assumeTrue("Device does not support updating APEX",
- mTestUtils.isApexUpdateSupported());
+ mHostUtils.isApexUpdateSupported());
File apexFile = mTestUtils.getTestFile(SHIM_V2);
String output = getDevice().executeAdbCommand("install", "--staged",
@@ -122,7 +124,7 @@ public class StagedInstallInternalTest extends BaseHostJUnit4Test {
@Test
public void testAdbInstallMultiPackageCommandWorks() throws Exception {
assumeTrue("Device does not support updating APEX",
- mTestUtils.isApexUpdateSupported());
+ mHostUtils.isApexUpdateSupported());
File apexFile = mTestUtils.getTestFile(SHIM_V2);
File apkFile = mTestUtils.getTestFile(APK_A);