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

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

Issue 12852003: Autofill:Autocheckout: Enable looking at all elements for Autocheckout flow (ignoring 3 element lim… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments and more tests. Created 7 years, 9 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/browser/form_structure_unittest.cc
diff --git a/components/autofill/browser/form_structure_unittest.cc b/components/autofill/browser/form_structure_unittest.cc
index abbe1aa4e03be30768d0c6a1239e00717fef6e6b..49d715d9ec33025e8c3fa03efa2c2b756539579b 100644
--- a/components/autofill/browser/form_structure_unittest.cc
+++ b/components/autofill/browser/form_structure_unittest.cc
@@ -536,6 +536,20 @@ TEST(FormStructureTest, AutocompleteAttributeOverridesOtherHeuristics) {
EXPECT_EQ(UNKNOWN_TYPE, form_structure->field(0)->heuristic_type());
EXPECT_EQ(UNKNOWN_TYPE, form_structure->field(1)->heuristic_type());
EXPECT_EQ(UNKNOWN_TYPE, form_structure->field(2)->heuristic_type());
+
+ // When Autocheckout is enabled, we should ignore 'autocomplete' attribute
+ // when deciding to crowdsource.
+ form_structure.reset(new FormStructure(form, "http://fake.url"));
+ form_structure->DetermineHeuristicTypes(TestAutofillMetrics());
+ EXPECT_TRUE(form_structure->IsAutofillable(true));
+ EXPECT_TRUE(form_structure->ShouldBeCrowdsourced());
+
+ ASSERT_EQ(3U, form_structure->field_count());
+ ASSERT_EQ(0U, form_structure->autofill_count());
+
+ EXPECT_EQ(UNKNOWN_TYPE, form_structure->field(0)->heuristic_type());
+ EXPECT_EQ(UNKNOWN_TYPE, form_structure->field(1)->heuristic_type());
+ EXPECT_EQ(UNKNOWN_TYPE, form_structure->field(2)->heuristic_type());
}
// Verify that we can correctly process sections listed in the |autocomplete|

Powered by Google App Engine
This is Rietveld 408576698