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

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

Issue 112433004: Update uses of UTF conversions in chrome_frame/, chromeos/, components/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
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"
11 #include "components/autofill/core/browser/validation.h" 11 #include "components/autofill/core/browser/validation.h"
12 #include "components/autofill/core/common/form_field_data.h" 12 #include "components/autofill/core/common/form_field_data.h"
13 #include "grit/webkit_resources.h" 13 #include "grit/webkit_resources.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 using base::ASCIIToUTF16;
17
16 namespace autofill { 18 namespace autofill {
17 namespace { 19 namespace {
18 20
19 // From https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card _numbers.htm 21 // From https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card _numbers.htm
20 const char* const kValidNumbers[] = { 22 const char* const kValidNumbers[] = {
21 "378282246310005", 23 "378282246310005",
22 "3714 4963 5398 431", 24 "3714 4963 5398 431",
23 "3787-3449-3671-000", 25 "3787-3449-3671-000",
24 "5610591081018250", 26 "5610591081018250",
25 "3056 9309 0259 04", 27 "3056 9309 0259 04",
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 520
519 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 521 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) {
520 base::string16 card_number = ASCIIToUTF16(test_cases[i].card_number); 522 base::string16 card_number = ASCIIToUTF16(test_cases[i].card_number);
521 SCOPED_TRACE(card_number); 523 SCOPED_TRACE(card_number);
522 EXPECT_EQ(test_cases[i].type, CreditCard::GetCreditCardType(card_number)); 524 EXPECT_EQ(test_cases[i].type, CreditCard::GetCreditCardType(card_number));
523 EXPECT_EQ(test_cases[i].is_valid, IsValidCreditCardNumber(card_number)); 525 EXPECT_EQ(test_cases[i].is_valid, IsValidCreditCardNumber(card_number));
524 } 526 }
525 } 527 }
526 528
527 } // namespace autofill 529 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/credit_card_field_unittest.cc ('k') | components/autofill/core/browser/email_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698