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

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

Issue 18927003: [Autofill] Don't validate China UnionPay cards with the Luhn checksum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Parens for order of operations Created 7 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 | « 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 b92488d1e9e617442eff93315b6777bd42f60df8..c8b77bf50b9b195fe659b77a85bc00dada9fe288 100644
--- a/components/autofill/core/browser/credit_card_unittest.cc
+++ b/components/autofill/core/browser/credit_card_unittest.cc
@@ -34,6 +34,9 @@ const char* const kValidNumbers[] = {
"4222-2222-2222-2",
"5019717010103742",
"6331101999990016",
+
+ // A UnionPay card that doesn't pass the Luhn checksum
+ "6200000000000000",
};
const char* const kInvalidNumbers[] = {
"4111 1111 112", /* too short */
@@ -559,6 +562,9 @@ TEST(CreditCardTest, GetCreditCardType) {
{ "5112345112345114", kMasterCard, true },
{ "5115915115915118", kMasterCard, true },
+ // A UnionPay card that doesn't pass the Luhn checksum
+ { "6200000000000000", kUnionPay, true },
+
// Empty string
{ std::string(), kGenericCard, false },
@@ -603,6 +609,7 @@ TEST(CreditCardTest, GetCreditCardType) {
{ "53", kMasterCard, false },
{ "54", kMasterCard, false },
{ "55", kMasterCard, false },
+ { "62", kUnionPay, false },
// Not enough data to determine an IIN uniquely.
{ "3", kGenericCard, false },
@@ -646,7 +653,6 @@ TEST(CreditCardTest, GetCreditCardType) {
{ "608", kGenericCard, false },
{ "609", kGenericCard, false },
{ "61", kGenericCard, false },
- { "62", kGenericCard, false },
{ "63", kGenericCard, false },
{ "640", kGenericCard, false },
{ "641", 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