| 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 5675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5686 ASSERT_EQ(2U, profiles.size()); | 5686 ASSERT_EQ(2U, profiles.size()); |
| 5687 EXPECT_EQ(UTF8ToUTF16("John"), profiles[0]->GetRawInfo(NAME_FIRST)); | 5687 EXPECT_EQ(UTF8ToUTF16("John"), profiles[0]->GetRawInfo(NAME_FIRST)); |
| 5688 EXPECT_EQ(local_profile, *profiles[1]); | 5688 EXPECT_EQ(local_profile, *profiles[1]); |
| 5689 | 5689 |
| 5690 // Make sure that the billing address id of the two cards now point to the | 5690 // Make sure that the billing address id of the two cards now point to the |
| 5691 // converted profile. | 5691 // converted profile. |
| 5692 EXPECT_EQ(profiles[0]->guid(), | 5692 EXPECT_EQ(profiles[0]->guid(), |
| 5693 personal_data_->GetCreditCards()[0]->billing_address_id()); | 5693 personal_data_->GetCreditCards()[0]->billing_address_id()); |
| 5694 EXPECT_EQ(profiles[0]->guid(), | 5694 EXPECT_EQ(profiles[0]->guid(), |
| 5695 personal_data_->GetCreditCards()[1]->billing_address_id()); | 5695 personal_data_->GetCreditCards()[1]->billing_address_id()); |
| 5696 |
| 5697 // Make sure that the added address has the email address of the currently |
| 5698 // signed-in user. |
| 5699 EXPECT_EQ(UTF8ToUTF16("syncuser@example.com"), |
| 5700 profiles[0]->GetRawInfo(EMAIL_ADDRESS)); |
| 5696 } | 5701 } |
| 5697 | 5702 |
| 5698 // Tests that the converted wallet address is merged into an existing local | 5703 // Tests that the converted wallet address is merged into an existing local |
| 5699 // profile if they are considered equivalent. Also tests that the billing | 5704 // profile if they are considered equivalent. Also tests that the billing |
| 5700 // address relationship was transferred to the converted address. | 5705 // address relationship was transferred to the converted address. |
| 5701 TEST_F(PersonalDataManagerTest, | 5706 TEST_F(PersonalDataManagerTest, |
| 5702 ConvertWalletAddressesToLocalProfiles_MergedProfile) { | 5707 ConvertWalletAddressesToLocalProfiles_MergedProfile) { |
| 5703 /////////////////////////////////////////////////////////////////////// | 5708 /////////////////////////////////////////////////////////////////////// |
| 5704 // Setup. | 5709 // Setup. |
| 5705 /////////////////////////////////////////////////////////////////////// | 5710 /////////////////////////////////////////////////////////////////////// |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5972 | 5977 |
| 5973 // Make sure that the billing address id of the two cards now point to the | 5978 // Make sure that the billing address id of the two cards now point to the |
| 5974 // converted profile. | 5979 // converted profile. |
| 5975 EXPECT_EQ(profiles[0]->guid(), | 5980 EXPECT_EQ(profiles[0]->guid(), |
| 5976 personal_data_->GetCreditCards()[0]->billing_address_id()); | 5981 personal_data_->GetCreditCards()[0]->billing_address_id()); |
| 5977 EXPECT_EQ(profiles[0]->guid(), | 5982 EXPECT_EQ(profiles[0]->guid(), |
| 5978 personal_data_->GetCreditCards()[1]->billing_address_id()); | 5983 personal_data_->GetCreditCards()[1]->billing_address_id()); |
| 5979 } | 5984 } |
| 5980 | 5985 |
| 5981 } // namespace autofill | 5986 } // namespace autofill |
| OLD | NEW |