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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.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/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java
index f58294c07f0eabe716154bf3bf92e05309d31adb..348c0d7c7430db66b4428acc402ec02bc50f50ce 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PasswordViewingTypeTest.java
@@ -12,7 +12,6 @@ import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
-import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
@@ -56,12 +55,12 @@ public class PasswordViewingTypeTest {
public void setUp() throws Exception {
mSyncContentResolverDelegate = new MockSyncContentResolverDelegate();
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ setupTestAccount(mContext);
mMainPreferences = (MainPreferences) startMainPreferences(
InstrumentationRegistry.getInstrumentation(), mContext)
.getFragmentForTest();
mPasswordsPref = (ChromeBasePreference) mMainPreferences.findPreference(
MainPreferences.PREF_SAVED_PASSWORDS);
- setupTestAccount(mContext);
AndroidSyncSettings.overrideForTests(mContext, mSyncContentResolverDelegate);
mAuthority = AndroidSyncSettings.getContractAuthority(mContext);
AndroidSyncSettings.updateAccount(mContext, mAccount);
@@ -69,19 +68,14 @@ public class PasswordViewingTypeTest {
}
private void setupTestAccount(Context context) {
- mAccountManager = new FakeAccountManagerDelegate(context);
- AccountManagerHelper.overrideAccountManagerHelperForTests(context, mAccountManager);
+ mAccountManager = new FakeAccountManagerDelegate();
+ AccountManagerHelper.overrideAccountManagerHelperForTests(mAccountManager);
mAccount = AccountManagerHelper.createAccountFromName("account@example.com");
AccountHolder.Builder accountHolder =
AccountHolder.builder(mAccount).password("password").alwaysAccept(true);
mAccountManager.addAccountHolderExplicitly(accountHolder.build());
}
- @After
- public void tearDown() {
- AccountManagerHelper.resetAccountManagerHelperForTests();
- }
-
/**
* Launches the main preferences.
*/

Powered by Google App Engine
This is Rietveld 408576698