OLD | NEW |
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/component_scaled_resources.h" | 13 #include "grit/components_scaled_resources.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 using base::ASCIIToUTF16; | 16 using base::ASCIIToUTF16; |
17 | 17 |
18 namespace autofill { | 18 namespace autofill { |
19 namespace { | 19 namespace { |
20 | 20 |
21 // 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 |
22 const char* const kValidNumbers[] = { | 22 const char* const kValidNumbers[] = { |
23 "378282246310005", | 23 "378282246310005", |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 520 |
521 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { | 521 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { |
522 base::string16 card_number = ASCIIToUTF16(test_cases[i].card_number); | 522 base::string16 card_number = ASCIIToUTF16(test_cases[i].card_number); |
523 SCOPED_TRACE(card_number); | 523 SCOPED_TRACE(card_number); |
524 EXPECT_EQ(test_cases[i].type, CreditCard::GetCreditCardType(card_number)); | 524 EXPECT_EQ(test_cases[i].type, CreditCard::GetCreditCardType(card_number)); |
525 EXPECT_EQ(test_cases[i].is_valid, IsValidCreditCardNumber(card_number)); | 525 EXPECT_EQ(test_cases[i].is_valid, IsValidCreditCardNumber(card_number)); |
526 } | 526 } |
527 } | 527 } |
528 | 528 |
529 } // namespace autofill | 529 } // namespace autofill |
OLD | NEW |