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

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

Issue 2904083003: [Payments] Use C++ metric enums in Java. (Closed)
Patch Set: Enum rename for Windows Created 3 years, 6 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 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.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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698