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

Commit bcf10caa authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adopt robolectric 3.5.1"

parents 01bd4f3b 0189ce1b
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;
            }
        };
    }

}