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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java

Issue 2447953002: [Payments] Add metrics for the new payer name contact info. (Closed)
Patch Set: Nits Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.payments; 5 package org.chromium.chrome.browser.payments;
6 6
7 import android.content.DialogInterface; 7 import android.content.DialogInterface;
8 import android.test.suitebuilder.annotation.MediumTest; 8 import android.test.suitebuilder.annotation.MediumTest;
9 9
10 import org.chromium.base.ThreadUtils; 10 import org.chromium.base.ThreadUtils;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 mUI.getContactDetailsSectionForTest().findViewById( 173 mUI.getContactDetailsSectionForTest().findViewById(
174 R.id.payments_add_option_button).performClick(); 174 R.id.payments_add_option_button).performClick();
175 } 175 }
176 }); 176 });
177 mDismissed.waitForCallback(callCount); 177 mDismissed.waitForCallback(callCount);
178 178
179 expectResultContains(new String[] {"Request cancelled"}); 179 expectResultContains(new String[] {"Request cancelled"});
180 } 180 }
181 181
182 /** 182 /**
183 * Test that starting a payment request that requires the user's email addre ss and phone number 183 * Test that starting a payment request that requires the user's email addre ss, phone number and
184 * results in the appropriate metric being logged in the PaymentRequest.Requ estedInformation 184 * name results in the appropriate metric being logged in the
185 * histogram. 185 * PaymentRequest.RequestedInformation histogram.
186 */ 186 */
187 @MediumTest 187 @MediumTest
188 @Feature({"Payments"}) 188 @Feature({"Payments"})
189 public void testRequestedInformationMetric() throws InterruptedException, Ex ecutionException, 189 public void testRequestedInformationMetric() throws InterruptedException, Ex ecutionException,
190 TimeoutException { 190 TimeoutException {
191 // Start the Payment Request. 191 // Start the Payment Request.
192 triggerUIAndWait(mReadyToPay); 192 triggerUIAndWait(mReadyToPay);
193 193
194 // Make sure that only the appropriate enum value was logged. 194 // Make sure that only the appropriate enum value was logged.
195 for (int i = 0; i < PaymentRequestMetrics.REQUESTED_INFORMATION_MAX; ++i ) { 195 for (int i = 0; i < PaymentRequestMetrics.REQUESTED_INFORMATION_MAX; ++i ) {
196 assertEquals((i == (PaymentRequestMetrics.REQUESTED_INFORMATION_EMAI L 196 assertEquals((i == (PaymentRequestMetrics.REQUESTED_INFORMATION_EMAI L
197 | PaymentRequestMetrics.REQUESTED_INFORMATION_PHONE) ? 1 : 0 ), 197 | PaymentRequestMetrics.REQUESTED_INFORMATION_PHONE
198 | PaymentRequestMetrics.REQUESTED_INFORMATION_NAME) ? 1 : 0) ,
198 RecordHistogram.getHistogramValueCountForTesting( 199 RecordHistogram.getHistogramValueCountForTesting(
199 "PaymentRequest.RequestedInformation", i)); 200 "PaymentRequest.RequestedInformation", i));
200 } 201 }
201 } 202 }
202 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698