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, |