| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // registry. | 31 // registry. |
| 32 std::unique_ptr<PrefService> PrefServiceForTesting(); | 32 std::unique_ptr<PrefService> PrefServiceForTesting(); |
| 33 | 33 |
| 34 // Provides a quick way to populate a FormField with c-strings. | 34 // Provides a quick way to populate a FormField with c-strings. |
| 35 void CreateTestFormField(const char* label, | 35 void CreateTestFormField(const char* label, |
| 36 const char* name, | 36 const char* name, |
| 37 const char* value, | 37 const char* value, |
| 38 const char* type, | 38 const char* type, |
| 39 FormFieldData* field); | 39 FormFieldData* field); |
| 40 | 40 |
| 41 // Provides a quick way to populate a select field. |
| 42 void CreateTestSelectField(const char* label, |
| 43 const char* name, |
| 44 const char* value, |
| 45 const std::vector<const char*>& values, |
| 46 const std::vector<const char*>& contents, |
| 47 size_t select_size, |
| 48 FormFieldData* field); |
| 49 |
| 50 void CreateTestSelectField(const std::vector<const char*>& values, |
| 51 FormFieldData* field); |
| 52 |
| 41 // Populates |form| with data corresponding to a simple address form. | 53 // Populates |form| with data corresponding to a simple address form. |
| 42 // Note that this actually appends fields to the form data, which can be useful | 54 // Note that this actually appends fields to the form data, which can be useful |
| 43 // for building up more complex test forms. Another version of the function is | 55 // for building up more complex test forms. Another version of the function is |
| 44 // provided in case the caller wants the vector of expected field |types|. | 56 // provided in case the caller wants the vector of expected field |types|. |
| 45 void CreateTestAddressFormData(FormData* form); | 57 void CreateTestAddressFormData(FormData* form); |
| 46 void CreateTestAddressFormData(FormData* form, | 58 void CreateTestAddressFormData(FormData* form, |
| 47 std::vector<ServerFieldTypeSet>* types); | 59 std::vector<ServerFieldTypeSet>* types); |
| 48 | 60 |
| 49 // Returns a profile full of dummy info. | 61 // Returns a profile full of dummy info. |
| 50 AutofillProfile GetFullProfile(); | 62 AutofillProfile GetFullProfile(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void FillQueryField(AutofillQueryContents::Form::Field* field, | 137 void FillQueryField(AutofillQueryContents::Form::Field* field, |
| 126 unsigned signature, | 138 unsigned signature, |
| 127 const char* name, | 139 const char* name, |
| 128 const char* control_type, | 140 const char* control_type, |
| 129 const char* label); | 141 const char* label); |
| 130 | 142 |
| 131 } // namespace test | 143 } // namespace test |
| 132 } // namespace autofill | 144 } // namespace autofill |
| 133 | 145 |
| 134 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ | 146 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ |
| OLD | NEW |