OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ |
7 | 7 |
8 class AutofillProfile; | 8 class AutofillProfile; |
9 class CreditCard; | 9 class CreditCard; |
10 class Profile; | 10 class Profile; |
11 | 11 |
12 namespace webkit { | 12 namespace content { |
13 namespace forms { | |
14 struct FormField; | 13 struct FormField; |
15 } | 14 } |
16 } | |
17 | 15 |
18 // Common utilities shared amongst Autofill tests. | 16 // Common utilities shared amongst Autofill tests. |
19 namespace autofill_test { | 17 namespace autofill_test { |
20 | 18 |
21 // Provides a quick way to populate a FormField with c-strings. | 19 // Provides a quick way to populate a FormField with c-strings. |
22 void CreateTestFormField(const char* label, | 20 void CreateTestFormField(const char* label, |
23 const char* name, | 21 const char* name, |
24 const char* value, | 22 const char* value, |
25 const char* type, | 23 const char* type, |
26 webkit::forms::FormField* field); | 24 content::FormField* field); |
27 | 25 |
28 // A unit testing utility that is common to a number of the Autofill unit | 26 // A unit testing utility that is common to a number of the Autofill unit |
29 // tests. |SetProfileInfo| provides a quick way to populate a profile with | 27 // tests. |SetProfileInfo| provides a quick way to populate a profile with |
30 // c-strings. | 28 // c-strings. |
31 void SetProfileInfo(AutofillProfile* profile, | 29 void SetProfileInfo(AutofillProfile* profile, |
32 const char* first_name, const char* middle_name, | 30 const char* first_name, const char* middle_name, |
33 const char* last_name, const char* email, const char* company, | 31 const char* last_name, const char* email, const char* company, |
34 const char* address1, const char* address2, const char* city, | 32 const char* address1, const char* address2, const char* city, |
35 const char* state, const char* zipcode, const char* country, | 33 const char* state, const char* zipcode, const char* country, |
36 const char* phone); | 34 const char* phone); |
(...skipping 13 matching lines...) Expand all Loading... |
50 const char* expiration_month, const char* expiration_year); | 48 const char* expiration_month, const char* expiration_year); |
51 | 49 |
52 // TODO(isherman): We should do this automatically for all tests, not manually | 50 // TODO(isherman): We should do this automatically for all tests, not manually |
53 // on a per-test basis: http://crbug.com/57221 | 51 // on a per-test basis: http://crbug.com/57221 |
54 // Disables or mocks out code that would otherwise reach out to system services. | 52 // Disables or mocks out code that would otherwise reach out to system services. |
55 void DisableSystemServices(Profile* profile); | 53 void DisableSystemServices(Profile* profile); |
56 | 54 |
57 } // namespace autofill_test | 55 } // namespace autofill_test |
58 | 56 |
59 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ | 57 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ |
OLD | NEW |