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

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

Issue 2110393003: [Autofill] Create more descriptive form submitted user actions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 7a70d64ed7fd199254b1a2726b04ac23821a20fa..f7ca28d7b8e5a18cfdec03ebf3907e832af88074 100644
--- a/components/autofill/core/browser/autofill_metrics_unittest.cc
+++ b/components/autofill/core/browser/autofill_metrics_unittest.cc
@@ -1671,7 +1671,8 @@ TEST_F(AutofillMetricsTest, CreditCardCheckoutFlowUserActions) {
autofill_manager_->SubmitForm(form, TimeTicks::Now());
EXPECT_EQ(1,
user_action_tester.GetActionCount("Autofill_OnWillSubmitForm"));
- EXPECT_EQ(1, user_action_tester.GetActionCount("Autofill_FormSubmitted"));
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_NonFillable"));
}
}
@@ -1748,7 +1749,8 @@ TEST_F(AutofillMetricsTest, ProfileCheckoutFlowUserActions) {
autofill_manager_->SubmitForm(form, TimeTicks::Now());
EXPECT_EQ(1,
user_action_tester.GetActionCount("Autofill_OnWillSubmitForm"));
- EXPECT_EQ(1, user_action_tester.GetActionCount("Autofill_FormSubmitted"));
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_NonFillable"));
}
}
@@ -3249,10 +3251,13 @@ TEST_F(AutofillMetricsTest, AutofillFormSubmittedState) {
// No data entered in the form.
{
base::HistogramTester histogram_tester;
+ base::UserActionTester user_action_tester;
autofill_manager_->SubmitForm(form, TimeTicks::Now());
histogram_tester.ExpectUniqueSample(
"Autofill.FormSubmittedState",
AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA, 1);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_NonFillable"));
}
// Non fillable form.
@@ -3262,10 +3267,13 @@ TEST_F(AutofillMetricsTest, AutofillFormSubmittedState) {
{
base::HistogramTester histogram_tester;
+ base::UserActionTester user_action_tester;
autofill_manager_->SubmitForm(form, TimeTicks::Now());
histogram_tester.ExpectUniqueSample(
"Autofill.FormSubmittedState",
AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA, 1);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_NonFillable"));
}
// Fill in the third field.
@@ -3275,21 +3283,27 @@ TEST_F(AutofillMetricsTest, AutofillFormSubmittedState) {
// Autofilled none with no suggestions shown.
{
base::HistogramTester histogram_tester;
+ base::UserActionTester user_action_tester;
autofill_manager_->SubmitForm(form, TimeTicks::Now());
histogram_tester.ExpectUniqueSample(
"Autofill.FormSubmittedState",
AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_NOT_SHOW_SUGGESTIONS,
1);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_FilledNone_SuggestionsNotShown"));
}
// Autofilled none with suggestions shown.
autofill_manager_->DidShowSuggestions(true, form, form.fields[2]);
{
base::HistogramTester histogram_tester;
+ base::UserActionTester user_action_tester;
autofill_manager_->SubmitForm(form, TimeTicks::Now());
histogram_tester.ExpectUniqueSample(
"Autofill.FormSubmittedState",
AutofillMetrics::FILLABLE_FORM_AUTOFILLED_NONE_DID_SHOW_SUGGESTIONS, 1);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_FilledNone_SuggestionsShown"));
}
// Mark one of the fields as autofilled.
@@ -3299,10 +3313,13 @@ TEST_F(AutofillMetricsTest, AutofillFormSubmittedState) {
// Autofilled some of the fields.
{
base::HistogramTester histogram_tester;
+ base::UserActionTester user_action_tester;
autofill_manager_->SubmitForm(form, TimeTicks::Now());
histogram_tester.ExpectUniqueSample(
"Autofill.FormSubmittedState",
AutofillMetrics::FILLABLE_FORM_AUTOFILLED_SOME, 1);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_FilledSome"));
}
// Mark all of the fillable fields as autofilled.
@@ -3313,10 +3330,13 @@ TEST_F(AutofillMetricsTest, AutofillFormSubmittedState) {
// Autofilled all the fields.
{
base::HistogramTester histogram_tester;
+ base::UserActionTester user_action_tester;
autofill_manager_->SubmitForm(form, TimeTicks::Now());
histogram_tester.ExpectUniqueSample(
"Autofill.FormSubmittedState",
AutofillMetrics::FILLABLE_FORM_AUTOFILLED_ALL, 1);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_FilledAll"));
}
// Clear out the third field's value.
@@ -3326,10 +3346,13 @@ TEST_F(AutofillMetricsTest, AutofillFormSubmittedState) {
// Non fillable form.
{
base::HistogramTester histogram_tester;
+ base::UserActionTester user_action_tester;
autofill_manager_->SubmitForm(form, TimeTicks::Now());
histogram_tester.ExpectUniqueSample(
"Autofill.FormSubmittedState",
AutofillMetrics::NON_FILLABLE_FORM_OR_NEW_DATA, 1);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Autofill_FormSubmitted_NonFillable"));
}
}

Powered by Google App Engine
This is Rietveld 408576698