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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java

Issue 2810323002: [Payments] Add metric for when Pr UI is skipped. (Closed)
Patch Set: Use the BooleanSkipped enum Created 3 years, 8 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/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java
index 5f47ee99e5cfa10a997b7ff3ac0f1cad2acc857b..300fad6731e5106da84e85f1f3330107117a3848 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMetricsTest.java
@@ -10,8 +10,10 @@ import android.support.test.filters.MediumTest;
import org.chromium.base.ThreadUtils;
import org.chromium.base.metrics.RecordHistogram;
+import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard;
@@ -263,6 +265,47 @@ public class PaymentRequestMetricsTest extends PaymentRequestTestBase {
}
/**
+ * Expect that the SkippedShow metric is logged when the UI directly goes
+ * to the payment app UI during a Payment Request.
+ */
+ @MediumTest
+ @Feature({"Payments"})
+ public void testMetrics_SkippedShow()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ // Complete a Payment Request with Android Pay.
+ installPaymentApp("https://android.com/pay", HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE);
+ triggerUIAndWait("androidPaySkipUiBuy", mResultReady);
+
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CheckoutFunnel.SkippedShow", 1));
+ assertEquals(0,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CheckoutFunnel.Shown", 1));
+ }
+
+ /**
+ * Expect that the PaymentRequest UI is shown even if all the requirements are met to skip, if
+ * the skip feature is disabled.
+ */
+ @MediumTest
+ @Feature({"Payments"})
+ @CommandLineFlags.Add({"disable-features=" + ChromeFeatureList.WEB_PAYMENTS_SINGLE_APP_UI_SKIP})
+ public void testMetrics_SkippedShow_Disabled()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ // Complete a Payment Request with Android Pay.
+ installPaymentApp("https://android.com/pay", HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE);
+ triggerUIAndWait("androidPaySkipUiBuy", mReadyToPay);
+
+ assertEquals(1,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CheckoutFunnel.Shown", 1));
+ assertEquals(0,
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.CheckoutFunnel.SkippedShow", 1));
+ }
+
+ /**
* Expect that the "Shown" event is recorded only once.
*/
@MediumTest

Powered by Google App Engine
This is Rietveld 408576698