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

Unified Diff: chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManagerTest.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/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManagerTest.java
diff --git a/chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManagerTest.java b/chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManagerTest.java
index 7aa44891e09d856aed7b48701aac49beff213944..6f486c90c7f5fecdd5951a0698805954b48b31b9 100644
--- a/chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManagerTest.java
+++ b/chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManagerTest.java
@@ -17,7 +17,8 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.robolectric.Robolectric;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.Shadows;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
@@ -44,7 +45,7 @@ public class WebApkServiceConnectionManagerTest {
@Before
public void setUp() {
- mShadowApplication = Robolectric.shadowOf(Robolectric.application);
+ mShadowApplication = Shadows.shadowOf(RuntimeEnvironment.application);
mConnectionManager = new WebApkServiceConnectionManager();
}
@@ -57,8 +58,8 @@ public class WebApkServiceConnectionManagerTest {
TestCallback callback1 = new TestCallback();
TestCallback callback2 = new TestCallback();
- mConnectionManager.connect(Robolectric.application, WEB_APK_PACKAGE, callback1);
- mConnectionManager.connect(Robolectric.application, WEB_APK_PACKAGE, callback2);
+ mConnectionManager.connect(RuntimeEnvironment.application, WEB_APK_PACKAGE, callback1);
+ mConnectionManager.connect(RuntimeEnvironment.application, WEB_APK_PACKAGE, callback2);
// Only one connection should have been created.
Assert.assertEquals(WEB_APK_PACKAGE, getNextStartedServicePackage());
@@ -94,7 +95,7 @@ public class WebApkServiceConnectionManagerTest {
public Context getApplicationContext() {
// Need to return real context so that ContextUtils#fetchAppSharedPreferences() does
// not crash.
- return Robolectric.application;
+ return RuntimeEnvironment.application;
}
// Create pending connection.
@@ -128,12 +129,14 @@ public class WebApkServiceConnectionManagerTest {
*/
@Test
public void testDisconnectConnect() throws Exception {
- mConnectionManager.connect(Robolectric.application, WEB_APK_PACKAGE, new TestCallback());
+ mConnectionManager.connect(
+ RuntimeEnvironment.application, WEB_APK_PACKAGE, new TestCallback());
Assert.assertEquals(WEB_APK_PACKAGE, getNextStartedServicePackage());
Assert.assertEquals(null, getNextStartedServicePackage());
- mConnectionManager.disconnect(Robolectric.application, WEB_APK_PACKAGE);
- mConnectionManager.connect(Robolectric.application, WEB_APK_PACKAGE, new TestCallback());
+ mConnectionManager.disconnect(RuntimeEnvironment.application, WEB_APK_PACKAGE);
+ mConnectionManager.connect(
+ RuntimeEnvironment.application, WEB_APK_PACKAGE, new TestCallback());
Assert.assertEquals(WEB_APK_PACKAGE, getNextStartedServicePackage());
Assert.assertEquals(null, getNextStartedServicePackage());
}

Powered by Google App Engine
This is Rietveld 408576698