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