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

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

Issue 2760743002: Add support for robolectric play-services-shadows. (Closed)
Patch Set: Updated robolectric DEPS to pull in hard-coded file 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: chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java
index eebc3aa306160866b0751d16bbe153ecbde526c9..6b3bed9b2f1f6a77dd756c5cb7d76c0ad542a78a 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/BackgroundOfflinerTaskTest.java
@@ -15,6 +15,8 @@ import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
+import com.google.android.gms.common.ConnectionResult;
+import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.gcm.GcmNetworkManager;
import com.google.android.gms.gcm.Task;
@@ -26,6 +28,8 @@ import org.junit.runner.RunWith;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.robolectric.internal.ShadowExtractor;
+import org.robolectric.shadows.gms.Shadows;
+import org.robolectric.shadows.gms.common.ShadowGoogleApiAvailability;
import org.chromium.base.ActivityState;
import org.chromium.base.ApplicationStatus;
@@ -71,6 +75,8 @@ public class BackgroundOfflinerTaskTest {
@Before
public void setUp() throws Exception {
+ Shadows.shadowOf(GoogleApiAvailability.getInstance())
+ .setIsGooglePlayServicesAvailable(ConnectionResult.SUCCESS);
ShadowDeviceConditions.setCurrentConditions(mDeviceConditions);
// Build a bundle with trigger conditions.

Powered by Google App Engine
This is Rietveld 408576698