| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 | 9 |
| 10 class PrefService; | 10 class PrefService; |
| 11 | 11 |
| 12 namespace autofill { | 12 namespace autofill { |
| 13 | 13 |
| 14 class AutofillProfile; | 14 class AutofillProfile; |
| 15 class AutofillTable; |
| 15 class CreditCard; | 16 class CreditCard; |
| 16 struct FormData; | 17 struct FormData; |
| 17 struct FormFieldData; | 18 struct FormFieldData; |
| 18 | 19 |
| 19 // Common utilities shared amongst Autofill tests. | 20 // Common utilities shared amongst Autofill tests. |
| 20 namespace test { | 21 namespace test { |
| 21 | 22 |
| 22 // Returns a PrefService that can be used for Autofill-related testing in | 23 // Returns a PrefService that can be used for Autofill-related testing in |
| 23 // contexts where the PrefService would otherwise have to be constructed | 24 // contexts where the PrefService would otherwise have to be constructed |
| 24 // manually (e.g., in unit tests within Autofill core code). The returned | 25 // manually (e.g., in unit tests within Autofill core code). The returned |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // with c-strings. | 85 // with c-strings. |
| 85 void SetCreditCardInfo(CreditCard* credit_card, | 86 void SetCreditCardInfo(CreditCard* credit_card, |
| 86 const char* name_on_card, const char* card_number, | 87 const char* name_on_card, const char* card_number, |
| 87 const char* expiration_month, const char* expiration_year); | 88 const char* expiration_month, const char* expiration_year); |
| 88 | 89 |
| 89 // TODO(isherman): We should do this automatically for all tests, not manually | 90 // TODO(isherman): We should do this automatically for all tests, not manually |
| 90 // on a per-test basis: http://crbug.com/57221 | 91 // on a per-test basis: http://crbug.com/57221 |
| 91 // Disables or mocks out code that would otherwise reach out to system services. | 92 // Disables or mocks out code that would otherwise reach out to system services. |
| 92 void DisableSystemServices(PrefService* prefs); | 93 void DisableSystemServices(PrefService* prefs); |
| 93 | 94 |
| 95 // Sets |cards| for |table|. |cards| may contain full, unmasked server cards, |
| 96 // whereas AutofillTable::SetServerCreditCards can only contain masked cards. |
| 97 void SetServerCreditCards(AutofillTable* table, |
| 98 const std::vector<CreditCard>& cards); |
| 99 |
| 94 } // namespace test | 100 } // namespace test |
| 95 } // namespace autofill | 101 } // namespace autofill |
| 96 | 102 |
| 97 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ | 103 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_TEST_UTILS_H_ |
| OLD | NEW |