| 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));
|
| + }
|
| + }
|
| }
|
|
|