Chromium Code Reviews

Side by Side Diff: components/autofill/core/browser/autofill_test_utils.cc

Issue 64193003: Clean up PrefServiceBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indentation Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/core/browser/autofill_test_utils.h" 5 #include "components/autofill/core/browser/autofill_test_utils.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/pref_service_builder.h" 9 #include "base/prefs/pref_service_builder.h"
10 #include "base/prefs/testing_pref_store.h" 10 #include "base/prefs/testing_pref_store.h"
(...skipping 16 matching lines...)
27 namespace { 27 namespace {
28 28
29 const char kSettingsOrigin[] = "Chrome settings"; 29 const char kSettingsOrigin[] = "Chrome settings";
30 30
31 } // namespace 31 } // namespace
32 32
33 scoped_ptr<PrefService> PrefServiceForTesting() { 33 scoped_ptr<PrefService> PrefServiceForTesting() {
34 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( 34 scoped_refptr<user_prefs::PrefRegistrySyncable> registry(
35 new user_prefs::PrefRegistrySyncable()); 35 new user_prefs::PrefRegistrySyncable());
36 AutofillManager::RegisterProfilePrefs(registry.get()); 36 AutofillManager::RegisterProfilePrefs(registry.get());
37 PrefServiceBuilder builder; 37 base::PrefServiceBuilder builder;
38 builder.WithUserPrefs(new TestingPrefStore()); 38 builder.set_user_prefs(make_scoped_refptr(new TestingPrefStore()));
39 return scoped_ptr<PrefService>(builder.Create(registry.get())); 39 return builder.Create(registry.get());
40 } 40 }
41 41
42 void CreateTestFormField(const char* label, 42 void CreateTestFormField(const char* label,
43 const char* name, 43 const char* name,
44 const char* value, 44 const char* value,
45 const char* type, 45 const char* type,
46 FormFieldData* field) { 46 FormFieldData* field) {
47 field->label = ASCIIToUTF16(label); 47 field->label = ASCIIToUTF16(label);
48 field->name = ASCIIToUTF16(name); 48 field->name = ASCIIToUTF16(name);
49 field->value = ASCIIToUTF16(value); 49 field->value = ASCIIToUTF16(value);
(...skipping 161 matching lines...)
211 // Disable auxiliary profiles for unit testing. These reach out to system 211 // Disable auxiliary profiles for unit testing. These reach out to system
212 // services on the Mac. 212 // services on the Mac.
213 if (browser_context) { 213 if (browser_context) {
214 user_prefs::UserPrefs::Get(browser_context)->SetBoolean( 214 user_prefs::UserPrefs::Get(browser_context)->SetBoolean(
215 prefs::kAutofillAuxiliaryProfilesEnabled, false); 215 prefs::kAutofillAuxiliaryProfilesEnabled, false);
216 } 216 }
217 } 217 }
218 218
219 } // namespace test 219 } // namespace test
220 } // namespace autofill 220 } // namespace autofill
OLDNEW

Powered by Google App Engine