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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTestRunner.java

Issue 2243353002: (Reland) Update all Robolectric tests to Robolectric 3.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTestRunner.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTestRunner.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTestRunner.java
new file mode 100644
index 0000000000000000000000000000000000000000..bf13eb12fab9aeff18914b2ac79f8cacf538f1ce
--- /dev/null
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTestRunner.java
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.offlinepages;
+
+import org.chromium.testing.local.LocalRobolectricTestRunner;
+import org.junit.runners.model.InitializationError;
+import org.robolectric.internal.bytecode.InstrumentationConfiguration;
+
+/**
+ * Custom Robolectric test runner that instruments the com.google.android.gms.gcm package
+ * so Shadows of those classes can be created.
+ */
+public class OfflinePageTestRunner extends LocalRobolectricTestRunner {
+
+ /**
+ * OfflinePageTestRunner constructor
+ */
+ public OfflinePageTestRunner(Class<?> testClass) throws InitializationError {
+ super(testClass);
+ }
+
+ @Override
+ public InstrumentationConfiguration createClassLoaderConfig() {
+ InstrumentationConfiguration.Builder builder = InstrumentationConfiguration.newBuilder();
+ builder.addInstrumentedPackage("com.google.android.gms.gcm");
+ return builder.build();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698