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

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

Issue 1907163003: Don't offer to save credit cards with an empty or 0 month. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/validation.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/validation_unittest.cc
diff --git a/components/autofill/core/browser/validation_unittest.cc b/components/autofill/core/browser/validation_unittest.cc
index 49037f49f7500f0e2c5c610033ac7c9d56b795a2..0312a7d7fef57e0af64de3c39fdf47d818035234 100644
--- a/components/autofill/core/browser/validation_unittest.cc
+++ b/components/autofill/core/browser/validation_unittest.cc
@@ -58,20 +58,26 @@ const char kCurrentDate[]="1 May 2013";
const ExpirationDate kValidCreditCardExpirationDate[] = {
{ "2013", "5" }, // Valid month in current year.
{ "2014", "1" }, // Any month in next year.
+ { "2014", "12" }, // Edge condition.
{ "2014", " 1" }, // Whitespace in month.
{ " 2014", "1" }, // Whitespace in year.
};
const IntExpirationDate kValidCreditCardIntExpirationDate[] = {
{ 2013, 5 }, // Valid month in current year.
{ 2014, 1 }, // Any month in next year.
+ { 2014, 12 }, // Edge condition.
};
const ExpirationDate kInvalidCreditCardExpirationDate[] = {
{ "2013", "04" }, // Previous month in current year.
{ "2012", "12" }, // Any month in previous year.
+ { "2015", "13" }, // Not a real month.
+ { "2015", "00" }, // Zero is legal in the CC class but is not a valid date.
};
const IntExpirationDate kInvalidCreditCardIntExpirationDate[] = {
{ 2013, 4 }, // Previous month in current year.
{ 2012, 12 }, // Any month in previous year.
+ { 2015, 13 }, // Not a real month.
+ { 2015, 0 }, // Zero is legal in the CC class but is not a valid date.
};
const char* const kValidCreditCardSecurityCode[] = {
"323", // 3-digit CSC.
« no previous file with comments | « components/autofill/core/browser/validation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698