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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
494 EXPECT_EQ(ASCIIToUTF16("12/2015"), | 494 EXPECT_EQ(ASCIIToUTF16("12/2015"), |
495 full_wallet.GetInfo(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR)); | 495 full_wallet.GetInfo(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR)); |
496 | 496 |
497 std::vector<uint8> one_time_pad; | 497 std::vector<uint8> one_time_pad; |
498 EXPECT_TRUE(base::HexStringToBytes("075DA779F98B", &one_time_pad)); | 498 EXPECT_TRUE(base::HexStringToBytes("075DA779F98B", &one_time_pad)); |
499 full_wallet.set_one_time_pad(one_time_pad); | 499 full_wallet.set_one_time_pad(one_time_pad); |
500 EXPECT_EQ(ASCIIToUTF16("MasterCard"), | 500 EXPECT_EQ(ASCIIToUTF16("MasterCard"), |
501 full_wallet.GetInfo(CREDIT_CARD_TYPE)); | 501 full_wallet.GetInfo(CREDIT_CARD_TYPE)); |
502 } | 502 } |
503 | 503 |
504 TEST_F(FullWalletTest, CreateFullWalletFromClearTextData) { | |
505 scoped_ptr<FullWallet> full_wallet = | |
506 FullWallet::CreateFullWalletFromClearText( | |
507 11, 2012, | |
508 "5555555555554444", "123", | |
509 GetTestAddress(), GetTestShippingAddress()); | |
510 EXPECT_EQ(ASCIIToUTF16("5555555555554444"), | |
511 full_wallet->GetInfo(CREDIT_CARD_NUMBER)); | |
512 EXPECT_EQ(ASCIIToUTF16("MasterCard"), | |
513 full_wallet->GetInfo(CREDIT_CARD_TYPE)); | |
514 EXPECT_EQ(ASCIIToUTF16("123"), | |
515 full_wallet->GetInfo(CREDIT_CARD_VERIFICATION_CODE)); | |
516 EXPECT_EQ(ASCIIToUTF16("11/12"), | |
517 full_wallet->GetInfo(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR)); | |
Dan Beam
2013/08/06 03:38:17
nit: maybe test addresses?
aruslan
2013/08/07 18:21:16
Done.
| |
518 } | |
519 | |
Dan Beam
2013/08/06 03:38:17
^H
aruslan
2013/08/07 18:21:16
Done.
| |
520 | |
504 } // namespace wallet | 521 } // namespace wallet |
505 } // namespace autofill | 522 } // namespace autofill |
OLD | NEW |