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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java

Issue 2872743003: Change AccountManagerHelper initialization
Patch Set: Created 3 years, 7 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/invalidation/InvalidationControllerTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
index f66bbd13e775c445f5bd4180a5314b2e33861292..0eb75446139305fd2b70767198aa2baea57bff5b 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java
@@ -12,9 +12,9 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.os.Bundle;
-import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
@@ -93,6 +93,12 @@ public class InvalidationControllerTest {
*/
private Set<String> mNonSessionTypes;
+ @BeforeClass
+ public static void overrideAccountManagerHelper() {
+ AccountManagerHelper.overrideAccountManagerHelperForTests(
+ new SystemAccountManagerDelegate());
+ }
+
@Before
public void setUp() throws Exception {
Activity activity = Robolectric.buildActivity(Activity.class).setup().get();
@@ -114,9 +120,6 @@ public class InvalidationControllerTest {
ContextUtils.initApplicationContextForTests(mContext.getApplicationContext());
- AccountManagerHelper.overrideAccountManagerHelperForTests(
- mContext, new SystemAccountManagerDelegate());
-
ModelTypeHelper.setTestDelegate(new ModelTypeHelper.TestDelegate() {
@Override
public String toNotificationType(int modelType) {
@@ -145,11 +148,6 @@ public class InvalidationControllerTest {
AndroidSyncSettings.enableChromeSync(mContext);
}
- @After
- public void tearDown() {
- AccountManagerHelper.resetAccountManagerHelperForTests();
- }
-
/**
* Verify the intent sent by InvalidationController#stop().
*/

Powered by Google App Engine
This is Rietveld 408576698