| 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 21 matching lines...) Expand all Loading... |
| 32 NAME_MIDDLE, | 32 NAME_MIDDLE, |
| 33 NAME_LAST, | 33 NAME_LAST, |
| 34 EMAIL_ADDRESS, | 34 EMAIL_ADDRESS, |
| 35 COMPANY_NAME, | 35 COMPANY_NAME, |
| 36 ADDRESS_HOME_LINE1, | 36 ADDRESS_HOME_LINE1, |
| 37 ADDRESS_HOME_LINE2, | 37 ADDRESS_HOME_LINE2, |
| 38 ADDRESS_HOME_CITY, | 38 ADDRESS_HOME_CITY, |
| 39 ADDRESS_HOME_STATE, | 39 ADDRESS_HOME_STATE, |
| 40 ADDRESS_HOME_ZIP, | 40 ADDRESS_HOME_ZIP, |
| 41 ADDRESS_HOME_COUNTRY, | 41 ADDRESS_HOME_COUNTRY, |
| 42 PHONE_HOME_WHOLE_NUMBER, | 42 PHONE_HOME_WHOLE_NUMBER |
| 43 PHONE_FAX_WHOLE_NUMBER, | |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 // Serializes the |profiles| into a string. | 45 // Serializes the |profiles| into a string. |
| 47 std::string SerializeProfiles(const std::vector<AutofillProfile*>& profiles) { | 46 std::string SerializeProfiles(const std::vector<AutofillProfile*>& profiles) { |
| 48 std::string result; | 47 std::string result; |
| 49 for (size_t i = 0; i < profiles.size(); ++i) { | 48 for (size_t i = 0; i < profiles.size(); ++i) { |
| 50 result += kProfileSeparator; | 49 result += kProfileSeparator; |
| 51 result += "\n"; | 50 result += "\n"; |
| 52 for (size_t j = 0; j < arraysize(kProfileFieldTypes); ++j) { | 51 for (size_t j = 0; j < arraysize(kProfileFieldTypes); ++j) { |
| 53 AutofillFieldType type = kProfileFieldTypes[j]; | 52 AutofillFieldType type = kProfileFieldTypes[j]; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } | 210 } |
| 212 } | 211 } |
| 213 | 212 |
| 214 *merged_profiles = SerializeProfiles(personal_data_->web_profiles()); | 213 *merged_profiles = SerializeProfiles(personal_data_->web_profiles()); |
| 215 } | 214 } |
| 216 | 215 |
| 217 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { | 216 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { |
| 218 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), | 217 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), |
| 219 kFileNamePattern); | 218 kFileNamePattern); |
| 220 } | 219 } |
| OLD | NEW |