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

Unified Diff: chrome/browser/ui/views/payments/payment_request_journey_logger_browsertest.cc

Issue 2943433004: [Payments] Log multiple events in the journey logger. (Closed)
Patch Set: addressed comment Created 3 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: 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",

Powered by Google App Engine
This is Rietveld 408576698