Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: components/autofill/core/browser/autofill_merge_unittest.cc

Issue 23033016: Remove autocheckout code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Even more deletes, and Ilya review. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 field.name = field_type; 206 field.name = field_type;
207 field.value = value; 207 field.value = value;
208 field.form_control_type = "text"; 208 field.form_control_type = "text";
209 form.fields.push_back(field); 209 form.fields.push_back(field);
210 } 210 }
211 211
212 // The first line is always a profile separator, and the last profile is not 212 // The first line is always a profile separator, and the last profile is not
213 // followed by an explicit separator. 213 // followed by an explicit separator.
214 if ((i > 0 && line == kProfileSeparator) || i == lines.size() - 1) { 214 if ((i > 0 && line == kProfileSeparator) || i == lines.size() - 1) {
215 // Reached the end of a profile. Try to import it. 215 // Reached the end of a profile. Try to import it.
216 FormStructure form_structure(form, std::string()); 216 FormStructure form_structure(form);
217 for (size_t i = 0; i < form_structure.field_count(); ++i) { 217 for (size_t i = 0; i < form_structure.field_count(); ++i) {
218 // Set the heuristic type for each field, which is currently serialized 218 // Set the heuristic type for each field, which is currently serialized
219 // into the field's name. 219 // into the field's name.
220 AutofillField* field = 220 AutofillField* field =
221 const_cast<AutofillField*>(form_structure.field(i)); 221 const_cast<AutofillField*>(form_structure.field(i));
222 ServerFieldType type = StringToFieldType(UTF16ToUTF8(field->name)); 222 ServerFieldType type = StringToFieldType(UTF16ToUTF8(field->name));
223 field->set_heuristic_type(type); 223 field->set_heuristic_type(type);
224 } 224 }
225 225
226 // Import the profile. 226 // Import the profile.
(...skipping 12 matching lines...) Expand all
239 ServerFieldType AutofillMergeTest::StringToFieldType(const std::string& str) { 239 ServerFieldType AutofillMergeTest::StringToFieldType(const std::string& str) {
240 return string_to_field_type_map_[str]; 240 return string_to_field_type_map_[str];
241 } 241 }
242 242
243 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { 243 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) {
244 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), 244 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName),
245 kFileNamePattern); 245 kFileNamePattern);
246 } 246 }
247 247
248 } // namespace autofill 248 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698