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

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

Issue 2003563003: [Autofill] Quality metric based on autocomplete attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: histograms.xml Created 4 years, 7 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
« no previous file with comments | « components/autofill/core/browser/form_structure.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 74a4e2269ddbe95bc8a97855ad31048b1461fd06..348940d68bd0f2a3ed0e765fd388e7860cce15da 100644
--- a/components/autofill/core/browser/form_structure_unittest.cc
+++ b/components/autofill/core/browser/form_structure_unittest.cc
@@ -3513,7 +3513,6 @@ TEST_F(FormStructureTest, ParseQueryResponse) {
EXPECT_EQ(0, forms[1]->field(1)->server_type());
}
-// If user defined types are present, only parse password fields.
TEST_F(FormStructureTest, ParseQueryResponseAuthorDefinedTypes) {
FormData form;
form.origin = GURL("http://foo.com");
@@ -3536,16 +3535,21 @@ TEST_F(FormStructureTest, ParseQueryResponseAuthorDefinedTypes) {
forms.front()->DetermineHeuristicTypes();
AutofillQueryResponseContents response;
- response.add_field()->set_autofill_type(9);
- response.add_field()->set_autofill_type(76);
+ response.add_field()->set_autofill_type(EMAIL_ADDRESS);
+ response.add_field()->set_autofill_type(ACCOUNT_CREATION_PASSWORD);
std::string response_string;
ASSERT_TRUE(response.SerializeToString(&response_string));
FormStructure::ParseQueryResponse(response_string, forms.get(), nullptr);
ASSERT_GE(forms[0]->field_count(), 2U);
- EXPECT_EQ(NO_SERVER_DATA, forms[0]->field(0)->server_type());
- EXPECT_EQ(76, forms[0]->field(1)->server_type());
+ // Server type is parsed from the response and is the end result type.
+ EXPECT_EQ(EMAIL_ADDRESS, forms[0]->field(0)->server_type());
+ EXPECT_EQ(EMAIL_ADDRESS, forms[0]->field(0)->Type().GetStorableType());
+ EXPECT_EQ(ACCOUNT_CREATION_PASSWORD, forms[0]->field(1)->server_type());
+ // TODO(crbug.com/613666): Should be a properly defined type, and not
+ // UNKNOWN_TYPE.
+ EXPECT_EQ(UNKNOWN_TYPE, forms[0]->field(1)->Type().GetStorableType());
}
TEST_F(FormStructureTest, FindLongestCommonPrefix) {
« no previous file with comments | « components/autofill/core/browser/form_structure.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698