| OLD | NEW |
| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 // A data-driven test for verifying merging of Autofill profiles. Each input is | 127 // A data-driven test for verifying merging of Autofill profiles. Each input is |
| 128 // a structured dump of a set of implicitly detected autofill profiles. The | 128 // a structured dump of a set of implicitly detected autofill profiles. The |
| 129 // corresponding output file is a dump of the saved profiles that result from | 129 // corresponding output file is a dump of the saved profiles that result from |
| 130 // importing the input profiles. The output file format is identical to the | 130 // importing the input profiles. The output file format is identical to the |
| 131 // input format. | 131 // input format. |
| 132 class AutofillMergeTest : public testing::Test, | 132 class AutofillMergeTest : public testing::Test, |
| 133 public DataDrivenTest { | 133 public DataDrivenTest { |
| 134 protected: | 134 protected: |
| 135 AutofillMergeTest(); | 135 AutofillMergeTest(); |
| 136 virtual ~AutofillMergeTest(); | 136 ~AutofillMergeTest() override; |
| 137 | 137 |
| 138 // testing::Test: | 138 // testing::Test: |
| 139 virtual void SetUp(); | 139 void SetUp() override; |
| 140 | 140 |
| 141 // DataDrivenTest: | 141 // DataDrivenTest: |
| 142 void GenerateResults(const std::string& input, std::string* output) override; | 142 void GenerateResults(const std::string& input, std::string* output) override; |
| 143 | 143 |
| 144 // Deserializes a set of Autofill profiles from |profiles|, imports each | 144 // Deserializes a set of Autofill profiles from |profiles|, imports each |
| 145 // sequentially, and fills |merged_profiles| with the serialized result. | 145 // sequentially, and fills |merged_profiles| with the serialized result. |
| 146 void MergeProfiles(const std::string& profiles, std::string* merged_profiles); | 146 void MergeProfiles(const std::string& profiles, std::string* merged_profiles); |
| 147 | 147 |
| 148 // Deserializes |str| into a field type. | 148 // Deserializes |str| into a field type. |
| 149 ServerFieldType StringToFieldType(const std::string& str); | 149 ServerFieldType StringToFieldType(const std::string& str); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 ServerFieldType AutofillMergeTest::StringToFieldType(const std::string& str) { | 241 ServerFieldType AutofillMergeTest::StringToFieldType(const std::string& str) { |
| 242 return string_to_field_type_map_[str]; | 242 return string_to_field_type_map_[str]; |
| 243 } | 243 } |
| 244 | 244 |
| 245 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { | 245 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { |
| 246 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), | 246 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), |
| 247 kFileNamePattern); | 247 kFileNamePattern); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace autofill | 250 } // namespace autofill |
| OLD | NEW |