| 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 // A unit testing utility that is common to a number of the Autofill unit | |
| 25 // tests. |SetProfileInfo| provides a quick way to populate a profile with | |
| 26 // c-strings. | |
| 27 void SetProfileInfo(AutofillProfile* profile, | |
| 28 const char* first_name, const char* middle_name, | |
| 29 const char* last_name, const char* email, const char* company, | |
| 30 const char* address1, const char* address2, const char* city, | |
| 31 const char* state, const char* zipcode, const char* country, | |
| 32 const char* phone); | |
| 33 | |
| 34 void SetProfileInfoWithGuid(AutofillProfile* profile, | |
| 35 const char* guid, const char* first_name, const char* middle_name, | |
| 36 const char* last_name, const char* email, const char* company, | |
| 37 const char* address1, const char* address2, const char* city, | |
| 38 const char* state, const char* zipcode, const char* country, | |
| 39 const char* phone); | |
| 40 | |
| 41 // A unit testing utility that is common to a number of the Autofill unit | |
| 42 // tests. |SetCreditCardInfo| provides a quick way to populate a credit card | |
| 43 // with c-strings. | |
| 44 void SetCreditCardInfo(CreditCard* credit_card, | |
| 45 const char* name_on_card, const char* card_number, | |
| 46 const char* expiration_month, const char* expiration_year); | |
| 47 | |
| 48 // TODO(isherman): We should do this automatically for all tests, not manually | |
| 49 // on a per-test basis: http://crbug.com/57221 | |
| 50 // Disables or mocks out code that would otherwise reach out to system services. | |
| 51 void DisableSystemServices(Profile* profile); | |
| 52 | |
| 53 } // namespace autofill_test | |
| 54 | |
| 55 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_COMMON_TEST_H_ | |
| OLD | NEW |