| 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 929fc0a046ab0ff32f01a66181aad69e7e52b646..12be5a011b463ed3c992392a96afcec0062f99b7 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));
|
| + }
|
| + }
|
| }
|
|
|