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

Unified Diff: net/android/junit/src/org/chromium/net/HttpNegotiateAuthenticatorTest.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
« no previous file with comments | « net/android/BUILD.gn ('k') | testing/android/junit/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/junit/src/org/chromium/net/HttpNegotiateAuthenticatorTest.java
diff --git a/net/android/junit/src/org/chromium/net/HttpNegotiateAuthenticatorTest.java b/net/android/junit/src/org/chromium/net/HttpNegotiateAuthenticatorTest.java
index 09485e348783d206d1aa987c94c04a15e046f03b..e42fc48f0a47ab6cca3fca1b83949dc173e11d48 100644
--- a/net/android/junit/src/org/chromium/net/HttpNegotiateAuthenticatorTest.java
+++ b/net/android/junit/src/org/chromium/net/HttpNegotiateAuthenticatorTest.java
@@ -44,7 +44,6 @@ import junit.framework.Assert;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.BaseChromiumApplication;
import org.chromium.base.ContextUtils;
-import org.chromium.base.test.shadows.ShadowMultiDex;
import org.chromium.net.HttpNegotiateAuthenticator.GetAccountsCallback;
import org.chromium.net.HttpNegotiateAuthenticator.RequestData;
import org.chromium.testing.local.LocalRobolectricTestRunner;
@@ -57,11 +56,13 @@ import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.Robolectric;
+import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.shadows.ShadowAccountManager;
import org.robolectric.shadows.ShadowApplication;
+import org.robolectric.shadows.multidex.ShadowMultiDex;
import java.io.IOException;
import java.util.List;
@@ -98,7 +99,7 @@ public class HttpNegotiateAuthenticatorTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- ContextUtils.initApplicationContextForTests(Robolectric.application);
+ ContextUtils.initApplicationContextForTests(RuntimeEnvironment.application);
}
@After
@@ -239,13 +240,13 @@ public class HttpNegotiateAuthenticatorTest {
// Verify that the broadcast receiver is registered
Intent intent = new Intent(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION);
- ShadowApplication shadowApplication = Robolectric.getShadowApplication();
+ ShadowApplication shadowApplication = ShadowApplication.getInstance();
List<BroadcastReceiver> receivers = shadowApplication.getReceiversForIntent(intent);
assertThat("There is one registered broadcast receiver", receivers.size(), equalTo(1));
// Send the intent to the receiver.
BroadcastReceiver receiver = receivers.get(0);
- receiver.onReceive(Robolectric.getShadowApplication().getApplicationContext(), intent);
+ receiver.onReceive(ShadowApplication.getInstance().getApplicationContext(), intent);
// Verify that the auth token is properly requested from the account manager.
verify(sMockAccountManager).getAuthToken(
« no previous file with comments | « net/android/BUILD.gn ('k') | testing/android/junit/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698