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

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

Issue 2182123003: [Payments] Add information requested by merchant metrics to PR. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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/PaymentRequestNoShippingTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNoShippingTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNoShippingTest.java
index 2a9abb07a243cf2eacde9fce294d453f7bff2506..8615ba883fd4c60dada7bb5933118b8946d1a28c 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNoShippingTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNoShippingTest.java
@@ -8,6 +8,7 @@ import android.content.DialogInterface;
import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.ThreadUtils;
+import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
@@ -343,4 +344,23 @@ public class PaymentRequestNoShippingTest extends PaymentRequestTestBase {
expectResultContains(new String[] {"Request cancelled"});
}
+
+ /**
+ * Test that starting a payment request that requires user information except for the payment
+ * results in the appropriate metric being logged in the PaymentRequest.RequestedInformation
+ * histogram.
+ */
+ @MediumTest
+ public void testRequestedInformationMetric() throws InterruptedException, ExecutionException,
+ TimeoutException {
+ // Start the Payment Request.
+ triggerUIAndWait(mReadyToPay);
+
+ // Make sure that only the appropriate enum value was logged.
+ for (int i = 0; i < PaymentRequestMetrics.REQUESTED_INFORMATION_MAX; ++i) {
+ assertEquals((i == PaymentRequestMetrics.REQUESTED_INFORMATION_NONE ? 1 : 0),
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.RequestedInformation", i));
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698