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

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

Issue 2211083002: [Merge M-53] Log the different information that the merchant requires to complete a Payment Request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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/PaymentRequestPhoneTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPhoneTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPhoneTest.java
index 94413cf291d03d0ebadde06cd6ff9f40e14c5ecf..c442954dd87fd600b99fc1349db118f408bd87b9 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPhoneTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPhoneTest.java
@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.payments;
import android.content.DialogInterface;
import android.test.suitebuilder.annotation.MediumTest;
+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;
@@ -75,4 +76,22 @@ public class PaymentRequestPhoneTest extends PaymentRequestTestBase {
clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed);
expectResultContains(new String[] {"999-999-9999"});
}
+
+ /**
+ * Test that starting a payment request that requires only the user's phone number 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_PHONE ? 1 : 0),
+ RecordHistogram.getHistogramValueCountForTesting(
+ "PaymentRequest.RequestedInformation", i));
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698