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

Unified Diff: components/autofill/browser/wallet/wallet_test_util.cc

Issue 14425010: Handle expired Autofill credit cards in autofill dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/browser/wallet/wallet_items.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/browser/wallet/wallet_test_util.cc
diff --git a/components/autofill/browser/wallet/wallet_test_util.cc b/components/autofill/browser/wallet/wallet_test_util.cc
index f95fa0d12de522054ba5ee75536cf1495e874dc0..f34e82a7f15d7788f32202565147dbae65490a67 100644
--- a/components/autofill/browser/wallet/wallet_test_util.cc
+++ b/components/autofill/browser/wallet/wallet_test_util.cc
@@ -19,22 +19,31 @@
namespace autofill {
namespace wallet {
+namespace {
+
+int FutureYear() {
+ // "In the Year 3000." - Richie "LaBamba" Rosenberg
+ return 3000;
+}
+
+} // namespace
+
scoped_ptr<WalletItems::MaskedInstrument> GetTestMaskedInstrumentWithId(
const std::string& id) {
return scoped_ptr<WalletItems::MaskedInstrument>(
new WalletItems::MaskedInstrument(ASCIIToUTF16("descriptive_name"),
- WalletItems::MaskedInstrument::UNKNOWN,
+ WalletItems::MaskedInstrument::VISA,
std::vector<base::string16>(),
- ASCIIToUTF16("last_four_digits"),
+ ASCIIToUTF16("1111"),
12,
- 2012,
+ FutureYear(),
GetTestAddress(),
- WalletItems::MaskedInstrument::EXPIRED,
+ WalletItems::MaskedInstrument::VALID,
id));
}
scoped_ptr<Address> GetTestAddress() {
- return scoped_ptr<Address>(new Address("country_name_code",
+ return scoped_ptr<Address>(new Address("US",
ASCIIToUTF16("recipient_name"),
ASCIIToUTF16("address_line_1"),
ASCIIToUTF16("address_line_2"),
@@ -48,8 +57,8 @@ scoped_ptr<Address> GetTestAddress() {
scoped_ptr<FullWallet> GetTestFullWallet() {
base::Time::Exploded exploded;
base::Time::Now().LocalExplode(&exploded);
- return scoped_ptr<FullWallet>(new FullWallet(exploded.year + 3,
- exploded.month,
+ return scoped_ptr<FullWallet>(new FullWallet(FutureYear(),
+ 12,
"iin",
"rest",
GetTestAddress(),
@@ -61,7 +70,7 @@ scoped_ptr<Instrument> GetTestInstrument() {
return scoped_ptr<Instrument>(new Instrument(ASCIIToUTF16("4444444444444448"),
ASCIIToUTF16("123"),
12,
- 2012,
+ FutureYear(),
Instrument::VISA,
GetTestAddress()));
}
@@ -83,7 +92,7 @@ scoped_ptr<WalletItems::MaskedInstrument> GetTestNonDefaultMaskedInstrument() {
scoped_ptr<Address> GetTestSaveableAddress() {
return scoped_ptr<Address>(new Address(
- "save_country_name_code",
+ "US",
ASCIIToUTF16("save_recipient_name"),
ASCIIToUTF16("save_address_line_1"),
ASCIIToUTF16("save_address_line_2"),
@@ -96,7 +105,7 @@ scoped_ptr<Address> GetTestSaveableAddress() {
scoped_ptr<Address> GetTestShippingAddress() {
return scoped_ptr<Address>(new Address(
- "ship_country_name_code",
+ "US",
ASCIIToUTF16("ship_recipient_name"),
ASCIIToUTF16("ship_address_line_1"),
ASCIIToUTF16("ship_address_line_2"),
« no previous file with comments | « components/autofill/browser/wallet/wallet_items.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698