OLD | NEW |
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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/prefs/pref_service.h" | |
11 #include "base/prefs/pref_service_factory.h" | |
12 #include "base/prefs/testing_pref_store.h" | |
13 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
14 #include "build/build_config.h" | 11 #include "build/build_config.h" |
15 #include "components/autofill/core/browser/autofill_manager.h" | 12 #include "components/autofill/core/browser/autofill_manager.h" |
16 #include "components/autofill/core/browser/autofill_profile.h" | 13 #include "components/autofill/core/browser/autofill_profile.h" |
17 #include "components/autofill/core/browser/credit_card.h" | 14 #include "components/autofill/core/browser/credit_card.h" |
18 #include "components/autofill/core/browser/field_types.h" | 15 #include "components/autofill/core/browser/field_types.h" |
19 #include "components/autofill/core/browser/webdata/autofill_table.h" | 16 #include "components/autofill/core/browser/webdata/autofill_table.h" |
20 #include "components/autofill/core/common/autofill_pref_names.h" | 17 #include "components/autofill/core/common/autofill_pref_names.h" |
21 #include "components/autofill/core/common/form_data.h" | 18 #include "components/autofill/core/common/form_data.h" |
22 #include "components/autofill/core/common/form_field_data.h" | 19 #include "components/autofill/core/common/form_field_data.h" |
23 #include "components/os_crypt/os_crypt.h" | 20 #include "components/os_crypt/os_crypt.h" |
24 #include "components/pref_registry/pref_registry_syncable.h" | 21 #include "components/pref_registry/pref_registry_syncable.h" |
| 22 #include "components/prefs/pref_service.h" |
| 23 #include "components/prefs/pref_service_factory.h" |
| 24 #include "components/prefs/testing_pref_store.h" |
25 #include "components/signin/core/browser/account_fetcher_service.h" | 25 #include "components/signin/core/browser/account_fetcher_service.h" |
26 #include "components/signin/core/browser/account_tracker_service.h" | 26 #include "components/signin/core/browser/account_tracker_service.h" |
27 #include "components/signin/core/common/signin_pref_names.h" | 27 #include "components/signin/core/common/signin_pref_names.h" |
28 | 28 |
29 using base::ASCIIToUTF16; | 29 using base::ASCIIToUTF16; |
30 | 30 |
31 namespace autofill { | 31 namespace autofill { |
32 namespace test { | 32 namespace test { |
33 | 33 |
34 namespace { | 34 namespace { |
(...skipping 20 matching lines...) Expand all Loading... |
55 registry->RegisterStringPref(::prefs::kGoogleServicesUsername, | 55 registry->RegisterStringPref(::prefs::kGoogleServicesUsername, |
56 std::string()); | 56 std::string()); |
57 | 57 |
58 // PDM depends on these prefs, which are normally registered in | 58 // PDM depends on these prefs, which are normally registered in |
59 // AccountTrackerServiceFactory. | 59 // AccountTrackerServiceFactory. |
60 registry->RegisterListPref(AccountTrackerService::kAccountInfoPref); | 60 registry->RegisterListPref(AccountTrackerService::kAccountInfoPref); |
61 registry->RegisterIntegerPref(::prefs::kAccountIdMigrationState, | 61 registry->RegisterIntegerPref(::prefs::kAccountIdMigrationState, |
62 AccountTrackerService::MIGRATION_NOT_STARTED); | 62 AccountTrackerService::MIGRATION_NOT_STARTED); |
63 registry->RegisterInt64Pref(AccountFetcherService::kLastUpdatePref, 0); | 63 registry->RegisterInt64Pref(AccountFetcherService::kLastUpdatePref, 0); |
64 | 64 |
65 base::PrefServiceFactory factory; | 65 PrefServiceFactory factory; |
66 factory.set_user_prefs(make_scoped_refptr(new TestingPrefStore())); | 66 factory.set_user_prefs(make_scoped_refptr(new TestingPrefStore())); |
67 return factory.Create(registry.get()); | 67 return factory.Create(registry.get()); |
68 } | 68 } |
69 | 69 |
70 void CreateTestFormField(const char* label, | 70 void CreateTestFormField(const char* label, |
71 const char* name, | 71 const char* name, |
72 const char* value, | 72 const char* value, |
73 const char* type, | 73 const char* type, |
74 FormFieldData* field) { | 74 FormFieldData* field) { |
75 field->label = ASCIIToUTF16(label); | 75 field->label = ASCIIToUTF16(label); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 if (name) | 340 if (name) |
341 field->set_name(name); | 341 field->set_name(name); |
342 if (control_type) | 342 if (control_type) |
343 field->set_type(control_type); | 343 field->set_type(control_type); |
344 if (label) | 344 if (label) |
345 field->set_label(label); | 345 field->set_label(label); |
346 } | 346 } |
347 | 347 |
348 } // namespace test | 348 } // namespace test |
349 } // namespace autofill | 349 } // namespace autofill |
OLD | NEW |