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

Side by Side Diff: chrome/browser/autofill/credit_card_unittest.cc

Issue 7125004: Support named months for Autofill implicit learning (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: From one, two Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autofill/credit_card.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/autofill/autofill_common_test.h" 7 #include "chrome/browser/autofill/autofill_common_test.h"
8 #include "chrome/browser/autofill/credit_card.h" 8 #include "chrome/browser/autofill/credit_card.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 // Verify that we preserve exactly what the user typed for credit card numbers. 128 // Verify that we preserve exactly what the user typed for credit card numbers.
129 TEST(CreditCardTest, SetInfoCreditCardNumber) { 129 TEST(CreditCardTest, SetInfoCreditCardNumber) {
130 CreditCard card; 130 CreditCard card;
131 131
132 autofill_test::SetCreditCardInfo(&card, "Bob Dylan", 132 autofill_test::SetCreditCardInfo(&card, "Bob Dylan",
133 "4321-5432-6543-xxxx", "07", "2013"); 133 "4321-5432-6543-xxxx", "07", "2013");
134 EXPECT_EQ(ASCIIToUTF16("4321-5432-6543-xxxx"), 134 EXPECT_EQ(ASCIIToUTF16("4321-5432-6543-xxxx"),
135 card.GetInfo(CREDIT_CARD_NUMBER)); 135 card.GetInfo(CREDIT_CARD_NUMBER));
136 } 136 }
137
138 // Verify that we can handle both numeric and named months.
139 TEST(CreditCardTest, SetInfoExpirationMonth) {
140 CreditCard card;
141
142 card.SetInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("05"));
143 EXPECT_EQ(ASCIIToUTF16("05"), card.GetInfo(CREDIT_CARD_EXP_MONTH));
144
145 card.SetInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("7"));
146 EXPECT_EQ(ASCIIToUTF16("07"), card.GetInfo(CREDIT_CARD_EXP_MONTH));
147
148 card.SetInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("January"));
149 EXPECT_EQ(ASCIIToUTF16("01"), card.GetInfo(CREDIT_CARD_EXP_MONTH));
150
151 card.SetInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("Apr"));
152 EXPECT_EQ(ASCIIToUTF16("04"), card.GetInfo(CREDIT_CARD_EXP_MONTH));
153 }
OLDNEW
« 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