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

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

Issue 2514753002: Add Mir credit card support to autofill. (Closed)
Patch Set: Remove autofill sync modifications, optimize png files. Created 4 years, 1 month 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/core/browser/credit_card.cc ('k') | components/autofill/core/browser/validation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/credit_card_unittest.cc
diff --git a/components/autofill/core/browser/credit_card_unittest.cc b/components/autofill/core/browser/credit_card_unittest.cc
index 3f481ee956d1a3dc7fa8b2c46029d05a3173847c..d0a535eff784946e203248ada3e4ae15dfb9afe8 100644
--- a/components/autofill/core/browser/credit_card_unittest.cc
+++ b/components/autofill/core/browser/credit_card_unittest.cc
@@ -386,6 +386,8 @@ TEST(CreditCardTest, IconResourceId) {
CreditCard::IconResourceId(kJCBCard));
EXPECT_EQ(IDR_AUTOFILL_CC_MASTERCARD,
CreditCard::IconResourceId(kMasterCard));
+ EXPECT_EQ(IDR_AUTOFILL_CC_MIR,
+ CreditCard::IconResourceId(kMirCard));
EXPECT_EQ(IDR_AUTOFILL_CC_VISA,
CreditCard::IconResourceId(kVisaCard));
}
@@ -659,6 +661,9 @@ TEST(CreditCardTest, GetCreditCardType) {
{ "6247130048162403", kUnionPay, true },
{ "6247130048162403", kUnionPay, true },
{ "622384452162063648", kUnionPay, true },
+ { "2204883716636153", kMirCard, true },
+ { "2200111234567898", kMirCard, true },
+ { "2200481349288130", kMirCard, true },
// Empty string
{ std::string(), kGenericCard, false },
@@ -670,13 +675,16 @@ TEST(CreditCardTest, GetCreditCardType) {
// Fails Luhn check.
{ "4111111111111112", kVisaCard, false },
{ "6247130048162413", kUnionPay, false },
+ { "2204883716636154", kMirCard, false },
// Invalid length.
{ "3434343434343434", kAmericanExpressCard, false },
{ "411111111111116", kVisaCard, false },
+ { "220011123456783", kMirCard, false },
// Issuer Identification Numbers (IINs) that Chrome recognizes.
{ "4", kVisaCard, false },
+ { "22", kMirCard, false },
{ "34", kAmericanExpressCard, false },
{ "37", kAmericanExpressCard, false },
{ "300", kDinersCard, false },
@@ -708,6 +716,7 @@ TEST(CreditCardTest, GetCreditCardType) {
{ "62", kUnionPay, false },
// Not enough data to determine an IIN uniquely.
+ { "2", kGenericCard, false },
{ "3", kGenericCard, false },
{ "30", kGenericCard, false },
{ "309", kGenericCard, false },
@@ -721,7 +730,6 @@ TEST(CreditCardTest, GetCreditCardType) {
// Unknown IINs.
{ "0", kGenericCard, false },
{ "1", kGenericCard, false },
- { "2", kGenericCard, false },
{ "306", kGenericCard, false },
{ "307", kGenericCard, false },
{ "308", kGenericCard, false },
« no previous file with comments | « components/autofill/core/browser/credit_card.cc ('k') | components/autofill/core/browser/validation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698