Index: chrome/browser/autofill/form_structure_unittest.cc |
diff --git a/chrome/browser/autofill/form_structure_unittest.cc b/chrome/browser/autofill/form_structure_unittest.cc |
index e0c77fe0ab2211367a5f6afee3de511f422de8f0..51d40465b75e8ba7782a57a0683b3cdd23ed72b6 100644 |
--- a/chrome/browser/autofill/form_structure_unittest.cc |
+++ b/chrome/browser/autofill/form_structure_unittest.cc |
@@ -2063,3 +2063,31 @@ TEST(FormStructureTest, CheckFormSignature) { |
std::string("https://login.facebook.com&login_form&email&first")), |
form_structure->FormSignature()); |
} |
+ |
+TEST(FormStructureTest, ToFormData) { |
+ FormData form; |
+ form.name = ASCIIToUTF16("the-name"); |
+ form.method = ASCIIToUTF16("POST"); |
+ form.origin = GURL("http://cool.com"); |
+ form.action = form.origin.Resolve("/login"); |
+ |
+ FormFieldData field; |
+ field.label = ASCIIToUTF16("username"); |
+ field.name = ASCIIToUTF16("username"); |
+ field.form_control_type = "text"; |
+ form.fields.push_back(field); |
+ |
+ field.label = ASCIIToUTF16("password"); |
+ field.name = ASCIIToUTF16("password"); |
+ field.form_control_type = "password"; |
+ form.fields.push_back(field); |
+ |
+ field.label = string16(); |
+ field.name = ASCIIToUTF16("Submit"); |
+ field.form_control_type = "submit"; |
+ form.fields.push_back(field); |
+ |
+ //LOG(ERROR) << "form: " << form; |
+ //LOG(ERROR) << "ToFormData(): " << FormStructure(form).ToFormData(); |
+ EXPECT_EQ(form, FormStructure(form).ToFormData()); |
+} |