Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: components/autofill/core/browser/autofill_test_utils.h

Issue 982203002: Autofill - Move test only code to a test util file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add dcheck Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698