OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ | |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ | |
7 | |
8 class AutofillProfile; | |
9 class CreditCard; | |
10 class Profile; | |
11 | |
12 struct FormFieldData; | |
13 | |
14 // Common utilities shared amongst Autofill tests. | |
15 namespace autofill_test { | |
16 | |
17 // Provides a quick way to populate a FormField with c-strings. | |
18 void CreateTestFormField(const char* label, | |
19 const char* name, | |
20 const char* value, | |
21 const char* type, | |
22 FormFieldData* field); | |
23 | |
24 // Returns a profile full of dummy info. | |
25 AutofillProfile GetFullProfile(); | |
26 | |
27 // A unit testing utility that is common to a number of the Autofill unit | |
28 // tests. |SetProfileInfo| provides a quick way to populate a profile with | |
29 // c-strings. | |
30 void SetProfileInfo(AutofillProfile* profile, | |
31 const char* first_name, const char* middle_name, | |
32 const char* last_name, const char* email, const char* company, | |
33 const char* address1, const char* address2, const char* city, | |
34 const char* state, const char* zipcode, const char* country, | |
35 const char* phone); | |
36 | |
37 void SetProfileInfoWithGuid(AutofillProfile* profile, | |
38 const char* guid, const char* first_name, const char* middle_name, | |
39 const char* last_name, const char* email, const char* company, | |
40 const char* address1, const char* address2, const char* city, | |
41 const char* state, const char* zipcode, const char* country, | |
42 const char* phone); | |
43 | |
44 // A unit testing utility that is common to a number of the Autofill unit | |
45 // tests. |SetCreditCardInfo| provides a quick way to populate a credit card | |
46 // with c-strings. | |
47 void SetCreditCardInfo(CreditCard* credit_card, | |
48 const char* name_on_card, const char* card_number, | |
49 const char* expiration_month, const char* expiration_year); | |
50 | |
51 // TODO(isherman): We should do this automatically for all tests, not manually | |
52 // on a per-test basis: http://crbug.com/57221 | |
53 // Disables or mocks out code that would otherwise reach out to system services. | |
54 void DisableSystemServices(Profile* profile); | |
55 | |
56 } // namespace autofill_test | |
57 | |
58 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ | |
OLD | NEW |