Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: components/autofill/core/browser/personal_data_manager_unittest.cc

Issue 2674573010: [Autofill] Transfer billing address of server cards when deduping. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4785 matching lines...) Expand 10 before | Expand all | Expand 10 after
4796 credit_card2->set_billing_address_id("D"); 4796 credit_card2->set_billing_address_id("D");
4797 CreditCard* credit_card3 = 4797 CreditCard* credit_card3 =
4798 new CreditCard(base::GenerateGUID(), "https://www.example.com"); 4798 new CreditCard(base::GenerateGUID(), "https://www.example.com");
4799 credit_card3->set_billing_address_id("E"); 4799 credit_card3->set_billing_address_id("E");
4800 CreditCard* credit_card4 = 4800 CreditCard* credit_card4 =
4801 new CreditCard(base::GenerateGUID(), "https://www.example.com"); 4801 new CreditCard(base::GenerateGUID(), "https://www.example.com");
4802 credit_card4->set_billing_address_id("F"); 4802 credit_card4->set_billing_address_id("F");
4803 4803
4804 // Add the credit cards to the database. 4804 // Add the credit cards to the database.
4805 personal_data_->local_credit_cards_.push_back(base::WrapUnique(credit_card1)); 4805 personal_data_->local_credit_cards_.push_back(base::WrapUnique(credit_card1));
4806 personal_data_->local_credit_cards_.push_back(base::WrapUnique(credit_card2)); 4806 personal_data_->server_credit_cards_.push_back(
4807 base::WrapUnique(credit_card2));
4807 personal_data_->local_credit_cards_.push_back(base::WrapUnique(credit_card3)); 4808 personal_data_->local_credit_cards_.push_back(base::WrapUnique(credit_card3));
4808 personal_data_->local_credit_cards_.push_back(base::WrapUnique(credit_card4)); 4809 personal_data_->server_credit_cards_.push_back(
4810 base::WrapUnique(credit_card4));
4809 4811
4810 personal_data_->UpdateCardsBillingAddressReference(guids_merge_map); 4812 personal_data_->UpdateCardsBillingAddressReference(guids_merge_map);
4811 4813
4812 // The first card's billing address should now be E. 4814 // The first card's billing address should now be E.
4813 EXPECT_EQ("E", credit_card1->billing_address_id()); 4815 EXPECT_EQ("E", credit_card1->billing_address_id());
4814 // The second card's billing address should now be E. 4816 // The second card's billing address should now be E.
4815 EXPECT_EQ("E", credit_card2->billing_address_id()); 4817 EXPECT_EQ("E", credit_card2->billing_address_id());
4816 // The third card's billing address should still be E. 4818 // The third card's billing address should still be E.
4817 EXPECT_EQ("E", credit_card3->billing_address_id()); 4819 EXPECT_EQ("E", credit_card3->billing_address_id());
4818 // The fourth card's billing address should still be F. 4820 // The fourth card's billing address should still be F.
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
5639 EnableAutofillProfileCleanup(); 5641 EnableAutofillProfileCleanup();
5640 5642
5641 // The deduping routine should not be run. 5643 // The deduping routine should not be run.
5642 EXPECT_FALSE(personal_data_->ApplyDedupingRoutine()); 5644 EXPECT_FALSE(personal_data_->ApplyDedupingRoutine());
5643 5645
5644 // The two duplicate profiles should still be present. 5646 // The two duplicate profiles should still be present.
5645 EXPECT_EQ(2U, personal_data_->GetProfiles().size()); 5647 EXPECT_EQ(2U, personal_data_->GetProfiles().size());
5646 } 5648 }
5647 5649
5648 } // namespace autofill 5650 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698