summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-23 08:39:16 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-23 08:39:16 +0000
commit4b7f9dd51d6a8ab2884f0d6838638d33a0764219 (patch)
tree2690fe2f1b9e344d62910ac742c1d55ffa51f934
parenta1c9372440b133795cafceed295579f3b2e99e96 (diff)
downloadchromium_src-4b7f9dd51d6a8ab2884f0d6838638d33a0764219.zip
chromium_src-4b7f9dd51d6a8ab2884f0d6838638d33a0764219.tar.gz
chromium_src-4b7f9dd51d6a8ab2884f0d6838638d33a0764219.tar.bz2
Revert 72292 - Propagate correct data to the Toolbar servers
BUG=67219 TEST=unit-tested Review URL: http://codereview.chromium.org/6213002 TBR=georgey@chromium.org Review URL: http://codereview.chromium.org/6259016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72293 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autofill/form_structure.cc79
-rw-r--r--chrome/browser/autofill/form_structure.h7
-rw-r--r--chrome/browser/autofill/form_structure_unittest.cc246
3 files changed, 47 insertions, 285 deletions
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc
index 92e53d1..78431f2 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -113,30 +113,31 @@ bool FormStructure::EncodeUploadRequest(bool auto_fill_used,
if (!auto_fillable)
return false;
- buzz::XmlElement autofill_request_xml(buzz::QName("autofillupload"));
+ buzz::XmlElement autofil_request_xml(buzz::QName("autofillupload"));
// Attributes for the <autofillupload> element.
//
// TODO(jhawkins): Work with toolbar devs to make a spec for autofill clients.
// For now these values are hacked from the toolbar code.
- autofill_request_xml.SetAttr(buzz::QName(kAttributeClientVersion),
- "6.1.1715.1442/en (GGLL)");
+ autofil_request_xml.SetAttr(buzz::QName(kAttributeClientVersion),
+ "6.1.1715.1442/en (GGLL)");
- autofill_request_xml.SetAttr(buzz::QName(kAttributeFormSignature),
- FormSignature());
+ autofil_request_xml.SetAttr(buzz::QName(kAttributeFormSignature),
+ FormSignature());
- autofill_request_xml.SetAttr(buzz::QName(kAttributeAutoFillUsed),
- auto_fill_used ? "true" : "false");
+ autofil_request_xml.SetAttr(buzz::QName(kAttributeAutoFillUsed),
+ auto_fill_used ? "true" : "false");
- autofill_request_xml.SetAttr(buzz::QName(kAttributeDataPresent),
- ConvertPresenceBitsToString().c_str());
+ // TODO(jhawkins): Hook this up to the personal data manager.
+ // personaldata_manager_->GetDataPresent();
+ autofil_request_xml.SetAttr(buzz::QName(kAttributeDataPresent), "");
- if (!EncodeFormRequest(FormStructure::UPLOAD, &autofill_request_xml))
+ if (!EncodeFormRequest(FormStructure::UPLOAD, &autofil_request_xml))
return false; // Malformed form, skip it.
// Obtain the XML structure as a string.
*encoded_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
- *encoded_xml += autofill_request_xml.Str().c_str();
+ *encoded_xml += autofil_request_xml.Str().c_str();
return true;
}
@@ -150,13 +151,13 @@ bool FormStructure::EncodeQueryRequest(const ScopedVector<FormStructure>& forms,
encoded_xml->clear();
encoded_signatures->clear();
encoded_signatures->reserve(forms.size());
- buzz::XmlElement autofill_request_xml(buzz::QName("autofillquery"));
+ buzz::XmlElement autofil_request_xml(buzz::QName("autofillquery"));
// Attributes for the <autofillquery> element.
//
// TODO(jhawkins): Work with toolbar devs to make a spec for autofill clients.
// For now these values are hacked from the toolbar code.
- autofill_request_xml.SetAttr(buzz::QName(kAttributeClientVersion),
- "6.1.1715.1442/en (GGLL)");
+ autofil_request_xml.SetAttr(buzz::QName(kAttributeClientVersion),
+ "6.1.1715.1442/en (GGLL)");
// Some badly formatted web sites repeat forms - detect that and encode only
// one form as returned data would be the same for all the repeated forms.
std::set<std::string> processed_forms;
@@ -176,7 +177,7 @@ bool FormStructure::EncodeQueryRequest(const ScopedVector<FormStructure>& forms,
encompassing_xml_element.get()))
continue; // Malformed form, skip it.
- autofill_request_xml.AddElement(encompassing_xml_element.release());
+ autofil_request_xml.AddElement(encompassing_xml_element.release());
encoded_signatures->push_back(signature);
}
@@ -185,7 +186,7 @@ bool FormStructure::EncodeQueryRequest(const ScopedVector<FormStructure>& forms,
// Obtain the XML structure as a string.
*encoded_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
- *encoded_xml += autofill_request_xml.Str().c_str();
+ *encoded_xml += autofil_request_xml.Str().c_str();
return true;
}
@@ -412,16 +413,15 @@ bool FormStructure::EncodeFormRequest(
const AutoFillField* field = fields_[index];
if (request_type == FormStructure::UPLOAD) {
FieldTypeSet types = field->possible_types();
- DCHECK(!types.empty());
- for (FieldTypeSet::iterator field_type = types.begin();
- field_type != types.end(); ++field_type) {
+ for (FieldTypeSet::const_iterator type = types.begin();
+ type != types.end(); type++) {
buzz::XmlElement *field_element = new buzz::XmlElement(
buzz::QName(kXMLElementField));
field_element->SetAttr(buzz::QName(kAttributeSignature),
field->FieldSignature());
field_element->SetAttr(buzz::QName(kAttributeAutoFillType),
- base::IntToString(*field_type));
+ base::IntToString(*type));
encompassing_xml_element->AddElement(field_element);
}
} else {
@@ -434,42 +434,3 @@ bool FormStructure::EncodeFormRequest(
}
return true;
}
-
-std::string FormStructure::ConvertPresenceBitsToString() const {
- std::vector<uint8> presence_bitfield;
- // Determine all of the field types that were autofilled. Pack bits into
- // |presence_bitfield|. The necessary size for |presence_bitfield| is
- // ceil((MAX_VALID_FIELD_TYPE + 7) / 8) bytes (uint8).
- presence_bitfield.resize((MAX_VALID_FIELD_TYPE + 0x7) / 8);
- for (size_t i = 0; i < presence_bitfield.size(); ++i)
- presence_bitfield[i] = 0;
-
- for (size_t i = 0; i < field_count(); ++i) {
- const AutoFillField* field = fields_[i];
- FieldTypeSet types = field->possible_types();
- DCHECK(!types.empty());
- for (FieldTypeSet::iterator field_type = types.begin();
- field_type != types.end(); ++field_type) {
- DCHECK(presence_bitfield.size() > (static_cast<size_t>(*field_type) / 8));
- // Set bit in the bitfield: byte |field_type| / 8, bit in byte
- // |field_type| % 8 from the left.
- presence_bitfield[*field_type / 8] |= (0x80 >> (*field_type % 8));
- }
- }
-
- std::string data_presence;
- data_presence.reserve(presence_bitfield.size() * 2 + 1);
-
- // Skip trailing zeroes. If all mask is 0 - return empty string.
- size_t data_end = presence_bitfield.size();
- for (; data_end > 0 && !presence_bitfield[data_end - 1]; --data_end) {
- }
-
- // Print all meaningfull bytes into the string.
- for (size_t i = 0; i < data_end; ++i) {
- base::StringAppendF(&data_presence, "%02x", presence_bitfield[i]);
- }
-
- return data_presence;
-}
-
diff --git a/chrome/browser/autofill/form_structure.h b/chrome/browser/autofill/form_structure.h
index fb92826..1c5e7af 100644
--- a/chrome/browser/autofill/form_structure.h
+++ b/chrome/browser/autofill/form_structure.h
@@ -41,7 +41,8 @@ class FormStructure {
virtual ~FormStructure();
// Encodes the XML upload request from this FormStructure.
- bool EncodeUploadRequest(bool auto_fill_used, std::string* encoded_xml) const;
+ bool EncodeUploadRequest(bool auto_fill_used,
+ std::string* encoded_xml) const;
// Encodes the XML query request for the set of forms.
// All fields are returned in one XML. For example, there are three forms,
@@ -127,10 +128,6 @@ class FormStructure {
bool EncodeFormRequest(EncodeRequestType request_type,
buzz::XmlElement* encompassing_xml_element) const;
- // Helper for EncodeUploadRequest() that collects presense of all data in the
- // form structure and converts it to string for uploading.
- std::string ConvertPresenceBitsToString() const;
-
// The name of the form.
string16 form_name_;
diff --git a/chrome/browser/autofill/form_structure_unittest.cc b/chrome/browser/autofill/form_structure_unittest.cc
index 630981d..aba0bcf 100644
--- a/chrome/browser/autofill/form_structure_unittest.cc
+++ b/chrome/browser/autofill/form_structure_unittest.cc
@@ -1675,8 +1675,8 @@ TEST(FormStructureTest, EncodeUploadRequest) {
EXPECT_EQ(encoded_xml,
"<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
"clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "8269229441054798720\" autofillused=\"false\" datapresent=\"1442008208\">"
- "<field signature=\"3763331450\" autofilltype=\"3\"/><field signature=\""
+ "8269229441054798720\" autofillused=\"false\" datapresent=\"\"><field "
+ "signature=\"3763331450\" autofilltype=\"3\"/><field signature=\""
"3494530716\" autofilltype=\"5\"/><field signature=\"1029417091\" "
"autofilltype=\"9\"/><field signature=\"466116101\" autofilltype="
"\"14\"/><field signature=\"2799270304\" autofilltype=\"36\"/><field "
@@ -1686,15 +1686,15 @@ TEST(FormStructureTest, EncodeUploadRequest) {
EXPECT_EQ(encoded_xml,
"<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
"clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "8269229441054798720\" autofillused=\"true\" datapresent=\"1442008208\">"
- "<field signature=\"3763331450\" autofilltype=\"3\"/><field signature=\""
+ "8269229441054798720\" autofillused=\"true\" datapresent=\"\"><field "
+ "signature=\"3763331450\" autofilltype=\"3\"/><field signature=\""
"3494530716\" autofilltype=\"5\"/><field signature=\"1029417091\" "
"autofilltype=\"9\"/><field signature=\"466116101\" autofilltype="
"\"14\"/><field signature=\"2799270304\" autofilltype=\"36\"/><field "
"signature=\"1876771436\" autofilltype=\"24\"/><field signature="
"\"263446779\" autofilltype=\"30\"/></autofillupload>");
- // Add 4 address fields - this should be still a valid form.
- for (size_t i = 0; i < 2; ++i) {
+ // Add 5 address fields - this should be still a valid form.
+ for (size_t i = 0; i < 5; ++i) {
form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("Address"),
ASCIIToUTF16("address"),
string16(),
@@ -1715,22 +1715,29 @@ TEST(FormStructureTest, EncodeUploadRequest) {
EXPECT_EQ(encoded_xml,
"<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
"clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "9124126510289951497\" autofillused=\"false\" datapresent=\"144200830e\">"
- "<field signature=\"3763331450\" autofilltype=\"3\"/><field signature=\""
+ "2027360543766157144\" autofillused=\"false\" datapresent=\"\"><field "
+ "signature=\"3763331450\" autofilltype=\"3\"/><field signature=\""
"3494530716\" autofilltype=\"5\"/><field signature=\"1029417091\" "
"autofilltype=\"9\"/><field signature=\"466116101\" autofilltype=\"14\"/>"
"<field signature=\"2799270304\" autofilltype=\"36\"/><field signature=\""
"1876771436\" autofilltype=\"24\"/><field signature=\"263446779\" "
- "autofilltype=\"30\"/>"
- "<field signature=\"509334676\" autofilltype=\"30\"/>"
- "<field signature=\"509334676\" autofilltype=\"31\"/>"
- "<field signature=\"509334676\" autofilltype=\"37\"/>"
- "<field signature=\"509334676\" autofilltype=\"38\"/>"
- "<field signature=\"509334676\" autofilltype=\"30\"/>"
- "<field signature=\"509334676\" autofilltype=\"31\"/>"
- "<field signature=\"509334676\" autofilltype=\"37\"/>"
- "<field signature=\"509334676\" autofilltype=\"38\"/>"
- "</autofillupload>");
+ "autofilltype=\"30\"/><field signature=\"509334676\" autofilltype="
+ "\"30\"/><field signature=\"509334676\" autofilltype=\"31\"/><field "
+ "signature=\"509334676\" autofilltype=\"37\"/><field signature="
+ "\"509334676\" autofilltype=\"38\"/><field signature=\"509334676\" "
+ "autofilltype=\"30\"/><field signature=\"509334676\" autofilltype="
+ "\"31\"/><field signature=\"509334676\" autofilltype=\"37\"/><field "
+ "signature=\"509334676\" autofilltype=\"38\"/><field signature=\""
+ "509334676\" autofilltype=\"30\"/><field signature=\"509334676\" "
+ "autofilltype=\"31\"/><field signature=\"509334676\" "
+ "autofilltype=\"37\"/><field signature=\"509334676\" autofilltype="
+ "\"38\"/><field signature=\"509334676\" autofilltype=\"30\"/><field "
+ "signature=\"509334676\" autofilltype=\"31\"/><field signature="
+ "\"509334676\" autofilltype=\"37\"/><field signature=\"509334676\" "
+ "autofilltype=\"38\"/><field signature=\"509334676\" autofilltype="
+ "\"30\"/><field signature=\"509334676\" autofilltype=\"31\"/><field "
+ "signature=\"509334676\" autofilltype=\"37\"/><field signature="
+ "\"509334676\" autofilltype=\"38\"/></autofillupload>");
// Add 50 address fields - now the form is invalid.
for (size_t i = 0; i < 50; ++i) {
form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("Address"),
@@ -1753,207 +1760,4 @@ TEST(FormStructureTest, EncodeUploadRequest) {
EXPECT_EQ(encoded_xml, "");
}
-TEST(FormStructureTest, CheckDataPresence) {
- // Checks bits set in the datapresence field: for each type in the form
- // relevant bit in datapresence has to be set.
- scoped_ptr<FormStructure> form_structure;
- std::vector<FieldTypeSet> possible_field_types;
- FormData form;
- form.method = ASCIIToUTF16("post");
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("First Name"),
- ASCIIToUTF16("first"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(NAME_FIRST);
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("Last Name"),
- ASCIIToUTF16("last"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(NAME_LAST);
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("email"),
- ASCIIToUTF16("email"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(EMAIL_ADDRESS);
- form_structure.reset(new FormStructure(form));
- for (size_t i = 0; i < form_structure->field_count(); ++i)
- form_structure->set_possible_types(i, possible_field_types[i]);
- std::string encoded_xml;
- EXPECT_TRUE(form_structure->EncodeUploadRequest(false, &encoded_xml));
- EXPECT_EQ("<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
- "clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "6402244543831589061\" autofillused=\"false\" "
- "datapresent=\"1440\"><field signature=\"1089846351\" ",
- encoded_xml.substr(0, 200));
-
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("Address"),
- ASCIIToUTF16("address"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(ADDRESS_HOME_LINE1);
- form_structure.reset(new FormStructure(form));
- for (size_t i = 0; i < form_structure->field_count(); ++i)
- form_structure->set_possible_types(i, possible_field_types[i]);
- EXPECT_TRUE(form_structure->EncodeUploadRequest(false, &encoded_xml));
- EXPECT_EQ("<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
- "clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "11817937699000629499\" autofillused=\"false\" "
- "datapresent=\"14400002\"><field signature=\"1089846",
- encoded_xml.substr(0, 200));
-
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("F4"),
- ASCIIToUTF16("f4"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(CREDIT_CARD_TYPE);
- form_structure.reset(new FormStructure(form));
- for (size_t i = 0; i < form_structure->field_count(); ++i)
- form_structure->set_possible_types(i, possible_field_types[i]);
- EXPECT_TRUE(form_structure->EncodeUploadRequest(false, &encoded_xml));
- EXPECT_EQ("<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
- "clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "15126663683491865216\" autofillused=\"false\" "
- "datapresent=\"1440000200000020\"><field signature=",
- encoded_xml.substr(0, 200));
-}
-
-TEST(FormStructureTest, CheckMultipleTypes) {
- // Check that multiple types for the field are processed correctly, both in
- // datapresence and in actual field data.
- scoped_ptr<FormStructure> form_structure;
- std::vector<FieldTypeSet> possible_field_types;
- FormData form;
- form.method = ASCIIToUTF16("post");
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("email"),
- ASCIIToUTF16("email"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(EMAIL_ADDRESS);
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("First Name"),
- ASCIIToUTF16("first"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(NAME_FIRST);
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("Last Name"),
- ASCIIToUTF16("last"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(NAME_LAST);
- form.fields.push_back(webkit_glue::FormField(ASCIIToUTF16("Address"),
- ASCIIToUTF16("address"),
- string16(),
- ASCIIToUTF16("text"),
- 0,
- false));
- possible_field_types.push_back(FieldTypeSet());
- possible_field_types.back().insert(ADDRESS_HOME_LINE1);
- form_structure.reset(new FormStructure(form));
- for (size_t i = 0; i < form_structure->field_count(); ++i)
- form_structure->set_possible_types(i, possible_field_types[i]);
- std::string encoded_xml;
- // Now we matched both fields singularly.
- EXPECT_TRUE(form_structure->EncodeUploadRequest(false, &encoded_xml));
- // datapresent==14400002==00010100010000000000000000000010b set bits are:
- // #3 == NAME_FIRST
- // #5 == NAME_LAST
- // #9 == EMAIL_ADDRESS
- // #30 == ADDRESS_HOME_LINE1
- EXPECT_EQ("<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
- "clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "18062476096658145866\" autofillused=\"false\" datapresent="
- "\"14400002\"><field signature=\"420638584\" autofilltype="
- "\"9\"/><field signature=\"1089846351\" autofilltype=\"3\"/><field "
- "signature=\"2404144663\" autofilltype=\"5\"/><field signature="
- "\"509334676\" autofilltype=\"30\"/></autofillupload>",
- encoded_xml);
- // Match third field as both first and last.
- possible_field_types[2].insert(NAME_FIRST);
- form_structure->set_possible_types(2, possible_field_types[2]);
- EXPECT_TRUE(form_structure->EncodeUploadRequest(false, &encoded_xml));
- // datapresent==14400002==00010100010000000000000000000010b set bits are:
- // #3 == NAME_FIRST
- // #5 == NAME_LAST
- // #9 == EMAIL_ADDRESS
- // #30 == ADDRESS_HOME_LINE1
- EXPECT_EQ("<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
- "clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "18062476096658145866\" autofillused=\"false\" datapresent="
- "\"14400002\"><field signature=\"420638584\" autofilltype="
- "\"9\"/><field signature=\"1089846351\" autofilltype=\"3\"/><field "
- "signature=\"2404144663\" autofilltype=\"3\"/><field "
- "signature=\"2404144663\" autofilltype=\"5\"/><field signature="
- "\"509334676\" autofilltype=\"30\"/></autofillupload>",
- encoded_xml);
- possible_field_types[3].insert(ADDRESS_BILLING_LINE1);
- form_structure->set_possible_types(
- form_structure->field_count() - 1,
- possible_field_types[form_structure->field_count() - 1]);
- EXPECT_TRUE(form_structure->EncodeUploadRequest(false, &encoded_xml));
- // datapresent==1440000204==0001010001000000000000000000001000000100b set bits
- // are:
- // #3 == NAME_FIRST
- // #5 == NAME_LAST
- // #9 == EMAIL_ADDRESS
- // #30 == ADDRESS_HOME_LINE1
- // #37 == ADDRESS_BILLING_LINE1
- EXPECT_EQ("<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
- "clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "18062476096658145866\" autofillused=\"false\" datapresent="
- "\"1440000204\"><field signature=\"420638584\" autofilltype="
- "\"9\"/><field signature=\"1089846351\" autofilltype=\"3\"/><field "
- "signature=\"2404144663\" autofilltype=\"3\"/><field "
- "signature=\"2404144663\" autofilltype=\"5\"/><field signature="
- "\"509334676\" autofilltype=\"30\"/><field signature=\"509334676\" "
- "autofilltype=\"37\"/></autofillupload>",
- encoded_xml);
- possible_field_types[3].clear();
- possible_field_types[3].insert(ADDRESS_HOME_LINE1);
- possible_field_types[3].insert(ADDRESS_BILLING_LINE2);
- form_structure->set_possible_types(
- form_structure->field_count() - 1,
- possible_field_types[form_structure->field_count() - 1]);
- EXPECT_TRUE(form_structure->EncodeUploadRequest(false, &encoded_xml));
- // datapresent==1440000202==0001010001000000000000000000001000000010b set bits
- // are:
- // #3 == NAME_FIRST
- // #5 == NAME_LAST
- // #9 == EMAIL_ADDRESS
- // #30 == ADDRESS_HOME_LINE1
- // #38 == ADDRESS_BILLING_LINE2
- EXPECT_EQ("<\?xml version=\"1.0\" encoding=\"UTF-8\"\?><autofillupload "
- "clientversion=\"6.1.1715.1442/en (GGLL)\" formsignature=\""
- "18062476096658145866\" autofillused=\"false\" datapresent="
- "\"1440000202\"><field signature=\"420638584\" autofilltype="
- "\"9\"/><field signature=\"1089846351\" autofilltype=\"3\"/><field "
- "signature=\"2404144663\" autofilltype=\"3\"/><field "
- "signature=\"2404144663\" autofilltype=\"5\"/><field signature="
- "\"509334676\" autofilltype=\"30\"/><field signature=\"509334676\" "
- "autofilltype=\"38\"/></autofillupload>",
- encoded_xml);
-}
-
} // namespace