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

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

Issue 22009003: [Autofill] Distinguish between native field types and potentially HTML field types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 "components/autofill/core/browser/autofill_common_test.h" 5 #include "components/autofill/core/browser/autofill_common_test.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/autofill/core/browser/autofill_profile.h" 10 #include "components/autofill/core/browser/autofill_profile.h"
11 #include "components/autofill/core/browser/credit_card.h" 11 #include "components/autofill/core/browser/credit_card.h"
12 #include "components/autofill/core/browser/field_types.h"
12 #include "components/autofill/core/common/autofill_pref_names.h" 13 #include "components/autofill/core/common/autofill_pref_names.h"
13 #include "components/autofill/core/common/form_data.h" 14 #include "components/autofill/core/common/form_data.h"
14 #include "components/autofill/core/common/form_field_data.h" 15 #include "components/autofill/core/common/form_field_data.h"
15 #include "components/user_prefs/user_prefs.h" 16 #include "components/user_prefs/user_prefs.h"
16 #include "components/webdata/encryptor/encryptor.h" 17 #include "components/webdata/encryptor/encryptor.h"
17 #include "content/public/browser/browser_context.h" 18 #include "content/public/browser/browser_context.h"
18 19
19 namespace autofill { 20 namespace autofill {
20 namespace test { 21 namespace test {
21 22
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 form->fields.push_back(field); 63 form->fields.push_back(field);
63 test::CreateTestFormField("Country", "country", "", "text", &field); 64 test::CreateTestFormField("Country", "country", "", "text", &field);
64 form->fields.push_back(field); 65 form->fields.push_back(field);
65 test::CreateTestFormField("Phone Number", "phonenumber", "", "tel", &field); 66 test::CreateTestFormField("Phone Number", "phonenumber", "", "tel", &field);
66 form->fields.push_back(field); 67 form->fields.push_back(field);
67 test::CreateTestFormField("Email", "email", "", "email", &field); 68 test::CreateTestFormField("Email", "email", "", "email", &field);
68 form->fields.push_back(field); 69 form->fields.push_back(field);
69 } 70 }
70 71
71 inline void check_and_set( 72 inline void check_and_set(
72 FormGroup* profile, AutofillFieldType type, const char* value) { 73 FormGroup* profile, ServerFieldType type, const char* value) {
73 if (value) 74 if (value)
74 profile->SetRawInfo(type, UTF8ToUTF16(value)); 75 profile->SetRawInfo(type, UTF8ToUTF16(value));
75 } 76 }
76 77
77 AutofillProfile GetFullProfile() { 78 AutofillProfile GetFullProfile() {
78 AutofillProfile profile(base::GenerateGUID(), "http://www.example.com/"); 79 AutofillProfile profile(base::GenerateGUID(), "http://www.example.com/");
79 SetProfileInfo(&profile, 80 SetProfileInfo(&profile,
80 "John", 81 "John",
81 "H.", 82 "H.",
82 "Doe", 83 "Doe",
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // Disable auxiliary profiles for unit testing. These reach out to system 185 // Disable auxiliary profiles for unit testing. These reach out to system
185 // services on the Mac. 186 // services on the Mac.
186 if (browser_context) { 187 if (browser_context) {
187 user_prefs::UserPrefs::Get(browser_context)->SetBoolean( 188 user_prefs::UserPrefs::Get(browser_context)->SetBoolean(
188 prefs::kAutofillAuxiliaryProfilesEnabled, false); 189 prefs::kAutofillAuxiliaryProfilesEnabled, false);
189 } 190 }
190 } 191 }
191 192
192 } // namespace test 193 } // namespace test
193 } // namespace autofill 194 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698