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

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

Issue 22040002: [Autofill] Add a separate enumeration for HTML field type hints. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser test Created 7 years, 4 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 <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/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 std::string SerializeProfiles(const std::vector<AutofillProfile*>& profiles) { 60 std::string SerializeProfiles(const std::vector<AutofillProfile*>& profiles) {
61 std::string result; 61 std::string result;
62 for (size_t i = 0; i < profiles.size(); ++i) { 62 for (size_t i = 0; i < profiles.size(); ++i) {
63 result += kProfileSeparator; 63 result += kProfileSeparator;
64 result += "\n"; 64 result += "\n";
65 for (size_t j = 0; j < arraysize(kProfileFieldTypes); ++j) { 65 for (size_t j = 0; j < arraysize(kProfileFieldTypes); ++j) {
66 ServerFieldType type = kProfileFieldTypes[j]; 66 ServerFieldType type = kProfileFieldTypes[j];
67 std::vector<base::string16> values; 67 std::vector<base::string16> values;
68 profiles[i]->GetRawMultiInfo(type, &values); 68 profiles[i]->GetRawMultiInfo(type, &values);
69 for (size_t k = 0; k < values.size(); ++k) { 69 for (size_t k = 0; k < values.size(); ++k) {
70 result += AutofillType::FieldTypeToString(type); 70 result += AutofillType(type).ToString();
71 result += kFieldSeparator; 71 result += kFieldSeparator;
72 result += UTF16ToUTF8(values[k]); 72 result += UTF16ToUTF8(values[k]);
73 result += "\n"; 73 result += "\n";
74 } 74 }
75 } 75 }
76 } 76 }
77 77
78 return result; 78 return result;
79 } 79 }
80 80
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 *merged_profiles = SerializeProfiles(personal_data_.web_profiles()); 227 *merged_profiles = SerializeProfiles(personal_data_.web_profiles());
228 } 228 }
229 229
230 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { 230 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) {
231 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), 231 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName),
232 kFileNamePattern); 232 kFileNamePattern);
233 } 233 }
234 234
235 } // namespace autofill 235 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager_unittest.cc ('k') | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698