Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1669)

Unified Diff: testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java

Issue 2767613002: Expose resources in Robolectric/JUnit tests. (Closed)
Patch Set: Expose resources in Robolectric/JUnit tests. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java
diff --git a/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java b/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java
index ae72114f37ab032cedaac73d8f4c3798333876d7..620d314e733568cbf343671e43cf0110cef90f6c 100644
--- a/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java
+++ b/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java
@@ -14,6 +14,7 @@ import org.robolectric.internal.ManifestFactory;
*/
public class LocalRobolectricTestRunner extends RobolectricTestRunner {
private static final int DEFAULT_SDK = 25;
+ private static final String DEFAULT_PACKAGE_NAME = "org.robolectric.default";
public LocalRobolectricTestRunner(Class<?> testClass) throws InitializationError {
super(testClass);
@@ -21,7 +22,17 @@ public class LocalRobolectricTestRunner extends RobolectricTestRunner {
@Override
protected Config buildGlobalConfig() {
- return new Config.Builder().setSdk(DEFAULT_SDK).build();
+ String manifestPath = System.getProperty("chromium.robolectric.manifest");
+ String packageName =
+ System.getProperty("chromium.robolectric.package.name", DEFAULT_PACKAGE_NAME);
+ String resourceDir = System.getProperty("chromium.robolectric.resource.dir");
+
+ return new Config.Builder()
+ .setSdk(DEFAULT_SDK)
+ .setPackageName(packageName)
+ .setResourceDir(resourceDir)
+ .setManifest(manifestPath)
+ .build();
}
@Override

Powered by Google App Engine
This is Rietveld 408576698