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

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

Issue 49303005: Parameterize the PrefService that AutofillDownloadManager uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 7 years, 1 month 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_common_test.cc
diff --git a/components/autofill/core/browser/autofill_common_test.cc b/components/autofill/core/browser/autofill_common_test.cc
index 2187d8b7bea898894935f77ec2ab5485de7adafd..609ec8d842aecb0cbb2a48a1e99fcc585361d7b6 100644
--- a/components/autofill/core/browser/autofill_common_test.cc
+++ b/components/autofill/core/browser/autofill_common_test.cc
@@ -6,13 +6,17 @@
#include "base/guid.h"
#include "base/prefs/pref_service.h"
+#include "base/prefs/pref_service_builder.h"
+#include "base/prefs/testing_pref_store.h"
#include "base/strings/utf_string_conversions.h"
+#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/autofill/core/common/form_data.h"
#include "components/autofill/core/common/form_field_data.h"
+#include "components/user_prefs/pref_registry_syncable.h"
#include "components/user_prefs/user_prefs.h"
#include "components/webdata/encryptor/encryptor.h"
#include "content/public/browser/browser_context.h"
@@ -26,6 +30,15 @@ const char kSettingsOrigin[] = "Chrome settings";
} // namespace
+scoped_ptr<PrefService> PrefServiceForTesting() {
+ scoped_refptr<user_prefs::PrefRegistrySyncable> registry(
+ new user_prefs::PrefRegistrySyncable());
+ AutofillManager::RegisterProfilePrefs(registry.get());
+ PrefServiceBuilder builder;
+ builder.WithUserPrefs(new TestingPrefStore());
+ return scoped_ptr<PrefService>(builder.Create(registry.get()));
+}
+
void CreateTestFormField(const char* label,
const char* name,
const char* value,
« no previous file with comments | « components/autofill/core/browser/autofill_common_test.h ('k') | components/autofill/core/browser/autofill_download.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698