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

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

Issue 2767613002: Expose resources in Robolectric/JUnit tests. (Closed)
Patch Set: rebase! Created 3 years, 8 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..7b2e28e971c768dd973935b1bf8bb137085ef1c7 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,10 @@ public class LocalRobolectricTestRunner extends RobolectricTestRunner {
@Override
protected Config buildGlobalConfig() {
- return new Config.Builder().setSdk(DEFAULT_SDK).build();
+ String packageName =
+ System.getProperty("chromium.robolectric.package.name", DEFAULT_PACKAGE_NAME);
+
+ return new Config.Builder().setSdk(DEFAULT_SDK).setPackageName(packageName).build();
}
@Override

Powered by Google App Engine
This is Rietveld 408576698