| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "components/autofill/core/browser/field_types.h" | 12 #include "components/autofill/core/browser/field_types.h" |
| 12 #include "components/autofill/core/browser/proto/server.pb.h" | 13 #include "components/autofill/core/browser/proto/server.pb.h" |
| 13 | 14 |
| 14 class PrefService; | 15 class PrefService; |
| 15 | 16 |
| 16 namespace autofill { | 17 namespace autofill { |
| 17 | 18 |
| 18 class AutofillProfile; | 19 class AutofillProfile; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const char* guid, const char* first_name, const char* middle_name, | 101 const char* guid, const char* first_name, const char* middle_name, |
| 101 const char* last_name, const char* email, const char* company, | 102 const char* last_name, const char* email, const char* company, |
| 102 const char* address1, const char* address2, const char* city, | 103 const char* address1, const char* address2, const char* city, |
| 103 const char* state, const char* zipcode, const char* country, | 104 const char* state, const char* zipcode, const char* country, |
| 104 const char* phone); | 105 const char* phone); |
| 105 | 106 |
| 106 // A unit testing utility that is common to a number of the Autofill unit | 107 // A unit testing utility that is common to a number of the Autofill unit |
| 107 // tests. |SetCreditCardInfo| provides a quick way to populate a credit card | 108 // tests. |SetCreditCardInfo| provides a quick way to populate a credit card |
| 108 // with c-strings. | 109 // with c-strings. |
| 109 void SetCreditCardInfo(CreditCard* credit_card, | 110 void SetCreditCardInfo(CreditCard* credit_card, |
| 110 const char* name_on_card, const char* card_number, | 111 const char* name_on_card, |
| 111 const char* expiration_month, const char* expiration_year); | 112 const char* card_number, |
| 113 const char* expiration_month, |
| 114 const char* expiration_year, |
| 115 const std::string& billing_address_id); |
| 112 | 116 |
| 113 // TODO(isherman): We should do this automatically for all tests, not manually | 117 // TODO(isherman): We should do this automatically for all tests, not manually |
| 114 // on a per-test basis: http://crbug.com/57221 | 118 // on a per-test basis: http://crbug.com/57221 |
| 115 // Disables or mocks out code that would otherwise reach out to system services. | 119 // Disables or mocks out code that would otherwise reach out to system services. |
| 116 // Revert this configuration with |ReenableSystemServices|. | 120 // Revert this configuration with |ReenableSystemServices|. |
| 117 void DisableSystemServices(PrefService* prefs); | 121 void DisableSystemServices(PrefService* prefs); |
| 118 | 122 |
| 119 // Undoes the mocking set up by |DisableSystemServices| | 123 // Undoes the mocking set up by |DisableSystemServices| |
| 120 void ReenableSystemServices(); | 124 void ReenableSystemServices(); |
| 121 | 125 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 139 // be set at all, as opposed to being set to empty string. | 143 // be set at all, as opposed to being set to empty string. |
| 140 void FillQueryField(AutofillQueryContents::Form::Field* field, | 144 void FillQueryField(AutofillQueryContents::Form::Field* field, |
| 141 unsigned signature, | 145 unsigned signature, |
| 142 const char* name, | 146 const char* name, |
| 143 const char* control_type); | 147 const char* control_type); |
| 144 | 148 |
| 145 } // namespace test | 149 } // namespace test |
| 146 } // namespace autofill | 150 } // namespace autofill |
| 147 | 151 |
| 148 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ | 152 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ |
| OLD | NEW |