| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/files/file_path.h" | 8 #include "base/files/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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // PersonalDataManager: | 75 // PersonalDataManager: |
| 76 virtual void SaveImportedProfile(const AutofillProfile& profile) OVERRIDE; | 76 virtual void SaveImportedProfile(const AutofillProfile& profile) OVERRIDE; |
| 77 virtual const std::vector<AutofillProfile*>& web_profiles() const OVERRIDE; | 77 virtual const std::vector<AutofillProfile*>& web_profiles() const OVERRIDE; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 ScopedVector<AutofillProfile> profiles_; | 80 ScopedVector<AutofillProfile> profiles_; |
| 81 | 81 |
| 82 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerMock); | 82 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerMock); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 PersonalDataManagerMock::PersonalDataManagerMock() : PersonalDataManager() { | 85 PersonalDataManagerMock::PersonalDataManagerMock() |
| 86 : PersonalDataManager("en-US") { |
| 86 } | 87 } |
| 87 | 88 |
| 88 PersonalDataManagerMock::~PersonalDataManagerMock() { | 89 PersonalDataManagerMock::~PersonalDataManagerMock() { |
| 89 } | 90 } |
| 90 | 91 |
| 91 void PersonalDataManagerMock::Reset() { | 92 void PersonalDataManagerMock::Reset() { |
| 92 profiles_.clear(); | 93 profiles_.clear(); |
| 93 } | 94 } |
| 94 | 95 |
| 95 void PersonalDataManagerMock::SaveImportedProfile( | 96 void PersonalDataManagerMock::SaveImportedProfile( |
| 96 const AutofillProfile& profile) { | 97 const AutofillProfile& profile) { |
| 97 std::vector<AutofillProfile> profiles; | 98 std::vector<AutofillProfile> profiles; |
| 98 if (!MergeProfile(profile, profiles_.get(), &profiles)) | 99 if (!MergeProfile(profile, profiles_.get(), "en-US", &profiles)) |
| 99 profiles_.push_back(new AutofillProfile(profile)); | 100 profiles_.push_back(new AutofillProfile(profile)); |
| 100 } | 101 } |
| 101 | 102 |
| 102 const std::vector<AutofillProfile*>& PersonalDataManagerMock::web_profiles() | 103 const std::vector<AutofillProfile*>& PersonalDataManagerMock::web_profiles() |
| 103 const { | 104 const { |
| 104 return profiles_.get(); | 105 return profiles_.get(); |
| 105 } | 106 } |
| 106 | 107 |
| 107 } // namespace | 108 } // namespace |
| 108 | 109 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 209 } |
| 209 } | 210 } |
| 210 | 211 |
| 211 *merged_profiles = SerializeProfiles(personal_data_.web_profiles()); | 212 *merged_profiles = SerializeProfiles(personal_data_.web_profiles()); |
| 212 } | 213 } |
| 213 | 214 |
| 214 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { | 215 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { |
| 215 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), | 216 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), |
| 216 kFileNamePattern); | 217 kFileNamePattern); |
| 217 } | 218 } |
| OLD | NEW |