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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/signin/OAuth2TokenServiceIntegrationTest.java

Issue 2836373003: Reland of Reimplement AccountManagerHelper singleton instance creation (Closed)
Patch Set: Fixed ClearBrowsingDataPreferencesTest Created 3 years, 8 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/javatests/src/org/chromium/chrome/browser/signin/OAuth2TokenServiceIntegrationTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/OAuth2TokenServiceIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/OAuth2TokenServiceIntegrationTest.java
index 8500c46bc7e0d3a9d7baa0f3eab0f83c4628c914..2d97c009be287da069f12ce9c65f3f68fd7d4c61 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/OAuth2TokenServiceIntegrationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/OAuth2TokenServiceIntegrationTest.java
@@ -65,15 +65,17 @@ public class OAuth2TokenServiceIntegrationTest {
mapAccountNamesToIds();
ApplicationData.clearAppData(
InstrumentationRegistry.getInstrumentation().getTargetContext());
- mActivityTestRule.loadNativeLibraryAndInitBrowserProcess();
- // Set up AccountManager.
+ // loadNativeLibraryAndInitBrowserProcess will access AccountManagerHelper, so it should
+ // be initialized beforehand.
mContext = new AdvancedMockContext(
InstrumentationRegistry.getInstrumentation().getTargetContext());
mAccountManager = new MockAccountManager(
mContext, InstrumentationRegistry.getInstrumentation().getContext());
AccountManagerHelper.overrideAccountManagerHelperForTests(mContext, mAccountManager);
+ mActivityTestRule.loadNativeLibraryAndInitBrowserProcess();
+
// Make sure there is no account signed in yet.
mChromeSigninController = ChromeSigninController.get();
mChromeSigninController.setSignedInAccountName(null);
@@ -98,6 +100,7 @@ public class OAuth2TokenServiceIntegrationTest {
mOAuth2TokenService.validateAccounts(false);
}
});
+ AccountManagerHelper.resetAccountManagerHelperForTests();
}
private void mapAccountNamesToIds() {

Powered by Google App Engine
This is Rietveld 408576698