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()); |
} |