| Index: chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc
|
| diff --git a/chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc
|
| index a6cf5d207700cb80a7483a0ed4eda0c546054b62..b017fc6ef9b94bb208aa96f395f2941126d17946 100644
|
| --- a/chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc
|
| +++ b/chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc
|
| @@ -44,6 +44,14 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestJourneyLoggerSelectedPaymentInstrumentTest,
|
| ResetEventObserver(DialogEvent::DIALOG_CLOSED);
|
| PayWithCreditCardAndWait(base::ASCIIToUTF16("123"));
|
|
|
| + histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Initiated",
|
| + 1, 1);
|
| + histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Shown", 1,
|
| + 1);
|
| + histogram_tester.ExpectUniqueSample(
|
| + "PaymentRequest.CheckoutFunnel.PayClicked", 1, 1);
|
| + histogram_tester.ExpectUniqueSample(
|
| + "PaymentRequest.CheckoutFunnel.ReceivedInstrumentDetails", 1, 1);
|
| // Expect a credit card as the selected payment instrument in the metrics.
|
| histogram_tester.ExpectBucketCount(
|
| "PaymentRequest.SelectedPaymentMethod",
|
| @@ -72,6 +80,8 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestJourneyLoggerNoSupportedPaymentMethodTest,
|
| ASSERT_TRUE(content::ExecuteScript(web_contents, click_buy_button_js));
|
| WaitForObservedEvent();
|
|
|
| + histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Initiated",
|
| + 1, 1);
|
| histogram_tester.ExpectBucketCount(
|
| "PaymentRequest.CheckoutFunnel.NoShow",
|
| JourneyLogger::NOT_SHOWN_REASON_NO_SUPPORTED_PAYMENT_METHOD, 1);
|
| @@ -117,7 +127,15 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestJourneyLoggerMultipleShowTest,
|
| histogram_tester.GetAllSamples("PaymentRequest.CheckoutFunnel.NoShow")
|
| .empty());
|
|
|
| - // Expect that the completion was logged correctly.
|
| + // Expect that other metrics were logged correctly.
|
| + histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Initiated",
|
| + 1, 1);
|
| + histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Shown", 1,
|
| + 1);
|
| + histogram_tester.ExpectUniqueSample(
|
| + "PaymentRequest.CheckoutFunnel.PayClicked", 1, 1);
|
| + histogram_tester.ExpectUniqueSample(
|
| + "PaymentRequest.CheckoutFunnel.ReceivedInstrumentDetails", 1, 1);
|
| histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Completed",
|
| 1, 1);
|
| }
|
| @@ -152,6 +170,15 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestJourneyLoggerMultipleShowTest,
|
| // Complete the original Payment Request.
|
| PayWithCreditCardAndWait(base::ASCIIToUTF16("123"), first_dialog_view);
|
|
|
| + histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Initiated",
|
| + 1, 2);
|
| + histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Shown", 1,
|
| + 1);
|
| + histogram_tester.ExpectUniqueSample(
|
| + "PaymentRequest.CheckoutFunnel.PayClicked", 1, 1);
|
| + histogram_tester.ExpectUniqueSample(
|
| + "PaymentRequest.CheckoutFunnel.ReceivedInstrumentDetails", 1, 1);
|
| +
|
| // The metrics should show that the original Payment Request should be
|
| // completed and the second one should not have been shown.
|
| histogram_tester.ExpectUniqueSample("PaymentRequest.CheckoutFunnel.Completed",
|
|
|