| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 178 } | 178 } | 
| 179 | 179 | 
| 180 void AutofillMergeTest::MergeProfiles(const std::string& profiles, | 180 void AutofillMergeTest::MergeProfiles(const std::string& profiles, | 
| 181                                       std::string* merged_profiles) { | 181                                       std::string* merged_profiles) { | 
| 182   // Start with no saved profiles. | 182   // Start with no saved profiles. | 
| 183   personal_data_.Reset(); | 183   personal_data_.Reset(); | 
| 184 | 184 | 
| 185   // Create a test form. | 185   // Create a test form. | 
| 186   FormData form; | 186   FormData form; | 
| 187   form.name = base::ASCIIToUTF16("MyTestForm"); | 187   form.name = base::ASCIIToUTF16("MyTestForm"); | 
| 188   form.method = base::ASCIIToUTF16("POST"); |  | 
| 189   form.origin = GURL("https://www.example.com/origin.html"); | 188   form.origin = GURL("https://www.example.com/origin.html"); | 
| 190   form.action = GURL("https://www.example.com/action.html"); | 189   form.action = GURL("https://www.example.com/action.html"); | 
| 191   form.user_submitted = true; | 190   form.user_submitted = true; | 
| 192 | 191 | 
| 193   // Parse the input line by line. | 192   // Parse the input line by line. | 
| 194   std::vector<std::string> lines; | 193   std::vector<std::string> lines; | 
| 195   Tokenize(profiles, "\n", &lines); | 194   Tokenize(profiles, "\n", &lines); | 
| 196   for (size_t i = 0; i < lines.size(); ++i) { | 195   for (size_t i = 0; i < lines.size(); ++i) { | 
| 197     std::string line = lines[i]; | 196     std::string line = lines[i]; | 
| 198 | 197 | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 244 ServerFieldType AutofillMergeTest::StringToFieldType(const std::string& str) { | 243 ServerFieldType AutofillMergeTest::StringToFieldType(const std::string& str) { | 
| 245   return string_to_field_type_map_[str]; | 244   return string_to_field_type_map_[str]; | 
| 246 } | 245 } | 
| 247 | 246 | 
| 248 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { | 247 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { | 
| 249   RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), | 248   RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), | 
| 250                     kFileNamePattern); | 249                     kFileNamePattern); | 
| 251 } | 250 } | 
| 252 | 251 | 
| 253 }  // namespace autofill | 252 }  // namespace autofill | 
| OLD | NEW | 
|---|