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

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

Issue 2170773002: UnionPay credit card numbers now validated by Luhn checksum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | 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 52a23ba8605d70e17b63cc15c7563f732af691fe..a6e13a59076b2a26060002b44b484fe548076aa4 100644
--- a/components/autofill/core/browser/credit_card_unittest.cc
+++ b/components/autofill/core/browser/credit_card_unittest.cc
@@ -50,9 +50,7 @@ const char* const kValidNumbers[] = {
"4222-2222-2222-2",
"5019717010103742",
"6331101999990016",
-
- // A UnionPay card that doesn't pass the Luhn checksum
- "6200000000000000",
+ "6247130048162403",
};
const char* const kInvalidNumbers[] = {
"4111 1111 112", /* too short */
@@ -642,7 +640,7 @@ TEST(CreditCardTest, GetCreditCardType) {
{ "4222222222222", kVisaCard, true },
// The relevant sample numbers from
- // http://auricsystems.com/support-center/sample-credit-card-numbers/
+ // https://www.auricsystems.com/sample-credit-card-numbers/
{ "343434343434343", kAmericanExpressCard, true },
{ "371144371144376", kAmericanExpressCard, true },
{ "341134113411347", kAmericanExpressCard, true },
@@ -665,9 +663,9 @@ TEST(CreditCardTest, GetCreditCardType) {
{ "5111005111051128", kMasterCard, true },
{ "5112345112345114", kMasterCard, true },
{ "5115915115915118", kMasterCard, true },
-
- // A UnionPay card that doesn't pass the Luhn checksum
- { "6200000000000000", kUnionPay, true },
+ { "6247130048162403", kUnionPay, true },
+ { "6247130048162403", kUnionPay, true },
+ { "622384452162063648", kUnionPay, true },
// Empty string
{ std::string(), kGenericCard, false },
@@ -678,6 +676,7 @@ TEST(CreditCardTest, GetCreditCardType) {
// Fails Luhn check.
{ "4111111111111112", kVisaCard, false },
+ { "6247130048162413", kUnionPay, false },
// Invalid length.
{ "3434343434343434", kAmericanExpressCard, false },
« no previous file with comments | « no previous file | components/autofill/core/browser/validation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698