| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerMock); | 82 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerMock); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 PersonalDataManagerMock::PersonalDataManagerMock() : PersonalDataManager() { | 85 PersonalDataManagerMock::PersonalDataManagerMock() : PersonalDataManager() { |
| 86 } | 86 } |
| 87 | 87 |
| 88 PersonalDataManagerMock::~PersonalDataManagerMock() { | 88 PersonalDataManagerMock::~PersonalDataManagerMock() { |
| 89 } | 89 } |
| 90 | 90 |
| 91 void PersonalDataManagerMock::Reset() { | 91 void PersonalDataManagerMock::Reset() { |
| 92 profiles_.reset(); | 92 profiles_.clear(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void PersonalDataManagerMock::SaveImportedProfile( | 95 void PersonalDataManagerMock::SaveImportedProfile( |
| 96 const AutofillProfile& profile) { | 96 const AutofillProfile& profile) { |
| 97 std::vector<AutofillProfile> profiles; | 97 std::vector<AutofillProfile> profiles; |
| 98 if (!MergeProfile(profile, profiles_.get(), &profiles)) | 98 if (!MergeProfile(profile, profiles_.get(), &profiles)) |
| 99 profiles_.push_back(new AutofillProfile(profile)); | 99 profiles_.push_back(new AutofillProfile(profile)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 const std::vector<AutofillProfile*>& PersonalDataManagerMock::web_profiles() | 102 const std::vector<AutofillProfile*>& PersonalDataManagerMock::web_profiles() |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 *merged_profiles = SerializeProfiles(personal_data_.web_profiles()); | 211 *merged_profiles = SerializeProfiles(personal_data_.web_profiles()); |
| 212 } | 212 } |
| 213 | 213 |
| 214 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { | 214 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { |
| 215 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), | 215 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), |
| 216 kFileNamePattern); | 216 kFileNamePattern); |
| 217 } | 217 } |
| OLD | NEW |