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

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

Issue 14644010: respect default wallet instrument/address (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_test_util.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 8ba717cf2a5758a0eded92a168da518e2183c22a..f95fa0d12de522054ba5ee75536cf1495e874dc0 100644
--- a/components/autofill/browser/wallet/wallet_test_util.cc
+++ b/components/autofill/browser/wallet/wallet_test_util.cc
@@ -19,6 +19,20 @@
namespace autofill {
namespace wallet {
+scoped_ptr<WalletItems::MaskedInstrument> GetTestMaskedInstrumentWithId(
+ const std::string& id) {
+ return scoped_ptr<WalletItems::MaskedInstrument>(
+ new WalletItems::MaskedInstrument(ASCIIToUTF16("descriptive_name"),
+ WalletItems::MaskedInstrument::UNKNOWN,
+ std::vector<base::string16>(),
+ ASCIIToUTF16("last_four_digits"),
+ 12,
+ 2012,
+ GetTestAddress(),
+ WalletItems::MaskedInstrument::EXPIRED,
+ id));
+}
+
scoped_ptr<Address> GetTestAddress() {
return scoped_ptr<Address>(new Address("country_name_code",
ASCIIToUTF16("recipient_name"),
@@ -60,16 +74,11 @@ scoped_ptr<WalletItems::LegalDocument> GetTestLegalDocument() {
}
scoped_ptr<WalletItems::MaskedInstrument> GetTestMaskedInstrument() {
- return scoped_ptr<WalletItems::MaskedInstrument>(
- new WalletItems::MaskedInstrument(ASCIIToUTF16("descriptive_name"),
- WalletItems::MaskedInstrument::UNKNOWN,
- std::vector<base::string16>(),
- ASCIIToUTF16("last_four_digits"),
- 12,
- 2012,
- GetTestAddress(),
- WalletItems::MaskedInstrument::EXPIRED,
- "instrument_id"));
+ return GetTestMaskedInstrumentWithId("default_instrument_id");
+}
+
+scoped_ptr<WalletItems::MaskedInstrument> GetTestNonDefaultMaskedInstrument() {
+ return GetTestMaskedInstrumentWithId("instrument_id");
}
scoped_ptr<Address> GetTestSaveableAddress() {
@@ -95,7 +104,13 @@ scoped_ptr<Address> GetTestShippingAddress() {
ASCIIToUTF16("ship_admin_area_name"),
ASCIIToUTF16("ship_postal_code_number"),
ASCIIToUTF16("ship_phone_number"),
- "address_id"));
+ "default_address_id"));
+}
+
+scoped_ptr<Address> GetTestNonDefaultShippingAddress() {
+ scoped_ptr<Address> address = GetTestShippingAddress();
+ address->set_object_id("address_id");
+ return address.Pass();
}
scoped_ptr<WalletItems> GetTestWalletItems() {
« no previous file with comments | « components/autofill/browser/wallet/wallet_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698