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

Unified Diff: chrome/browser/autofill/autofill_manager_unittest.cc

Issue 11198048: [Autofill] Update the autocomplete types implementation to match the current HTML spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/autofill/form_structure.h » ('j') | chrome/browser/autofill/form_structure.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_manager_unittest.cc
diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc
index 284bf9bef4ae1097c6b587c13b116ff690ff8c6f..7eaede1fc2e7a4fe483807bd1cf3e14a727266b7 100644
--- a/chrome/browser/autofill/autofill_manager_unittest.cc
+++ b/chrome/browser/autofill/autofill_manager_unittest.cc
@@ -1993,47 +1993,47 @@ TEST_F(AutofillManagerTest, FillFormWithAuthorSpecifiedSections) {
FormFieldData field;
autofill_test::CreateTestFormField("", "country", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("section-billing country");
+ field.autocomplete_attribute = ASCIIToUTF16("section-billing country");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "firstname", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("given-name");
+ field.autocomplete_attribute = ASCIIToUTF16("given-name");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "lastname", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("surname");
+ field.autocomplete_attribute = ASCIIToUTF16("family-name");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "address", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("section-billing street-address");
+ field.autocomplete_attribute = ASCIIToUTF16("section-billing street-address");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "city", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("section-billing locality");
+ field.autocomplete_attribute = ASCIIToUTF16("section-billing locality");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "state", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("section-billing administrative-area");
+ field.autocomplete_attribute = ASCIIToUTF16("section-billing region");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "zip", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("section-billing postal-code");
+ field.autocomplete_attribute = ASCIIToUTF16("section-billing postal-code");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "ccname", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("section-billing cc-full-name");
+ field.autocomplete_attribute = ASCIIToUTF16("section-billing cc-name");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "ccnumber", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("section-billing cc-number");
+ field.autocomplete_attribute = ASCIIToUTF16("section-billing cc-number");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "ccexp", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("section-billing cc-exp");
+ field.autocomplete_attribute = ASCIIToUTF16("section-billing cc-exp");
form.fields.push_back(field);
autofill_test::CreateTestFormField("", "email", "", "text", &field);
- field.autocomplete_type = ASCIIToUTF16("email");
+ field.autocomplete_attribute = ASCIIToUTF16("email");
form.fields.push_back(field);
std::vector<FormData> forms(1, form);
@@ -2300,13 +2300,13 @@ TEST_F(AutofillManagerTest, FillPhoneNumber) {
const char* label;
const char* name;
size_t max_length;
- const char* autocomplete_type;
+ const char* autocomplete_attribute;
} test_fields[] = {
- { "country code", "country_code", 1, "phone-country-code" },
- { "area code", "area_code", 3, "phone-area-code" },
- { "phone", "phone_prefix", 3, "phone-local-prefix" },
- { "-", "phone_suffix", 4, "phone-local-suffix" },
- { "Phone Extension", "ext", 3, "phone-extension" }
+ { "country code", "country_code", 1, "tel-country-code" },
+ { "area code", "area_code", 3, "tel-area-code" },
+ { "phone", "phone_prefix", 3, "tel-local-prefix" },
+ { "-", "phone_suffix", 4, "tel-local-suffix" },
+ { "Phone Extension", "ext", 3, "tel-extension" }
};
FormFieldData field;
@@ -2315,11 +2315,12 @@ TEST_F(AutofillManagerTest, FillPhoneNumber) {
autofill_test::CreateTestFormField(
test_fields[i].label, test_fields[i].name, "", "text", &field);
field.max_length = test_fields[i].max_length;
- field.autocomplete_type = string16();
+ field.autocomplete_attribute = string16();
form_with_maxlength.fields.push_back(field);
field.max_length = default_max_length;
- field.autocomplete_type = ASCIIToUTF16(test_fields[i].autocomplete_type);
+ field.autocomplete_attribute =
+ ASCIIToUTF16(test_fields[i].autocomplete_attribute);
form_with_autocompletetype.fields.push_back(field);
}
« no previous file with comments | « no previous file | chrome/browser/autofill/form_structure.h » ('j') | chrome/browser/autofill/form_structure.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698