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

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

Issue 23882013: [rAc] Persist selection of newly added cards and addresses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test compile Created 7 years, 3 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 | Annotate | Revision Log
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 <map> 5 #include <map>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 PersonalDataManagerMock::~PersonalDataManagerMock() { 104 PersonalDataManagerMock::~PersonalDataManagerMock() {
105 } 105 }
106 106
107 void PersonalDataManagerMock::Reset() { 107 void PersonalDataManagerMock::Reset() {
108 profiles_.clear(); 108 profiles_.clear();
109 } 109 }
110 110
111 void PersonalDataManagerMock::SaveImportedProfile( 111 void PersonalDataManagerMock::SaveImportedProfile(
112 const AutofillProfile& profile) { 112 const AutofillProfile& profile) {
113 std::vector<AutofillProfile> profiles; 113 std::vector<AutofillProfile> profiles;
114 if (!MergeProfile(profile, profiles_.get(), "en-US", &profiles)) 114 std::string merged_guid =
115 MergeProfile(profile, profiles_.get(), "en-US", &profiles);
116 if (merged_guid != profile.guid())
115 profiles_.push_back(new AutofillProfile(profile)); 117 profiles_.push_back(new AutofillProfile(profile));
116 } 118 }
117 119
118 const std::vector<AutofillProfile*>& PersonalDataManagerMock::web_profiles() 120 const std::vector<AutofillProfile*>& PersonalDataManagerMock::web_profiles()
119 const { 121 const {
120 return profiles_.get(); 122 return profiles_.get();
121 } 123 }
122 124
123 } // namespace 125 } // namespace
124 126
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 ServerFieldType AutofillMergeTest::StringToFieldType(const std::string& str) { 241 ServerFieldType AutofillMergeTest::StringToFieldType(const std::string& str) {
240 return string_to_field_type_map_[str]; 242 return string_to_field_type_map_[str];
241 } 243 }
242 244
243 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { 245 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) {
244 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), 246 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName),
245 kFileNamePattern); 247 kFileNamePattern);
246 } 248 }
247 249
248 } // namespace autofill 250 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698