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

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

Issue 2824863002: Revert of (Reland) Expose resources in Robolectric/JUnit tests. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.testing.local; 5 package org.chromium.testing.local;
6 6
7 import org.junit.runners.model.InitializationError; 7 import org.junit.runners.model.InitializationError;
8 import org.robolectric.RobolectricTestRunner; 8 import org.robolectric.RobolectricTestRunner;
9 import org.robolectric.annotation.Config; 9 import org.robolectric.annotation.Config;
10 import org.robolectric.internal.ManifestFactory; 10 import org.robolectric.internal.ManifestFactory;
11 11
12 /** 12 /**
13 * A custom Robolectric Junit4 Test Runner with Chromium specific settings. 13 * A custom Robolectric Junit4 Test Runner with Chromium specific settings.
14 */ 14 */
15 public class LocalRobolectricTestRunner extends RobolectricTestRunner { 15 public class LocalRobolectricTestRunner extends RobolectricTestRunner {
16 private static final int DEFAULT_SDK = 25; 16 private static final int DEFAULT_SDK = 25;
17 private static final String DEFAULT_PACKAGE_NAME = "org.robolectric.default" ;
18 17
19 public LocalRobolectricTestRunner(Class<?> testClass) throws InitializationE rror { 18 public LocalRobolectricTestRunner(Class<?> testClass) throws InitializationE rror {
20 super(testClass); 19 super(testClass);
21 } 20 }
22 21
23 @Override 22 @Override
24 protected Config buildGlobalConfig() { 23 protected Config buildGlobalConfig() {
25 String packageName = 24 return new Config.Builder().setSdk(DEFAULT_SDK).build();
26 System.getProperty("chromium.robolectric.package.name", DEFAULT_ PACKAGE_NAME);
27
28 return new Config.Builder().setSdk(DEFAULT_SDK).setPackageName(packageNa me).build();
29 } 25 }
30 26
31 @Override 27 @Override
32 protected ManifestFactory getManifestFactory(Config config) { 28 protected ManifestFactory getManifestFactory(Config config) {
33 return new GNManifestFactory(); 29 return new GNManifestFactory();
34 } 30 }
35 } 31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698