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 "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_factory.h" | 9 #include "base/prefs/pref_service_factory.h" |
10 #include "base/prefs/testing_pref_store.h" | 10 #include "base/prefs/testing_pref_store.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
50 field->form_control_type = type; | 50 field->form_control_type = type; |
51 } | 51 } |
52 | 52 |
53 void CreateTestAddressFormData(FormData* form) { | 53 void CreateTestAddressFormData(FormData* form) { |
54 form->name = ASCIIToUTF16("MyForm"); | 54 form->name = ASCIIToUTF16("MyForm"); |
55 form->method = ASCIIToUTF16("POST"); | |
56 form->origin = GURL("http://myform.com/form.html"); | 55 form->origin = GURL("http://myform.com/form.html"); |
57 form->action = GURL("http://myform.com/submit.html"); | 56 form->action = GURL("http://myform.com/submit.html"); |
58 form->user_submitted = true; | 57 form->user_submitted = true; |
59 | 58 |
60 FormFieldData field; | 59 FormFieldData field; |
61 test::CreateTestFormField("First Name", "firstname", "", "text", &field); | 60 test::CreateTestFormField("First Name", "firstname", "", "text", &field); |
62 form->fields.push_back(field); | 61 form->fields.push_back(field); |
63 test::CreateTestFormField("Middle Name", "middlename", "", "text", &field); | 62 test::CreateTestFormField("Middle Name", "middlename", "", "text", &field); |
64 form->fields.push_back(field); | 63 form->fields.push_back(field); |
65 test::CreateTestFormField("Last Name", "lastname", "", "text", &field); | 64 test::CreateTestFormField("Last Name", "lastname", "", "text", &field); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 prefs->SetBoolean(prefs::kAutofillUseMacAddressBook, false); | 213 prefs->SetBoolean(prefs::kAutofillUseMacAddressBook, false); |
215 #else | 214 #else |
216 // Disable auxiliary profiles for unit testing by default. | 215 // Disable auxiliary profiles for unit testing by default. |
217 if (prefs) | 216 if (prefs) |
218 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); | 217 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); |
219 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 218 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
220 } | 219 } |
221 | 220 |
222 } // namespace test | 221 } // namespace test |
223 } // namespace autofill | 222 } // namespace autofill |
OLD | NEW |