| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 EXPECT_LT(0, b.Compare(a)); | 362 EXPECT_LT(0, b.Compare(a)); |
| 363 } | 363 } |
| 364 | 364 |
| 365 // This method is not compiled for iOS because these resources are not used and | 365 // This method is not compiled for iOS because these resources are not used and |
| 366 // should not be shipped. | 366 // should not be shipped. |
| 367 #if !defined(OS_IOS) | 367 #if !defined(OS_IOS) |
| 368 // Test we get the correct icon for each card type. | 368 // Test we get the correct icon for each card type. |
| 369 TEST(CreditCardTest, IconResourceId) { | 369 TEST(CreditCardTest, IconResourceId) { |
| 370 EXPECT_EQ(IDR_AUTOFILL_CC_AMEX, | 370 EXPECT_EQ(IDR_AUTOFILL_CC_AMEX, |
| 371 CreditCard::IconResourceId(kAmericanExpressCard)); | 371 CreditCard::IconResourceId(kAmericanExpressCard)); |
| 372 EXPECT_EQ(IDR_AUTOFILL_CC_GENERIC, | 372 EXPECT_EQ(IDR_AUTOFILL_CC_DINERS, |
| 373 CreditCard::IconResourceId(kDinersCard)); | 373 CreditCard::IconResourceId(kDinersCard)); |
| 374 EXPECT_EQ(IDR_AUTOFILL_CC_DISCOVER, | 374 EXPECT_EQ(IDR_AUTOFILL_CC_DISCOVER, |
| 375 CreditCard::IconResourceId(kDiscoverCard)); | 375 CreditCard::IconResourceId(kDiscoverCard)); |
| 376 EXPECT_EQ(IDR_AUTOFILL_CC_GENERIC, | 376 EXPECT_EQ(IDR_AUTOFILL_CC_JCB, |
| 377 CreditCard::IconResourceId(kJCBCard)); | 377 CreditCard::IconResourceId(kJCBCard)); |
| 378 EXPECT_EQ(IDR_AUTOFILL_CC_MASTERCARD, | 378 EXPECT_EQ(IDR_AUTOFILL_CC_MASTERCARD, |
| 379 CreditCard::IconResourceId(kMasterCard)); | 379 CreditCard::IconResourceId(kMasterCard)); |
| 380 EXPECT_EQ(IDR_AUTOFILL_CC_MIR, | 380 EXPECT_EQ(IDR_AUTOFILL_CC_MIR, |
| 381 CreditCard::IconResourceId(kMirCard)); | 381 CreditCard::IconResourceId(kMirCard)); |
| 382 EXPECT_EQ(IDR_AUTOFILL_CC_VISA, | 382 EXPECT_EQ(IDR_AUTOFILL_CC_VISA, |
| 383 CreditCard::IconResourceId(kVisaCard)); | 383 CreditCard::IconResourceId(kVisaCard)); |
| 384 } | 384 } |
| 385 #endif // #if !defined(OS_IOS) | 385 #endif // #if !defined(OS_IOS) |
| 386 | 386 |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 card.set_record_type(test_case.record_type); | 881 card.set_record_type(test_case.record_type); |
| 882 if (card.record_type() != CreditCard::LOCAL_CARD) | 882 if (card.record_type() != CreditCard::LOCAL_CARD) |
| 883 card.SetServerStatus(test_case.server_status); | 883 card.SetServerStatus(test_case.server_status); |
| 884 | 884 |
| 885 EXPECT_EQ(test_case.should_update_expiration, | 885 EXPECT_EQ(test_case.should_update_expiration, |
| 886 card.ShouldUpdateExpiration(now)); | 886 card.ShouldUpdateExpiration(now)); |
| 887 } | 887 } |
| 888 } | 888 } |
| 889 | 889 |
| 890 } // namespace autofill | 890 } // namespace autofill |
| OLD | NEW |