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

Unified Diff: components/autofill/core/browser/autofill_test_utils.cc

Issue 180953004: Componentize several Autofill unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable system services Created 6 years, 9 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: components/autofill/core/browser/autofill_test_utils.cc
diff --git a/components/autofill/core/browser/autofill_test_utils.cc b/components/autofill/core/browser/autofill_test_utils.cc
index c16387533b8a4f3efdd0dde41fb70314a077af15..6595ec936afdd3fcd9c9012c6939f4b18557191e 100644
--- a/components/autofill/core/browser/autofill_test_utils.cc
+++ b/components/autofill/core/browser/autofill_test_utils.cc
@@ -19,7 +19,6 @@
#include "components/encryptor/os_crypt.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "components/user_prefs/user_prefs.h"
-#include "content/public/browser/browser_context.h"
using base::ASCIIToUTF16;
@@ -204,7 +203,7 @@ void SetCreditCardInfo(CreditCard* credit_card,
check_and_set(credit_card, CREDIT_CARD_EXP_4_DIGIT_YEAR, expiration_year);
}
-void DisableSystemServices(content::BrowserContext* browser_context) {
+void DisableSystemServices(PrefService* prefs) {
// Use a mock Keychain rather than the OS one to store credit card data.
#if defined(OS_MACOSX)
OSCrypt::UseMockKeychain(true);
@@ -212,9 +211,8 @@ void DisableSystemServices(content::BrowserContext* browser_context) {
// Disable auxiliary profiles for unit testing. These reach out to system
// services on the Mac.
- if (browser_context) {
- user_prefs::UserPrefs::Get(browser_context)->SetBoolean(
- prefs::kAutofillAuxiliaryProfilesEnabled, false);
+ if (prefs) {
+ prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false);
}
Ilya Sherman 2014/03/07 01:52:16 nit: No need for curlies anymore.
blundell 2014/03/07 06:24:19 Done.
}

Powered by Google App Engine
This is Rietveld 408576698