| 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 "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 // TODO(blundell): Eliminate the need for this conditional include. | 15 // TODO(blundell): Eliminate the need for this conditional include. |
| 16 // crbug.com/328150 | 16 // crbug.com/328150 |
| 17 #if !defined(OS_IOS) | 17 #if !defined(OS_IOS) |
| 18 #include "grit/webkit_resources.h" | 18 #include "grit/component_scaled_resources.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 using base::ASCIIToUTF16; | 21 using base::ASCIIToUTF16; |
| 22 | 22 |
| 23 namespace autofill { | 23 namespace autofill { |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 // From https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card
_numbers.htm | 26 // From https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card
_numbers.htm |
| 27 const char* const kValidNumbers[] = { | 27 const char* const kValidNumbers[] = { |
| 28 "378282246310005", | 28 "378282246310005", |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { | 531 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { |
| 532 base::string16 card_number = ASCIIToUTF16(test_cases[i].card_number); | 532 base::string16 card_number = ASCIIToUTF16(test_cases[i].card_number); |
| 533 SCOPED_TRACE(card_number); | 533 SCOPED_TRACE(card_number); |
| 534 EXPECT_EQ(test_cases[i].type, CreditCard::GetCreditCardType(card_number)); | 534 EXPECT_EQ(test_cases[i].type, CreditCard::GetCreditCardType(card_number)); |
| 535 EXPECT_EQ(test_cases[i].is_valid, IsValidCreditCardNumber(card_number)); | 535 EXPECT_EQ(test_cases[i].is_valid, IsValidCreditCardNumber(card_number)); |
| 536 } | 536 } |
| 537 } | 537 } |
| 538 | 538 |
| 539 } // namespace autofill | 539 } // namespace autofill |
| OLD | NEW |