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

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

Issue 2773433002: Log observations of explicit UPI-VPA autocomplete hints. (Closed)
Patch Set: fix a nit Created 3 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/core/browser/autofill_metrics_unittest.cc
diff --git a/components/autofill/core/browser/autofill_metrics_unittest.cc b/components/autofill/core/browser/autofill_metrics_unittest.cc
index efea6e76cab0aafd11a2a5053fff1cb525bda757..c1c2d89a2d873da3b4ed9fa15cff93d10384c16e 100644
--- a/components/autofill/core/browser/autofill_metrics_unittest.cc
+++ b/components/autofill/core/browser/autofill_metrics_unittest.cc
@@ -1498,6 +1498,31 @@ TEST_F(AutofillMetricsTest, DeveloperEngagement) {
histogram_tester.ExpectBucketCount(
"Autofill.DeveloperEngagement",
AutofillMetrics::FILLABLE_FORM_CONTAINS_TYPE_HINTS, 1);
+ histogram_tester.ExpectBucketCount(
+ "Autofill.DeveloperEngagement",
+ AutofillMetrics::FORM_CONTAINS_UPI_VPA_HINT, 0);
+ }
+
+ // Add a field with an author-specified UPI-VPA field type in the form.
+ test::CreateTestFormField("", "", "", "text", &field);
+ field.autocomplete_attribute = "upi-vpa";
+ forms.back().fields.push_back(field);
+
+ // Expect the "form parsed" metric, the "author-specified field type
+ // hints" metric, and the "author-specified upi-vpa type" metric to be logged.
+ {
+ base::HistogramTester histogram_tester;
+ autofill_manager_->OnFormsSeen(forms, TimeTicks());
+ autofill_manager_->Reset();
+ histogram_tester.ExpectBucketCount("Autofill.DeveloperEngagement",
+ AutofillMetrics::FILLABLE_FORM_PARSED,
+ 1);
+ histogram_tester.ExpectBucketCount(
+ "Autofill.DeveloperEngagement",
+ AutofillMetrics::FILLABLE_FORM_CONTAINS_TYPE_HINTS, 1);
+ histogram_tester.ExpectBucketCount(
+ "Autofill.DeveloperEngagement",
+ AutofillMetrics::FORM_CONTAINS_UPI_VPA_HINT, 1);
}
}
« no previous file with comments | « components/autofill/core/browser/autofill_metrics.h ('k') | components/autofill/core/browser/autofill_type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698