| OLD | NEW |
| 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.support.test.filters.MediumTest; | 8 import android.support.test.filters.MediumTest; |
| 9 | 9 |
| 10 import org.junit.Assert; | 10 import org.junit.Assert; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 */ | 78 */ |
| 79 @Test | 79 @Test |
| 80 @MediumTest | 80 @MediumTest |
| 81 @Feature({"Payments"}) | 81 @Feature({"Payments"}) |
| 82 public void testRequestedInformationMetric() | 82 public void testRequestedInformationMetric() |
| 83 throws InterruptedException, ExecutionException, TimeoutException { | 83 throws InterruptedException, ExecutionException, TimeoutException { |
| 84 // Start the Payment Request. | 84 // Start the Payment Request. |
| 85 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead
yToPay()); | 85 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead
yToPay()); |
| 86 | 86 |
| 87 // Make sure that only the appropriate enum value was logged. | 87 // Make sure that only the appropriate enum value was logged. |
| 88 for (int i = 0; i < PaymentRequestMetrics.REQUESTED_INFORMATION_MAX; ++i
) { | 88 for (int i = 0; i < RequestedInformation.MAX; ++i) { |
| 89 Assert.assertEquals( | 89 Assert.assertEquals( |
| 90 (i | 90 (i == (RequestedInformation.EMAIL | RequestedInformation.SHI
PPING) ? 1 : 0), |
| 91 == (PaymentRequestMetrics.REQUESTED_
INFORMATION_EMAIL | |
| 92 | PaymentRequestMetrics | |
| 93 .REQUESTED_INFO
RMATION_SHIPPING) | |
| 94 ? 1 | |
| 95 : 0), | |
| 96 RecordHistogram.getHistogramValueCountForTesting( | 91 RecordHistogram.getHistogramValueCountForTesting( |
| 97 "PaymentRequest.RequestedInformation", i)); | 92 "PaymentRequest.RequestedInformation", i)); |
| 98 } | 93 } |
| 99 } | 94 } |
| 100 } | 95 } |
| OLD | NEW |