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

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

Issue 853523004: Autofill: Set requirements for number of recognized fields in an autofillable form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bug, adjust tests Created 5 years, 11 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_field_unittest.cc
diff --git a/components/autofill/core/browser/form_field_unittest.cc b/components/autofill/core/browser/form_field_unittest.cc
index 763d77631727abdeff0723d1f5d99e2a015dc034..00fced6c2c5ccee6783f43ed0560aef28c645fc8 100644
--- a/components/autofill/core/browser/form_field_unittest.cc
+++ b/components/autofill/core/browser/form_field_unittest.cc
@@ -140,10 +140,14 @@ TEST(FormFieldTest, ParseFormFields) {
field_data.label = ASCIIToUTF16("Address line2");
fields.push_back(new AutofillField(field_data, field_data.label));
+ // Have a non-address field so the form parses successfully.
+ field_data.label = ASCIIToUTF16("City");
+ fields.push_back(new AutofillField(field_data, field_data.label));
+
ServerFieldTypeMap field_type_map;
FormField::ParseFormFields(fields.get(), &field_type_map);
// Checkable element shouldn't interfere with inference of Address line2.
- EXPECT_EQ(2U, field_type_map.size());
+ ASSERT_EQ(3U, field_type_map.size());
EXPECT_EQ(ADDRESS_HOME_LINE1,
field_type_map.find(ASCIIToUTF16("Address line1"))->second);

Powered by Google App Engine
This is Rietveld 408576698