| 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 58439067907dbeb5f6ad215f7b396000accac334..a96493239afb6d8019defcabb3e42694d500dd76 100644
|
| --- a/components/autofill/core/browser/webdata/autofill_table_unittest.cc
|
| +++ b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
|
| @@ -1029,6 +1029,24 @@ TEST_F(AutofillTableTest, CreditCard) {
|
| EXPECT_FALSE(db_creditcard);
|
| }
|
|
|
| +TEST_F(AutofillTableTest, AddServerCreditCard) {
|
| + CreditCard credit_card;
|
| + credit_card.set_record_type(CreditCard::FULL_SERVER_CARD);
|
| + credit_card.set_server_id("server_id");
|
| + credit_card.set_origin("https://www.example.com/");
|
| + credit_card.SetRawInfo(CREDIT_CARD_NAME_FULL, ASCIIToUTF16("Jack Torrance"));
|
| + credit_card.SetRawInfo(CREDIT_CARD_NUMBER, ASCIIToUTF16("1234567890123456"));
|
| + credit_card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("04"));
|
| + credit_card.SetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, ASCIIToUTF16("2013"));
|
| +
|
| + EXPECT_TRUE(table_->AddServerCreditCard(credit_card));
|
| +
|
| + std::vector<std::unique_ptr<CreditCard>> outputs;
|
| + ASSERT_TRUE(table_->GetServerCreditCards(&outputs));
|
| + ASSERT_EQ(1U, outputs.size());
|
| + EXPECT_EQ(0, credit_card.Compare(*outputs[0]));
|
| +}
|
| +
|
| TEST_F(AutofillTableTest, UpdateAutofillProfile) {
|
| // Add a profile to the db.
|
| AutofillProfile profile;
|
|
|