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 "components/autofill/core/browser/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 3703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3714 EXPECT_EQ(ASCIIToUTF16("Bonnie Parker"), suggestions[2].value); | 3714 EXPECT_EQ(ASCIIToUTF16("Bonnie Parker"), suggestions[2].value); |
3715 EXPECT_EQ(ASCIIToUTF16("Bonnie Parker"), suggestions[3].value); | 3715 EXPECT_EQ(ASCIIToUTF16("Bonnie Parker"), suggestions[3].value); |
3716 | 3716 |
3717 suggestions = personal_data_->GetCreditCardSuggestions( | 3717 suggestions = personal_data_->GetCreditCardSuggestions( |
3718 AutofillType(CREDIT_CARD_NUMBER), /* field_contents= */ base::string16()); | 3718 AutofillType(CREDIT_CARD_NUMBER), /* field_contents= */ base::string16()); |
3719 ASSERT_EQ(4U, suggestions.size()); | 3719 ASSERT_EQ(4U, suggestions.size()); |
3720 EXPECT_EQ(UTF8ToUTF16("Visa" + kUTF8MidlineEllipsis + "9012"), | 3720 EXPECT_EQ(UTF8ToUTF16("Visa" + kUTF8MidlineEllipsis + "9012"), |
3721 suggestions[0].value); | 3721 suggestions[0].value); |
3722 EXPECT_EQ(UTF8ToUTF16("Amex" + kUTF8MidlineEllipsis + "8555"), | 3722 EXPECT_EQ(UTF8ToUTF16("Amex" + kUTF8MidlineEllipsis + "8555"), |
3723 suggestions[1].value); | 3723 suggestions[1].value); |
3724 EXPECT_EQ(UTF8ToUTF16("MasterCard" + kUTF8MidlineEllipsis + "2109"), | 3724 EXPECT_EQ(UTF8ToUTF16("Mastercard" + kUTF8MidlineEllipsis + "2109"), |
3725 suggestions[2].value); | 3725 suggestions[2].value); |
3726 EXPECT_EQ(UTF8ToUTF16("Visa" + kUTF8MidlineEllipsis + "2109"), | 3726 EXPECT_EQ(UTF8ToUTF16("Visa" + kUTF8MidlineEllipsis + "2109"), |
3727 suggestions[3].value); | 3727 suggestions[3].value); |
3728 } | 3728 } |
3729 | 3729 |
3730 // Tests that a full server card can be a dupe of more than one local card. | 3730 // Tests that a full server card can be a dupe of more than one local card. |
3731 TEST_F(PersonalDataManagerTest, | 3731 TEST_F(PersonalDataManagerTest, |
3732 GetCreditCardSuggestions_ServerCardDuplicateOfMultipleLocalCards) { | 3732 GetCreditCardSuggestions_ServerCardDuplicateOfMultipleLocalCards) { |
3733 EnableWalletCardImport(); | 3733 EnableWalletCardImport(); |
3734 SetupReferenceLocalCreditCards(); | 3734 SetupReferenceLocalCreditCards(); |
(...skipping 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6212 // to the converted address. | 6212 // to the converted address. |
6213 EXPECT_EQ(profiles[0]->guid(), | 6213 EXPECT_EQ(profiles[0]->guid(), |
6214 personal_data_->GetCreditCards()[0]->billing_address_id()); | 6214 personal_data_->GetCreditCards()[0]->billing_address_id()); |
6215 // Make sure that the billing address id of the new server card still refers | 6215 // Make sure that the billing address id of the new server card still refers |
6216 // to the converted address. | 6216 // to the converted address. |
6217 EXPECT_EQ(profiles[0]->guid(), | 6217 EXPECT_EQ(profiles[0]->guid(), |
6218 personal_data_->GetCreditCards()[1]->billing_address_id()); | 6218 personal_data_->GetCreditCards()[1]->billing_address_id()); |
6219 } | 6219 } |
6220 | 6220 |
6221 } // namespace autofill | 6221 } // namespace autofill |
OLD | NEW |