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

Commit 2b1b3b28 authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

Push OverlayDeviceTests onto /system

Since OverlayDeviceTests needs to use the OverlayManager API directly,
push the test APk onto the system image and reboot the device before
running tests.

Bug: 119916381
Test: atest OverlayDeviceTests
Change-Id: I8f54e1532902b984e32da68ed8aa32bf6c5b9272
parent ac6bbdb6
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -16,7 +16,11 @@ android_test {
    name: "OverlayDeviceTests",
    srcs: ["src/**/*.java"],
    platform_apis: true,
    static_libs: ["androidx.test.rules"],
    certificate: "platform",
    static_libs: [
        "androidx.test.rules",
        "testng",
    ],
    test_suites: ["device-tests"],
    data: [
        ":OverlayDeviceTests_AppOverlayOne",
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@

    <uses-sdk android:minSdkVersion="21" />

    <uses-permission android:name="android.permission.CHANGE_OVERLAY_PACKAGES" />

    <application>
        <uses-library android:name="android.test.runner"/>
    </application>
+12 −1
Original line number Diff line number Diff line
@@ -19,9 +19,20 @@
    <option name="test-suite-tag" value="apct" />
    <option name="test-suite-tag" value="apct-instrumentation" />

    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
        <option name="cleanup" value="true" />
        <option name="remount-system" value="true" />
        <option name="push" value="OverlayDeviceTests.apk->/system/app/OverlayDeviceTests.apk" />
    </target_preparer>
  
    <!-- Reboot to have the test APK scanned by PM and reboot after to remove the test APK. -->
    <target_preparer class="com.android.tradefed.targetprep.RebootTargetPreparer">
      <option name="pre-reboot" value="true" />
      <option name="post-reboot" value="true" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
        <option name="cleanup-apks" value="true" />
        <option name="test-file-name" value="OverlayDeviceTests.apk" />
        <option name="test-file-name" value="OverlayDeviceTests_AppOverlayOne.apk" />
        <option name="test-file-name" value="OverlayDeviceTests_AppOverlayTwo.apk" />
        <option name="test-file-name" value="OverlayDeviceTests_FrameworkOverlay.apk" />
+1 −1
Original line number Diff line number Diff line
@@ -15,6 +15,6 @@
android_test {
    name: "OverlayDeviceTests_AppOverlayOne",
    sdk_version: "current",

    certificate: "platform",
    aaptflags: ["--no-resource-removal"],
}
+1 −1
Original line number Diff line number Diff line
@@ -15,6 +15,6 @@
android_test {
    name: "OverlayDeviceTests_AppOverlayTwo",
    sdk_version: "current",

    certificate: "platform",
    aaptflags: ["--no-resource-removal"],
}