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

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
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 8ba717cf2a5758a0eded92a168da518e2183c22a..ba7605880694a518cb5e99c533d165ff462b31ea 100644
--- a/components/autofill/browser/wallet/wallet_test_util.cc
+++ b/components/autofill/browser/wallet/wallet_test_util.cc
@@ -19,8 +19,18 @@
namespace autofill {
namespace wallet {
+namespace {
+
+int FutureYear() {
+ base::Time::Exploded exploded;
+ base::Time::Now().LocalExplode(&exploded);
+ return exploded.year + 3;
+}
+
+} // namespace
+
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"),
@@ -34,8 +44,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(),
@@ -47,7 +57,7 @@ scoped_ptr<Instrument> GetTestInstrument() {
return scoped_ptr<Instrument>(new Instrument(ASCIIToUTF16("4444444444444448"),
ASCIIToUTF16("123"),
12,
- 2012,
+ FutureYear(),
Instrument::VISA,
GetTestAddress()));
}
@@ -62,19 +72,19 @@ scoped_ptr<WalletItems::LegalDocument> GetTestLegalDocument() {
scoped_ptr<WalletItems::MaskedInstrument> GetTestMaskedInstrument() {
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,
"instrument_id"));
}
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"),
@@ -87,7 +97,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"),

Powered by Google App Engine
This is Rietveld 408576698