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

Side by Side Diff: components/autofill/core/browser/credit_card_unittest.cc

Issue 1074343004: get rid of another inappropriate ToLowerASCII (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nodeleteallowed
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/guid.h" 6 #include "base/guid.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "components/autofill/core/browser/autofill_test_utils.h" 8 #include "components/autofill/core/browser/autofill_test_utils.h"
9 #include "components/autofill/core/browser/autofill_type.h" 9 #include "components/autofill/core/browser/autofill_type.h"
10 #include "components/autofill/core/browser/credit_card.h" 10 #include "components/autofill/core/browser/credit_card.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 card.SetInfo( 440 card.SetInfo(
441 AutofillType(CREDIT_CARD_EXP_MONTH), ASCIIToUTF16("January"), "en-US"); 441 AutofillType(CREDIT_CARD_EXP_MONTH), ASCIIToUTF16("January"), "en-US");
442 EXPECT_EQ(ASCIIToUTF16("01"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH)); 442 EXPECT_EQ(ASCIIToUTF16("01"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH));
443 EXPECT_EQ(1, card.expiration_month()); 443 EXPECT_EQ(1, card.expiration_month());
444 444
445 card.SetInfo( 445 card.SetInfo(
446 AutofillType(CREDIT_CARD_EXP_MONTH), ASCIIToUTF16("Apr"), "en-US"); 446 AutofillType(CREDIT_CARD_EXP_MONTH), ASCIIToUTF16("Apr"), "en-US");
447 EXPECT_EQ(ASCIIToUTF16("04"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH)); 447 EXPECT_EQ(ASCIIToUTF16("04"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH));
448 EXPECT_EQ(4, card.expiration_month()); 448 EXPECT_EQ(4, card.expiration_month());
449
450 card.SetInfo(
451 AutofillType(CREDIT_CARD_EXP_MONTH), UTF8ToUTF16("F\xc3\x89VRIER"),
452 "fr-FR");
453 EXPECT_EQ(ASCIIToUTF16("02"), card.GetRawInfo(CREDIT_CARD_EXP_MONTH));
454 EXPECT_EQ(2, card.expiration_month());
449 } 455 }
450 456
451 TEST(CreditCardTest, CreditCardType) { 457 TEST(CreditCardTest, CreditCardType) {
452 CreditCard card(base::GenerateGUID(), "https://www.example.com/"); 458 CreditCard card(base::GenerateGUID(), "https://www.example.com/");
453 459
454 // The card type cannot be set directly. 460 // The card type cannot be set directly.
455 card.SetRawInfo(CREDIT_CARD_TYPE, ASCIIToUTF16("Visa")); 461 card.SetRawInfo(CREDIT_CARD_TYPE, ASCIIToUTF16("Visa"));
456 EXPECT_EQ(base::string16(), card.GetRawInfo(CREDIT_CARD_TYPE)); 462 EXPECT_EQ(base::string16(), card.GetRawInfo(CREDIT_CARD_TYPE));
457 463
458 // Setting the number should implicitly set the type. 464 // Setting the number should implicitly set the type.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 base::string16 card_number = base::ASCIIToUTF16("test"); 658 base::string16 card_number = base::ASCIIToUTF16("test");
653 int month = 1; 659 int month = 1;
654 int year = 3000; 660 int year = 3000;
655 CreditCard card(card_number, month, year); 661 CreditCard card(card_number, month, year);
656 EXPECT_EQ(card_number, card.number()); 662 EXPECT_EQ(card_number, card.number());
657 EXPECT_EQ(month, card.expiration_month()); 663 EXPECT_EQ(month, card.expiration_month());
658 EXPECT_EQ(year, card.expiration_year()); 664 EXPECT_EQ(year, card.expiration_year());
659 } 665 }
660 666
661 } // namespace autofill 667 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/credit_card.cc ('k') | components/password_manager/core/browser/password_autofill_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698