Commit dec1e3fc authored by Christoph Schwering's avatar Christoph Schwering Committed by Commit Bot

Added SCOPED_TEST() to identify source of flakiness in AutofillMetricsTest.FormFillDuration.

Bug: 1009364
Change-Id: Icbd6f625d668362475728f7facc66c7f5d132f54
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1836191
Commit-Queue: Dominic Battré <battre@chromium.org>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702806}
parent bb647ed6
...@@ -4400,12 +4400,10 @@ TEST_P(AutofillMetricsIFrameTest, ...@@ -4400,12 +4400,10 @@ TEST_P(AutofillMetricsIFrameTest,
SubmissionSource::FORM_SUBMISSION); SubmissionSource::FORM_SUBMISSION);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_WRONG_SIZE_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_WRONG_SIZE_CARD, 1);
1);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_WRONG_SIZE_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_WRONG_SIZE_CARD, 1);
1);
} }
TEST_P(AutofillMetricsIFrameTest, TEST_P(AutofillMetricsIFrameTest,
...@@ -4447,12 +4445,10 @@ TEST_P(AutofillMetricsIFrameTest, ...@@ -4447,12 +4445,10 @@ TEST_P(AutofillMetricsIFrameTest,
SubmissionSource::FORM_SUBMISSION); SubmissionSource::FORM_SUBMISSION);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_FAIL_LUHN_CHECK_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_FAIL_LUHN_CHECK_CARD, 1);
1);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_FAIL_LUHN_CHECK_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_FAIL_LUHN_CHECK_CARD, 1);
1);
} }
TEST_P(AutofillMetricsIFrameTest, TEST_P(AutofillMetricsIFrameTest,
...@@ -4495,12 +4491,10 @@ TEST_P(AutofillMetricsIFrameTest, ...@@ -4495,12 +4491,10 @@ TEST_P(AutofillMetricsIFrameTest,
SubmissionSource::FORM_SUBMISSION); SubmissionSource::FORM_SUBMISSION);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_UNKNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_UNKNOWN_CARD, 1);
1);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_UNKNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_UNKNOWN_CARD, 1);
1);
} }
TEST_P(AutofillMetricsIFrameTest, TEST_P(AutofillMetricsIFrameTest,
...@@ -4543,12 +4537,10 @@ TEST_P(AutofillMetricsIFrameTest, ...@@ -4543,12 +4537,10 @@ TEST_P(AutofillMetricsIFrameTest,
SubmissionSource::FORM_SUBMISSION); SubmissionSource::FORM_SUBMISSION);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, 1);
1);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, 1);
1);
} }
TEST_P(AutofillMetricsIFrameTest, TEST_P(AutofillMetricsIFrameTest,
...@@ -4596,27 +4588,22 @@ TEST_P(AutofillMetricsIFrameTest, ...@@ -4596,27 +4588,22 @@ TEST_P(AutofillMetricsIFrameTest,
SubmissionSource::FORM_SUBMISSION); SubmissionSource::FORM_SUBMISSION);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_UNKNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_UNKNOWN_CARD, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_NO_CARD, 0); FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_NO_CARD, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, FORM_EVENT_SUBMIT_WITHOUT_SELECTING_SUGGESTIONS_KNOWN_CARD, 0);
0);
} }
TEST_F(AutofillMetricsTest, ShouldNotLogFormEventNoCardForAddressForm) { TEST_F(AutofillMetricsTest, ShouldNotLogFormEventNoCardForAddressForm) {
...@@ -5020,12 +5007,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardSubmittedFormEvents) { ...@@ -5020,12 +5007,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardSubmittedFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount("Autofill.FormEvents.CreditCard", histogram_tester.ExpectBucketCount("Autofill.FormEvents.CreditCard",
FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE,
1); 1);
...@@ -5052,12 +5037,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardSubmittedFormEvents) { ...@@ -5052,12 +5037,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardSubmittedFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
} }
// Reset the autofill manager state and purge UKM logs. // Reset the autofill manager state and purge UKM logs.
...@@ -5098,12 +5081,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardSubmittedFormEvents) { ...@@ -5098,12 +5081,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardSubmittedFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 0);
...@@ -5130,12 +5111,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardSubmittedFormEvents) { ...@@ -5130,12 +5111,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardSubmittedFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
VerifyUkm( VerifyUkm(
test_ukm_recorder_, form, UkmSuggestionsShownType::kEntryName, test_ukm_recorder_, form, UkmSuggestionsShownType::kEntryName,
...@@ -5364,12 +5343,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardWillSubmitFormEvents) { ...@@ -5364,12 +5343,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardWillSubmitFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount("Autofill.FormEvents.CreditCard", histogram_tester.ExpectBucketCount("Autofill.FormEvents.CreditCard",
FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE,
1); 1);
...@@ -5396,12 +5373,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardWillSubmitFormEvents) { ...@@ -5396,12 +5373,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardWillSubmitFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
} }
// Reset the autofill manager state. // Reset the autofill manager state.
...@@ -5441,12 +5416,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardWillSubmitFormEvents) { ...@@ -5441,12 +5416,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardWillSubmitFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SUGGESTION_SHOWN_WILL_SUBMIT_ONCE, 0);
...@@ -5473,12 +5446,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardWillSubmitFormEvents) { ...@@ -5473,12 +5446,10 @@ TEST_P(AutofillMetricsIFrameTest, CreditCardWillSubmitFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.CreditCard", "Autofill.FormEvents.CreditCard",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
credit_card_form_events_frame_histogram_, credit_card_form_events_frame_histogram_,
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
} }
} }
...@@ -6167,8 +6138,7 @@ TEST_F(AutofillMetricsTest, AddressSubmittedFormEvents) { ...@@ -6167,8 +6138,7 @@ TEST_F(AutofillMetricsTest, AddressSubmittedFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0);
...@@ -6183,8 +6153,7 @@ TEST_F(AutofillMetricsTest, AddressSubmittedFormEvents) { ...@@ -6183,8 +6153,7 @@ TEST_F(AutofillMetricsTest, AddressSubmittedFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
// Check if FormEvent UKM is logged properly // Check if FormEvent UKM is logged properly
auto entries = auto entries =
...@@ -6308,8 +6277,7 @@ TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) { ...@@ -6308,8 +6277,7 @@ TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0);
...@@ -6324,8 +6292,7 @@ TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) { ...@@ -6324,8 +6292,7 @@ TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
// Check if FormEvent UKM is logged properly // Check if FormEvent UKM is logged properly
auto entries = auto entries =
test_ukm_recorder_->GetEntriesByName(UkmFormEventType::kEntryName); test_ukm_recorder_->GetEntriesByName(UkmFormEventType::kEntryName);
...@@ -6358,8 +6325,7 @@ TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) { ...@@ -6358,8 +6325,7 @@ TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_WILL_SUBMIT_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_WILL_SUBMIT_ONCE, 0);
0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0); FORM_EVENT_SUGGESTION_SHOWN_SUBMITTED_ONCE, 0);
...@@ -6374,8 +6340,7 @@ TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) { ...@@ -6374,8 +6340,7 @@ TEST_F(AutofillMetricsTest, AddressWillSubmitFormEvents) {
FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0); FORM_EVENT_SERVER_SUGGESTION_SUBMITTED_ONCE, 0);
histogram_tester.ExpectBucketCount( histogram_tester.ExpectBucketCount(
"Autofill.FormEvents.Address", "Autofill.FormEvents.Address",
FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, FORM_EVENT_MASKED_SERVER_CARD_SUGGESTION_SUBMITTED_ONCE, 0);
0);
// Check if FormEvent UKM is logged properly // Check if FormEvent UKM is logged properly
auto entries = auto entries =
test_ukm_recorder_->GetEntriesByName(UkmFormEventType::kEntryName); test_ukm_recorder_->GetEntriesByName(UkmFormEventType::kEntryName);
...@@ -7464,7 +7429,7 @@ TEST_F(AutofillMetricsTest, UserHappinessFormInteraction_AddressForm) { ...@@ -7464,7 +7429,7 @@ TEST_F(AutofillMetricsTest, UserHappinessFormInteraction_AddressForm) {
// Verify that we correctly log metrics tracking the duration of form fill. // Verify that we correctly log metrics tracking the duration of form fill.
// TODO(crbug.com/1009364) Test is flake on many builders. // TODO(crbug.com/1009364) Test is flake on many builders.
TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) { TEST_F(AutofillMetricsTest, FormFillDuration) {
// Load a fillable form. // Load a fillable form.
FormData form; FormData form;
form.name = ASCIIToUTF16("TestForm"); form.name = ASCIIToUTF16("TestForm");
...@@ -7503,6 +7468,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) { ...@@ -7503,6 +7468,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) {
// Expect only form load metrics to be logged if the form is submitted without // Expect only form load metrics to be logged if the form is submitted without
// user interaction. // user interaction.
{ {
SCOPED_TRACE("Test 1");
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
autofill_manager_->OnFormsSeen(forms, TimeTicks::Now()); autofill_manager_->OnFormsSeen(forms, TimeTicks::Now());
autofill_manager_->OnFormSubmitted(form, false, autofill_manager_->OnFormSubmitted(form, false,
...@@ -7522,6 +7488,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) { ...@@ -7522,6 +7488,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) {
// Expect metric to be logged if the user manually edited a form field. // Expect metric to be logged if the user manually edited a form field.
{ {
SCOPED_TRACE("Test 2");
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
autofill_manager_->OnFormsSeen(forms, TimeTicks::Now()); autofill_manager_->OnFormsSeen(forms, TimeTicks::Now());
base::TimeTicks parse_time = autofill_manager_->form_structures() base::TimeTicks parse_time = autofill_manager_->form_structures()
...@@ -7549,6 +7516,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) { ...@@ -7549,6 +7516,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) {
// Expect metric to be logged if the user autofilled the form. // Expect metric to be logged if the user autofilled the form.
form.fields[0].is_autofilled = true; form.fields[0].is_autofilled = true;
{ {
SCOPED_TRACE("Test 3");
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
autofill_manager_->OnFormsSeen(forms, TimeTicks::Now()); autofill_manager_->OnFormsSeen(forms, TimeTicks::Now());
base::TimeTicks parse_time = autofill_manager_->form_structures() base::TimeTicks parse_time = autofill_manager_->form_structures()
...@@ -7576,6 +7544,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) { ...@@ -7576,6 +7544,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) {
// and autofilled others. Messages can arrive out of order, so make sure they // and autofilled others. Messages can arrive out of order, so make sure they
// take precedence appropriately. // take precedence appropriately.
{ {
SCOPED_TRACE("Test 4");
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
autofill_manager_->OnFormsSeen(forms, TimeTicks::Now()); autofill_manager_->OnFormsSeen(forms, TimeTicks::Now());
...@@ -7606,6 +7575,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) { ...@@ -7606,6 +7575,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) {
// Make sure that loading another form doesn't affect metrics from the first // Make sure that loading another form doesn't affect metrics from the first
// form. // form.
{ {
SCOPED_TRACE("Test 5");
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
autofill_manager_->OnFormsSeen(forms, TimeTicks::Now()); autofill_manager_->OnFormsSeen(forms, TimeTicks::Now());
base::TimeTicks parse_time = autofill_manager_->form_structures() base::TimeTicks parse_time = autofill_manager_->form_structures()
...@@ -7636,6 +7606,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) { ...@@ -7636,6 +7606,7 @@ TEST_F(AutofillMetricsTest, DISABLED_FormFillDuration) {
// Make sure that submitting a form that was loaded later will report the // Make sure that submitting a form that was loaded later will report the
// later loading time. // later loading time.
{ {
SCOPED_TRACE("Test 6");
base::HistogramTester histogram_tester; base::HistogramTester histogram_tester;
autofill_manager_->OnFormsSeen(forms, TimeTicks::Now()); autofill_manager_->OnFormsSeen(forms, TimeTicks::Now());
autofill_manager_->OnFormsSeen(second_forms, TimeTicks::Now()); autofill_manager_->OnFormsSeen(second_forms, TimeTicks::Now());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment