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

Unified Diff: components/autofill/core/browser/webdata/autofill_table_unittest.cc

Issue 2109643003: Add billing address to masked server credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add version_66.sql to the build file. Created 4 years, 6 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/core/browser/webdata/autofill_table_unittest.cc
diff --git a/components/autofill/core/browser/webdata/autofill_table_unittest.cc b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
index 1fff97fc5f828632c8f30774f09b5aed6ea17ad9..df40d8bb8b92200d64707eb667be8171316d889a 100644
--- a/components/autofill/core/browser/webdata/autofill_table_unittest.cc
+++ b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
@@ -1788,6 +1788,33 @@ TEST_F(AutofillTableTest, SetServerCardUpdateUsageStats) {
outputs.clear();
}
+TEST_F(AutofillTableTest, UpdateServerCardBillingAddress) {
+ // Add a masked card.
+ CreditCard masked_card(CreditCard::MASKED_SERVER_CARD, "a123");
+ masked_card.SetRawInfo(CREDIT_CARD_NAME_FULL,
+ ASCIIToUTF16("Paul F. Tompkins"));
+ masked_card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("1"));
+ masked_card.SetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, ASCIIToUTF16("2020"));
+ masked_card.SetRawInfo(CREDIT_CARD_NUMBER, ASCIIToUTF16("1111"));
+ masked_card.set_billing_address_id("billing-address-id-1");
+ masked_card.SetTypeForMaskedCard(kVisaCard);
+ test::SetServerCreditCards(table_.get(),
+ std::vector<CreditCard>(1, masked_card));
+ ScopedVector<CreditCard> outputs;
+ table_->GetServerCreditCards(&outputs.get());
+ ASSERT_EQ(1u, outputs.size());
+
+ EXPECT_EQ("billing-address-id-1", outputs[0]->billing_address_id());
+
+ masked_card.set_billing_address_id("billing-address-id-2");
+ table_->UpdateServerCardBillingAddress(masked_card);
+ outputs.clear();
+ table_->GetServerCreditCards(&outputs.get());
+ ASSERT_EQ(1u, outputs.size());
+
+ EXPECT_EQ("billing-address-id-2", outputs[0]->billing_address_id());
+}
+
TEST_F(AutofillTableTest, SetServerProfile) {
AutofillProfile one(AutofillProfile::SERVER_PROFILE, "a123");
std::vector<AutofillProfile> inputs;

Powered by Google App Engine
This is Rietveld 408576698