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

Commit 0189ce1b authored by James Lemieux's avatar James Lemieux
Browse files

Adopt robolectric 3.5.1

Bug: 70581603
Test: make RunSettingsLibRoboTests
Change-Id: I18dd5d74dae0570d2909998a0bab1d812b9f8f6e
parent e67de60f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \

LOCAL_JAVA_LIBRARIES := \
    junit \
    platform-robolectric-3.4.2-prebuilt
    platform-robolectric-3.5.1-prebuilt

LOCAL_INSTRUMENTATION_FOR := SettingsLibShell
LOCAL_MODULE := SettingsLibRoboTests
@@ -74,4 +74,4 @@ LOCAL_TEST_PACKAGE := SettingsLibShell

LOCAL_ROBOTEST_TIMEOUT := 36000

include prebuilts/misc/common/robolectric/3.4.2/run_robotests.mk
include prebuilts/misc/common/robolectric/3.5.1/run_robotests.mk
+14 −21
Original line number Diff line number Diff line
@@ -38,20 +38,11 @@ public class SettingsLibRobolectricTestRunner extends RobolectricTestRunner {
        final String resDir = appRoot + "/tests/robotests/res";
        final String assetsDir = appRoot + config.assetDir();

        final AndroidManifest manifest = new AndroidManifest(Fs.fileFromPath(manifestPath),
                Fs.fileFromPath(resDir), Fs.fileFromPath(assetsDir)) {
        return new AndroidManifest(Fs.fileFromPath(manifestPath), Fs.fileFromPath(resDir),
            Fs.fileFromPath(assetsDir), "com.android.settingslib") {
            @Override
            public List<ResourcePath> getIncludedResourcePaths() {
                List<ResourcePath> paths = super.getIncludedResourcePaths();
                SettingsLibRobolectricTestRunner.getIncludedResourcePaths(getPackageName(), paths);
                return paths;
            }
        };
        manifest.setPackageName("com.android.settingslib");
        return manifest;
    }

    static void getIncludedResourcePaths(String packageName, List<ResourcePath> paths) {
                paths.add(new ResourcePath(
                    null,
                    Fs.fileFromPath("./frameworks/base/packages/SettingsLib/res"),
@@ -64,6 +55,8 @@ public class SettingsLibRobolectricTestRunner extends RobolectricTestRunner {
                    null,
                    Fs.fileFromPath("./frameworks/support/v7/appcompat/res"),
                    null));
                return paths;
            }
        };
    }

}