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

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

Issue 11348273: [autofill] Fill in values on a successful run of interactive autocomplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: estade@ review Created 8 years, 1 month 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
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());
+}

Powered by Google App Engine
This is Rietveld 408576698