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_COMMON_TEST_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_COMMON_TEST_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_COMMON_TEST_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_COMMON_TEST_H_ |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 class BrowserContext; | 9 class BrowserContext; |
10 } | 10 } |
11 | 11 |
12 namespace autofill { | 12 namespace autofill { |
13 | 13 |
14 class AutofillProfile; | 14 class AutofillProfile; |
15 class CreditCard; | 15 class CreditCard; |
| 16 struct FormData; |
16 struct FormFieldData; | 17 struct FormFieldData; |
17 | 18 |
18 // Common utilities shared amongst Autofill tests. | 19 // Common utilities shared amongst Autofill tests. |
19 namespace test { | 20 namespace test { |
20 | 21 |
21 // Provides a quick way to populate a FormField with c-strings. | 22 // Provides a quick way to populate a FormField with c-strings. |
22 void CreateTestFormField(const char* label, | 23 void CreateTestFormField(const char* label, |
23 const char* name, | 24 const char* name, |
24 const char* value, | 25 const char* value, |
25 const char* type, | 26 const char* type, |
26 FormFieldData* field); | 27 FormFieldData* field); |
27 | 28 |
| 29 // Populates |form| with data corresponding to a simple address form. |
| 30 // Note that this actually appends fields to the form data, which can be useful |
| 31 // for building up more complex test forms. |
| 32 void CreateTestAddressFormData(FormData* form); |
| 33 |
28 // Returns a profile full of dummy info. | 34 // Returns a profile full of dummy info. |
29 AutofillProfile GetFullProfile(); | 35 AutofillProfile GetFullProfile(); |
30 | 36 |
31 // Returns a profile full of dummy info, different to the above. | 37 // Returns a profile full of dummy info, different to the above. |
32 AutofillProfile GetFullProfile2(); | 38 AutofillProfile GetFullProfile2(); |
33 | 39 |
34 // Returns a verified profile full of dummy info. | 40 // Returns a verified profile full of dummy info. |
35 AutofillProfile GetVerifiedProfile(); | 41 AutofillProfile GetVerifiedProfile(); |
36 | 42 |
37 // Returns a verified profile full of dummy info, different to the above. | 43 // Returns a verified profile full of dummy info, different to the above. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 75 |
70 // TODO(isherman): We should do this automatically for all tests, not manually | 76 // TODO(isherman): We should do this automatically for all tests, not manually |
71 // on a per-test basis: http://crbug.com/57221 | 77 // on a per-test basis: http://crbug.com/57221 |
72 // Disables or mocks out code that would otherwise reach out to system services. | 78 // Disables or mocks out code that would otherwise reach out to system services. |
73 void DisableSystemServices(content::BrowserContext* browser_context); | 79 void DisableSystemServices(content::BrowserContext* browser_context); |
74 | 80 |
75 } // namespace test | 81 } // namespace test |
76 } // namespace autofill | 82 } // namespace autofill |
77 | 83 |
78 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_COMMON_TEST_H_ | 84 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_COMMON_TEST_H_ |
OLD | NEW |