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

Commit 6115858c authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

Refactor ResourcesLoader Tests

This change refactors the tests for ResourcesLoaders to support the
new concept of loaders owning providers.

Bug: 147359613
Test: atest ResourceLoaderTests
Change-Id: Id61dc27bf5876afe10c25ed57333541131e910b7
parent 4579c0ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ public class ResourcesManagerPerfTest {
    private void getResourcesForPath(String path) {
        ResourcesManager.getInstance().getResources(null, path, null, null, null,
                Display.DEFAULT_DISPLAY, null, sContext.getResources().getCompatibilityInfo(),
                null);
                null, null);
    }

    @Test
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ public class ResourcesThemePerfTest {

        Resources destResources = resourcesManager.getResources(null, ai.sourceDir,
                ai.splitSourceDirs, ai.resourceDirs, ai.sharedLibraryFiles, Display.DEFAULT_DISPLAY,
                c, mContext.getResources().getCompatibilityInfo(), null);
                c, mContext.getResources().getCompatibilityInfo(), null, null);
        Assert.assertNotEquals(destResources.getAssets(), mContext.getAssets());

        Resources.Theme destTheme = destResources.newTheme();
+3 −2
Original line number Diff line number Diff line
@@ -32,15 +32,16 @@ android_test {
        "truth-prebuilt",
    ],
    resource_zips: [ ":FrameworksResourceLoaderTestsAssets" ],
    platform_apis: true,
    test_suites: ["device-tests"],
    sdk_version: "test_current",
    aaptflags: [
        "--no-compress",
    ],
    data: [
        ":FrameworksResourceLoaderTestsOverlay",
        ":FrameworksResourceLoaderTestsSplitOne",
        ":FrameworksResourceLoaderTestsSplitTwo",
        ":FrameworksResourceLoaderTestsSplitThree",
        ":FrameworksResourceLoaderTestsSplitFour",
    ],
    java_resources: [ "NonAsset.txt" ]
}
+1 −7
Original line number Diff line number Diff line
@@ -22,13 +22,7 @@
        <option name="cleanup-apks" value="true" />
        <!-- The following value cannot be multi-line as whitespace is parsed by the installer -->
        <option name="split-apk-file-names"
            value="FrameworksResourceLoaderTests.apk,FrameworksResourceLoaderTestsSplitOne.apk,FrameworksResourceLoaderTestsSplitTwo.apk" />
        <option name="test-file-name" value="FrameworksResourceLoaderTestsOverlay.apk" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <option name="run-command"
            value="cmd overlay disable android.content.res.loader.test.overlay" />
            value="FrameworksResourceLoaderTests.apk,FrameworksResourceLoaderTestsSplitOne.apk,FrameworksResourceLoaderTestsSplitTwo.apk,FrameworksResourceLoaderTestsSplitThree.apk,FrameworksResourceLoaderTestsSplitFour.apk" />
    </target_preparer>

    <test class="com.android.tradefed.testtype.AndroidJUnitTest">
+817 B (963 B)
Loading image diff...
Loading