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