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

Unified Diff: components/autofill/core/browser/form_structure_unittest.cc

Issue 23432002: Generate passwords only for forms that autofill server marks as account creation forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address llya's nits and fix a bug in form structure unit test. Created 7 years, 3 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
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 7d38165b4d1c440a03098cc5254ce6177963b41f..2ccd0af68812646cedac58e26dee73d038be92be 100644
--- a/components/autofill/core/browser/form_structure_unittest.cc
+++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -2329,10 +2329,11 @@ TEST(FormStructureTest, CheckFormSignature) {
field.name = ASCIIToUTF16("first");
form.fields.push_back(field);
- // Password fields shouldn't affect the signature.
- field.label = ASCIIToUTF16("Password");
- field.name = ASCIIToUTF16("password");
- field.form_control_type = "password";
+ // Checkable fields shouldn't affect the signature.
+ field.label = ASCIIToUTF16("Select");
+ field.name = ASCIIToUTF16("Select");
+ field.form_control_type = "checkbox";
+ field.is_checkable = true;
form.fields.push_back(field);
form_structure.reset(new FormStructure(form, std::string()));
@@ -2359,6 +2360,7 @@ TEST(FormStructureTest, CheckFormSignature) {
std::string("https://login.facebook.com&login_form&email&first")),
form_structure->FormSignature());
+ field.is_checkable = false;
field.label = ASCIIToUTF16("Random Field label");
field.name = ASCIIToUTF16("random1234");
field.form_control_type = "text";
@@ -2424,14 +2426,16 @@ TEST(FormStructureTest, SkipFieldTest) {
field.form_control_type = "text";
form.fields.push_back(field);
- field.label = ASCIIToUTF16("password");
- field.name = ASCIIToUTF16("password");
- field.form_control_type = "password";
+ field.label = ASCIIToUTF16("select");
+ field.name = ASCIIToUTF16("select");
+ field.form_control_type = "checkbox";
+ field.is_checkable = true;
form.fields.push_back(field);
field.label = base::string16();
field.name = ASCIIToUTF16("email");
field.form_control_type = "text";
+ field.is_checkable = false;
form.fields.push_back(field);
ScopedVector<FormStructure> forms;

Powered by Google App Engine
This is Rietveld 408576698