| 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 5723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5734 ASSERT_EQ(2U, profiles.size()); | 5734 ASSERT_EQ(2U, profiles.size()); |
| 5735 EXPECT_EQ(UTF8ToUTF16("John"), profiles[0]->GetRawInfo(NAME_FIRST)); | 5735 EXPECT_EQ(UTF8ToUTF16("John"), profiles[0]->GetRawInfo(NAME_FIRST)); |
| 5736 EXPECT_EQ(local_profile, *profiles[1]); | 5736 EXPECT_EQ(local_profile, *profiles[1]); |
| 5737 | 5737 |
| 5738 // Make sure that the billing address id of the two cards now point to the | 5738 // Make sure that the billing address id of the two cards now point to the |
| 5739 // converted profile. | 5739 // converted profile. |
| 5740 EXPECT_EQ(profiles[0]->guid(), | 5740 EXPECT_EQ(profiles[0]->guid(), |
| 5741 personal_data_->GetCreditCards()[0]->billing_address_id()); | 5741 personal_data_->GetCreditCards()[0]->billing_address_id()); |
| 5742 EXPECT_EQ(profiles[0]->guid(), | 5742 EXPECT_EQ(profiles[0]->guid(), |
| 5743 personal_data_->GetCreditCards()[1]->billing_address_id()); | 5743 personal_data_->GetCreditCards()[1]->billing_address_id()); |
| 5744 |
| 5745 // Make sure that the added address has the email address of the currently |
| 5746 // signed-in user. |
| 5747 EXPECT_EQ(UTF8ToUTF16("syncuser@example.com"), |
| 5748 profiles[0]->GetRawInfo(EMAIL_ADDRESS)); |
| 5744 } | 5749 } |
| 5745 | 5750 |
| 5746 // Tests that the converted wallet address is merged into an existing local | 5751 // Tests that the converted wallet address is merged into an existing local |
| 5747 // profile if they are considered equivalent. Also tests that the billing | 5752 // profile if they are considered equivalent. Also tests that the billing |
| 5748 // address relationship was transferred to the converted address. | 5753 // address relationship was transferred to the converted address. |
| 5749 TEST_F(PersonalDataManagerTest, | 5754 TEST_F(PersonalDataManagerTest, |
| 5750 ConvertWalletAddressesToLocalProfiles_MergedProfile) { | 5755 ConvertWalletAddressesToLocalProfiles_MergedProfile) { |
| 5751 /////////////////////////////////////////////////////////////////////// | 5756 /////////////////////////////////////////////////////////////////////// |
| 5752 // Setup. | 5757 // Setup. |
| 5753 /////////////////////////////////////////////////////////////////////// | 5758 /////////////////////////////////////////////////////////////////////// |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6020 | 6025 |
| 6021 // Make sure that the billing address id of the two cards now point to the | 6026 // Make sure that the billing address id of the two cards now point to the |
| 6022 // converted profile. | 6027 // converted profile. |
| 6023 EXPECT_EQ(profiles[0]->guid(), | 6028 EXPECT_EQ(profiles[0]->guid(), |
| 6024 personal_data_->GetCreditCards()[0]->billing_address_id()); | 6029 personal_data_->GetCreditCards()[0]->billing_address_id()); |
| 6025 EXPECT_EQ(profiles[0]->guid(), | 6030 EXPECT_EQ(profiles[0]->guid(), |
| 6026 personal_data_->GetCreditCards()[1]->billing_address_id()); | 6031 personal_data_->GetCreditCards()[1]->billing_address_id()); |
| 6027 } | 6032 } |
| 6028 | 6033 |
| 6029 } // namespace autofill | 6034 } // namespace autofill |
| OLD | NEW |