Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fb8aa09 authored by Victor Hsieh's avatar Victor Hsieh
Browse files

Switch placeholder app in test to another

I'm removing ApkVerityTestApp soon, so switch the placeholder app here
to another (instead of maintaining our own copy) from
frameworks/base/tests/FeatureSplit/.

Bug: 277916185
Test: atest BinaryTransparencyHostTest
Change-Id: Iac0a9bc52221f626fe0eeeadcfebc3ad96d356a3
parent 9fbfb01e
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -35,6 +35,8 @@ java_test_host {
    data: [
    data: [
        ":BinaryTransparencyTestApp",
        ":BinaryTransparencyTestApp",
        ":EasterEgg",
        ":EasterEgg",
        ":FeatureSplitBase",
        ":FeatureSplit1",
        ":com.android.apex.cts.shim.v2_rebootless_prebuilt",
        ":com.android.apex.cts.shim.v2_rebootless_prebuilt",
    ],
    ],
    test_suites: [
    test_suites: [
+5 −5
Original line number Original line Diff line number Diff line
@@ -91,20 +91,20 @@ public final class BinaryTransparencyHostTest extends BaseHostJUnit4Test {
    public void testCollectAllSilentInstalledMbaInfo() throws Exception {
    public void testCollectAllSilentInstalledMbaInfo() throws Exception {
        try {
        try {
            new InstallMultiple()
            new InstallMultiple()
                .addFile("ApkVerityTestApp.apk")
                .addFile("FeatureSplitBase.apk")
                .addFile("ApkVerityTestAppSplit.apk")
                .addFile("FeatureSplit1.apk")
                .run();
                .run();
            updatePreloadApp();
            updatePreloadApp();
            assertNotNull(getDevice().getAppPackageInfo("com.android.apkverity"));
            assertNotNull(getDevice().getAppPackageInfo("com.android.test.split.feature"));
            assertNotNull(getDevice().getAppPackageInfo("com.android.egg"));
            assertNotNull(getDevice().getAppPackageInfo("com.android.egg"));


            assertTrue(getDevice().setProperty("debug.transparency.bg-install-apps",
            assertTrue(getDevice().setProperty("debug.transparency.bg-install-apps",
                        "com.android.apkverity,com.android.egg"));
                        "com.android.test.split.feature,com.android.egg"));
            runDeviceTest("testCollectAllSilentInstalledMbaInfo");
            runDeviceTest("testCollectAllSilentInstalledMbaInfo");
        } finally {
        } finally {
            // No need to wait until job complete, since we can't verifying very meaningfully.
            // No need to wait until job complete, since we can't verifying very meaningfully.
            cancelPendingJob();
            cancelPendingJob();
            uninstallPackage("com.android.apkverity");
            uninstallPackage("com.android.test.split.feature");
            uninstallPackage("com.android.egg");
            uninstallPackage("com.android.egg");
        }
        }
    }
    }
+2 −2
Original line number Original line Diff line number Diff line
@@ -121,7 +121,7 @@ public class BinaryTransparencyTest {
        // Verify
        // Verify
        assertThat(appInfoList).isNotEmpty();  // because we just installed from the host side
        assertThat(appInfoList).isNotEmpty();  // because we just installed from the host side


        var expectedAppNames = Set.of("com.android.apkverity", "com.android.egg");
        var expectedAppNames = Set.of("com.android.test.split.feature", "com.android.egg");
        var actualAppNames = appInfoList.stream().map((appInfo) -> appInfo.packageName)
        var actualAppNames = appInfoList.stream().map((appInfo) -> appInfo.packageName)
                .collect(Collectors.toList());
                .collect(Collectors.toList());
        assertThat(actualAppNames).containsAtLeastElementsIn(expectedAppNames);
        assertThat(actualAppNames).containsAtLeastElementsIn(expectedAppNames);
@@ -141,6 +141,6 @@ public class BinaryTransparencyTest {
                }
                }
            }
            }
        }
        }
        assertThat(actualSplitNames).containsExactly("feature_x");  // Name of ApkVerityTestAppSplit
        assertThat(actualSplitNames).containsExactly("feature1");  // Name of FeatureSplit1
    }
    }
}
}