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

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: Pass CreditCard, don't alter the constructor. 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..41f58ec860f9755b6678ca333528d7f002c6cf46 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,18 @@ TEST_F(AutofillExternalDelegateUnitTest, SigninPromoMenuItem) {
base::string16(), POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO, 0);
}
+MATCHER_P(CreditCardMatches, card, "") {
+ return !arg.Compare(card);
+}
+
// Test that autofill manager will fill the credit card form after user scans a
// credit card.
TEST_F(AutofillExternalDelegateUnitTest, FillCreditCardForm) {
- base::string16 card_number = base::ASCIIToUTF16("test");
- int expiration_month = 1;
- int expiration_year = 3000;
+ CreditCard card(base::ASCIIToUTF16("test"), 1, 3000);
+ card.SetRawInfo(CREDIT_CARD_NAME_FULL, base::ASCIIToUTF16("Alice"));
EXPECT_CALL(*autofill_manager_,
- FillCreditCardForm(
- _, _, _, CreditCardMatches(card_number, expiration_month,
- expiration_year),
- base::string16()));
- external_delegate_->OnCreditCardScanned(card_number, expiration_month,
- expiration_year);
+ FillCreditCardForm(_, _, _, CreditCardMatches(card), base::string16()));
+ external_delegate_->OnCreditCardScanned(card);
}
TEST_F(AutofillExternalDelegateUnitTest, IgnoreAutocompleteOffForAutofill) {
« no previous file with comments | « components/autofill/core/browser/autofill_external_delegate.cc ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698