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

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

Issue 1670763006: Autofill server-side heuristics for 2 fields password form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 10 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 21e9945456f52488d9573626f8f347ff8d9802df..045f28b5cdcd9bca757b7bb24f5032fd29464f0d 100644
--- a/components/autofill/core/browser/form_structure_unittest.cc
+++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -313,6 +313,23 @@ TEST_F(FormStructureTest, ShouldBeParsed) {
// Now, no text fields.
form_structure.reset(new FormStructure(form));
EXPECT_FALSE(form_structure->ShouldBeParsed());
+
+ // We have only one field, which is password, should not be parsed.
+ form.fields.clear();
+ field.label = ASCIIToUTF16("Password");
+ field.name = ASCIIToUTF16("pw");
+ field.form_control_type = "password";
+ form.fields.push_back(field);
+ form_structure.reset(new FormStructure(form));
+ EXPECT_FALSE(form_structure->ShouldBeParsed());
+
+ // We have two fields, which are passwords, should be parsed.
+ field.label = ASCIIToUTF16("New password");
+ field.name = ASCIIToUTF16("new_pw");
+ field.form_control_type = "password";
+ form.fields.push_back(field);
+ form_structure.reset(new FormStructure(form));
+ EXPECT_TRUE(form_structure->ShouldBeParsed());
}
// Tests that ShouldBeParsed returns true for a form containing less than three
« no previous file with comments | « components/autofill/core/browser/form_structure.cc ('k') | components/autofill/core/common/autofill_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698