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

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

Powered by Google App Engine
This is Rietveld 408576698