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

Unified Diff: components/autofill/core/browser/autofill_external_delegate_unittest.cc

Issue 2249773002: Scan card holder name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/autofill_external_delegate_unittest.cc
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
index 62e964d6b22ccfef514721b978fcad1a55307563..891611d3a032b0140a8d1053ecaca67e71b66f30 100644
--- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -605,15 +605,6 @@ TEST_F(AutofillExternalDelegateUnitTest, ScanCreditCardPromptMetricsTest) {
}
}
-MATCHER_P3(CreditCardMatches,
- card_number,
- expiration_month,
- expiration_year,
- "") {
- return !arg.Compare(
- CreditCard(card_number, expiration_month, expiration_year));
-}
-
// Test that autofill client will start the signin flow after the user accepted
// the suggestion to sign in.
TEST_F(AutofillExternalDelegateUnitTest, SigninPromoMenuItem) {
@@ -623,19 +614,30 @@ TEST_F(AutofillExternalDelegateUnitTest, SigninPromoMenuItem) {
base::string16(), POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO, 0);
}
+MATCHER_P4(CreditCardMatches,
+ card_holder_name,
+ card_number,
+ expiration_month,
+ expiration_year,
+ "") {
+ return !arg.Compare(CreditCard(card_holder_name, card_number,
+ expiration_month, expiration_year));
+}
+
// Test that autofill manager will fill the credit card form after user scans a
// credit card.
TEST_F(AutofillExternalDelegateUnitTest, FillCreditCardForm) {
+ base::string16 card_holder_name = base::ASCIIToUTF16("Alice");
base::string16 card_number = base::ASCIIToUTF16("test");
int expiration_month = 1;
int expiration_year = 3000;
EXPECT_CALL(*autofill_manager_,
FillCreditCardForm(
- _, _, _, CreditCardMatches(card_number, expiration_month,
- expiration_year),
+ _, _, _, CreditCardMatches(card_holder_name, card_number,
+ expiration_month, expiration_year),
base::string16()));
- external_delegate_->OnCreditCardScanned(card_number, expiration_month,
- expiration_year);
+ external_delegate_->OnCreditCardScanned(card_holder_name, card_number,
+ expiration_month, expiration_year);
}
TEST_F(AutofillExternalDelegateUnitTest, IgnoreAutocompleteOffForAutofill) {

Powered by Google App Engine
This is Rietveld 408576698