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

Unified Diff: components/autofill/core/browser/form_structure_unittest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/form_structure.cc ('k') | components/autofill/core/browser/name_field.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/form_structure_unittest.cc
diff --git a/components/autofill/core/browser/form_structure_unittest.cc b/components/autofill/core/browser/form_structure_unittest.cc
index d494fbe1735fe52c0b3d67955b12989ddaa65bbe..73343f822f8c13e71cd639c48c4f9c389a86a17b 100644
--- a/components/autofill/core/browser/form_structure_unittest.cc
+++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -1667,7 +1667,7 @@ TEST(FormStructureTest, EncodeQueryRequest) {
TEST(FormStructureTest, EncodeUploadRequest) {
scoped_ptr<FormStructure> form_structure;
- std::vector<FieldTypeSet> possible_field_types;
+ std::vector<ServerFieldTypeSet> possible_field_types;
FormData form;
form.method = ASCIIToUTF16("post");
form_structure.reset(new FormStructure(form, std::string()));
@@ -1679,34 +1679,34 @@ TEST(FormStructureTest, EncodeUploadRequest) {
field.label = ASCIIToUTF16("First Name");
field.name = ASCIIToUTF16("firstname");
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(NAME_FIRST);
field.label = ASCIIToUTF16("Last Name");
field.name = ASCIIToUTF16("lastname");
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(NAME_LAST);
field.label = ASCIIToUTF16("Email");
field.name = ASCIIToUTF16("email");
field.form_control_type = "email";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(EMAIL_ADDRESS);
field.label = ASCIIToUTF16("Phone");
field.name = ASCIIToUTF16("phone");
field.form_control_type = "number";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(PHONE_HOME_WHOLE_NUMBER);
field.label = ASCIIToUTF16("Country");
field.name = ASCIIToUTF16("country");
field.form_control_type = "select-one";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(ADDRESS_HOME_COUNTRY);
// Add checkable field.
@@ -1715,7 +1715,7 @@ TEST(FormStructureTest, EncodeUploadRequest) {
checkable_field.label = ASCIIToUTF16("Checkable1");
checkable_field.name = ASCIIToUTF16("Checkable1");
form.fields.push_back(checkable_field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(ADDRESS_HOME_COUNTRY);
form_structure.reset(new FormStructure(form, std::string()));
@@ -1724,7 +1724,7 @@ TEST(FormStructureTest, EncodeUploadRequest) {
for (size_t i = 0; i < form_structure->field_count(); ++i)
form_structure->field(i)->set_possible_types(possible_field_types[i]);
- FieldTypeSet available_field_types;
+ ServerFieldTypeSet available_field_types;
available_field_types.insert(NAME_FIRST);
available_field_types.insert(NAME_LAST);
available_field_types.insert(ADDRESS_HOME_LINE1);
@@ -1769,7 +1769,7 @@ TEST(FormStructureTest, EncodeUploadRequest) {
field.name = ASCIIToUTF16("address");
field.form_control_type = "text";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(ADDRESS_HOME_LINE1);
possible_field_types.back().insert(ADDRESS_HOME_LINE2);
possible_field_types.back().insert(ADDRESS_BILLING_LINE1);
@@ -1809,7 +1809,7 @@ TEST(FormStructureTest, EncodeUploadRequest) {
field.name = ASCIIToUTF16("address");
field.form_control_type = "text";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(ADDRESS_HOME_LINE1);
possible_field_types.back().insert(ADDRESS_HOME_LINE2);
possible_field_types.back().insert(ADDRESS_BILLING_LINE1);
@@ -1825,7 +1825,7 @@ TEST(FormStructureTest, EncodeUploadRequest) {
TEST(FormStructureTest, EncodeFieldAssignments) {
scoped_ptr<FormStructure> form_structure;
- std::vector<FieldTypeSet> possible_field_types;
+ std::vector<ServerFieldTypeSet> possible_field_types;
FormData form;
form.method = ASCIIToUTF16("post");
form_structure.reset(new FormStructure(form, std::string()));
@@ -1837,34 +1837,34 @@ TEST(FormStructureTest, EncodeFieldAssignments) {
field.label = ASCIIToUTF16("First Name");
field.name = ASCIIToUTF16("firstname");
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(NAME_FIRST);
field.label = ASCIIToUTF16("Last Name");
field.name = ASCIIToUTF16("lastname");
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(NAME_LAST);
field.label = ASCIIToUTF16("Email");
field.name = ASCIIToUTF16("email");
field.form_control_type = "email";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(EMAIL_ADDRESS);
field.label = ASCIIToUTF16("Phone");
field.name = ASCIIToUTF16("phone");
field.form_control_type = "number";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(PHONE_HOME_WHOLE_NUMBER);
field.label = ASCIIToUTF16("Country");
field.name = ASCIIToUTF16("country");
field.form_control_type = "select-one";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(ADDRESS_HOME_COUNTRY);
// Add checkable field.
@@ -1873,7 +1873,7 @@ TEST(FormStructureTest, EncodeFieldAssignments) {
checkable_field.label = ASCIIToUTF16("Checkable1");
checkable_field.name = ASCIIToUTF16("Checkable1");
form.fields.push_back(checkable_field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(ADDRESS_HOME_COUNTRY);
form_structure.reset(new FormStructure(form, std::string()));
@@ -1882,7 +1882,7 @@ TEST(FormStructureTest, EncodeFieldAssignments) {
for (size_t i = 0; i < form_structure->field_count(); ++i)
form_structure->field(i)->set_possible_types(possible_field_types[i]);
- FieldTypeSet available_field_types;
+ ServerFieldTypeSet available_field_types;
available_field_types.insert(NAME_FIRST);
available_field_types.insert(NAME_LAST);
available_field_types.insert(ADDRESS_HOME_LINE1);
@@ -1914,7 +1914,7 @@ TEST(FormStructureTest, EncodeFieldAssignments) {
field.name = ASCIIToUTF16("address");
field.form_control_type = "text";
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(ADDRESS_HOME_LINE1);
possible_field_types.back().insert(ADDRESS_HOME_LINE2);
possible_field_types.back().insert(ADDRESS_BILLING_LINE1);
@@ -1972,7 +1972,7 @@ TEST(FormStructureTest, CheckDataPresence) {
FormStructure form_structure(form, std::string());
- FieldTypeSet unknown_type;
+ ServerFieldTypeSet unknown_type;
unknown_type.insert(UNKNOWN_TYPE);
for (size_t i = 0; i < form_structure.field_count(); ++i)
form_structure.field(i)->set_possible_types(unknown_type);
@@ -1980,7 +1980,7 @@ TEST(FormStructureTest, CheckDataPresence) {
// No available types.
// datapresent should be "" == trimmmed(0x0000000000000000) ==
// 0b0000000000000000000000000000000000000000000000000000000000000000
- FieldTypeSet available_field_types;
+ ServerFieldTypeSet available_field_types;
std::string encoded_xml;
EXPECT_TRUE(form_structure.EncodeUploadRequest(available_field_types, false,
@@ -2193,7 +2193,7 @@ TEST(FormStructureTest, CheckMultipleTypes) {
// 33 == ADDRESS_HOME_CITY
// 34 == ADDRESS_HOME_STATE
// 60 == COMPANY_NAME
- FieldTypeSet available_field_types;
+ ServerFieldTypeSet available_field_types;
available_field_types.insert(NAME_FIRST);
available_field_types.insert(NAME_LAST);
available_field_types.insert(EMAIL_ADDRESS);
@@ -2205,7 +2205,7 @@ TEST(FormStructureTest, CheckMultipleTypes) {
// Check that multiple types for the field are processed correctly.
scoped_ptr<FormStructure> form_structure;
- std::vector<FieldTypeSet> possible_field_types;
+ std::vector<ServerFieldTypeSet> possible_field_types;
FormData form;
form.method = ASCIIToUTF16("post");
@@ -2215,25 +2215,25 @@ TEST(FormStructureTest, CheckMultipleTypes) {
field.label = ASCIIToUTF16("email");
field.name = ASCIIToUTF16("email");
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(EMAIL_ADDRESS);
field.label = ASCIIToUTF16("First Name");
field.name = ASCIIToUTF16("first");
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(NAME_FIRST);
field.label = ASCIIToUTF16("Last Name");
field.name = ASCIIToUTF16("last");
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(NAME_LAST);
field.label = ASCIIToUTF16("Address");
field.name = ASCIIToUTF16("address");
form.fields.push_back(field);
- possible_field_types.push_back(FieldTypeSet());
+ possible_field_types.push_back(ServerFieldTypeSet());
possible_field_types.back().insert(ADDRESS_HOME_LINE1);
form_structure.reset(new FormStructure(form, std::string()));
« no previous file with comments | « components/autofill/core/browser/form_structure.cc ('k') | components/autofill/core/browser/name_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698