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/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 full_wallet.GetInfo( | 498 full_wallet.GetInfo( |
499 AutofillType(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR))); | 499 AutofillType(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR))); |
500 | 500 |
501 std::vector<uint8> one_time_pad; | 501 std::vector<uint8> one_time_pad; |
502 EXPECT_TRUE(base::HexStringToBytes("075DA779F98B", &one_time_pad)); | 502 EXPECT_TRUE(base::HexStringToBytes("075DA779F98B", &one_time_pad)); |
503 full_wallet.set_one_time_pad(one_time_pad); | 503 full_wallet.set_one_time_pad(one_time_pad); |
504 EXPECT_EQ(ASCIIToUTF16("MasterCard"), | 504 EXPECT_EQ(ASCIIToUTF16("MasterCard"), |
505 full_wallet.GetInfo(AutofillType(CREDIT_CARD_TYPE))); | 505 full_wallet.GetInfo(AutofillType(CREDIT_CARD_TYPE))); |
506 } | 506 } |
507 | 507 |
| 508 TEST_F(FullWalletTest, CreateFullWalletFromClearTextData) { |
| 509 scoped_ptr<FullWallet> full_wallet = |
| 510 FullWallet::CreateFullWalletFromClearText( |
| 511 11, 2012, |
| 512 "5555555555554444", "123", |
| 513 GetTestAddress(), GetTestShippingAddress()); |
| 514 EXPECT_EQ(ASCIIToUTF16("5555555555554444"), |
| 515 full_wallet->GetInfo(AutofillType(CREDIT_CARD_NUMBER))); |
| 516 EXPECT_EQ(ASCIIToUTF16("MasterCard"), |
| 517 full_wallet->GetInfo(AutofillType(CREDIT_CARD_TYPE))); |
| 518 EXPECT_EQ(ASCIIToUTF16("123"), |
| 519 full_wallet->GetInfo(AutofillType(CREDIT_CARD_VERIFICATION_CODE))); |
| 520 EXPECT_EQ(ASCIIToUTF16("11/12"), |
| 521 full_wallet->GetInfo( |
| 522 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR))); |
| 523 EXPECT_TRUE(GetTestAddress()->EqualsIgnoreID( |
| 524 *full_wallet->billing_address())); |
| 525 EXPECT_TRUE(GetTestShippingAddress()->EqualsIgnoreID( |
| 526 *full_wallet->shipping_address())); |
| 527 } |
| 528 |
508 } // namespace wallet | 529 } // namespace wallet |
509 } // namespace autofill | 530 } // namespace autofill |
OLD | NEW |