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

Unified Diff: chrome/browser/autofill/credit_card_unittest.cc

Issue 11819016: [Autofill] Require callers to pass in locale when parsing named months like "January" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « chrome/browser/autofill/credit_card.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/credit_card_unittest.cc
diff --git a/chrome/browser/autofill/credit_card_unittest.cc b/chrome/browser/autofill/credit_card_unittest.cc
index 62e1f72071999861f0fcdfe2f108082dd8496b23..1297482286f7f5726c73ed8ead113ee937cc755f 100644
--- a/chrome/browser/autofill/credit_card_unittest.cc
+++ b/chrome/browser/autofill/credit_card_unittest.cc
@@ -164,7 +164,7 @@ TEST(CreditCardTest, SetRawInfoCreditCardNumber) {
}
// Verify that we can handle both numeric and named months.
-TEST(CreditCardTest, SetRawInfoExpirationMonth) {
+TEST(CreditCardTest, SetExpirationMonth) {
CreditCard card;
card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("05"));
@@ -173,10 +173,14 @@ TEST(CreditCardTest, SetRawInfoExpirationMonth) {
card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("7"));
EXPECT_EQ(ASCIIToUTF16("07"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH));
+ // This should fail, and preserve the previous value.
card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("January"));
+ EXPECT_EQ(ASCIIToUTF16("07"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH));
+
+ card.SetInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("January"), "en-US");
EXPECT_EQ(ASCIIToUTF16("01"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH));
- card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("Apr"));
+ card.SetInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("Apr"), "en-US");
EXPECT_EQ(ASCIIToUTF16("04"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH));
}
« no previous file with comments | « chrome/browser/autofill/credit_card.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698