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

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

Issue 2808983003: [Payments] Format shipping and billing phone number in normalizer. (Closed)
Patch Set: Nits Created 3 years, 8 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.chromium.base.metrics.RecordHistogram; 10 import org.chromium.base.metrics.RecordHistogram;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 * Submit the payer name, email address, phone number and shipping address t o the merchant when 46 * Submit the payer name, email address, phone number and shipping address t o the merchant when
47 * the user clicks "Pay." 47 * the user clicks "Pay."
48 */ 48 */
49 @MediumTest 49 @MediumTest
50 @Feature({"Payments"}) 50 @Feature({"Payments"})
51 public void testPay() throws InterruptedException, ExecutionException, Timeo utException { 51 public void testPay() throws InterruptedException, ExecutionException, Timeo utException {
52 triggerUIAndWait(mReadyToPay); 52 triggerUIAndWait(mReadyToPay);
53 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); 53 clickAndWait(R.id.button_primary, mReadyForUnmaskInput);
54 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo Unmask); 54 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo Unmask);
55 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed ); 55 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed );
56 expectResultContains(new String[] {"Jon Doe", "jon.doe@google.com", "555 -555-5555", 56 expectResultContains(new String[] {"Jon Doe", "jon.doe@google.com", "+15 555555555",
57 "Jon Doe", "4111111111111111", "12", "2050", "visa", "123", "Goo gle", "340 Main St", 57 "Jon Doe", "4111111111111111", "12", "2050", "visa", "123", "Goo gle", "340 Main St",
58 "CA", "Los Angeles", "90291", "US", "en", "freeShippingOption"}) ; 58 "CA", "Los Angeles", "90291", "US", "en", "freeShippingOption"}) ;
59 } 59 }
60 60
61 /** 61 /**
62 * Test that starting a payment request that requires an email address, a ph one number a name 62 * Test that starting a payment request that requires an email address, a ph one number a name
63 * and a shipping address results in the appropriate metric being logged in the 63 * and a shipping address results in the appropriate metric being logged in the
64 * PaymentRequest.RequestedInformation histogram. 64 * PaymentRequest.RequestedInformation histogram.
65 */ 65 */
66 @MediumTest 66 @MediumTest
67 @Feature({"Payments"}) 67 @Feature({"Payments"})
68 public void testRequestedInformationMetric() throws InterruptedException, Ex ecutionException, 68 public void testRequestedInformationMetric() throws InterruptedException, Ex ecutionException,
69 TimeoutException { 69 TimeoutException {
70 // Start the Payment Request. 70 // Start the Payment Request.
71 triggerUIAndWait(mReadyToPay); 71 triggerUIAndWait(mReadyToPay);
72 72
73 // Make sure that only the appropriate enum value was logged. 73 // Make sure that only the appropriate enum value was logged.
74 for (int i = 0; i < PaymentRequestMetrics.REQUESTED_INFORMATION_MAX; ++i ) { 74 for (int i = 0; i < PaymentRequestMetrics.REQUESTED_INFORMATION_MAX; ++i ) {
75 assertEquals((i == (PaymentRequestMetrics.REQUESTED_INFORMATION_EMAI L 75 assertEquals((i == (PaymentRequestMetrics.REQUESTED_INFORMATION_EMAI L
76 | PaymentRequestMetrics.REQUESTED_INFORMATION_PHONE 76 | PaymentRequestMetrics.REQUESTED_INFORMATION_PHONE
77 | PaymentRequestMetrics.REQUESTED_INFORMATION_SHIPPING 77 | PaymentRequestMetrics.REQUESTED_INFORMATION_SHIPPING
78 | PaymentRequestMetrics.REQUESTED_INFORMATION_NAME) ? 1 : 0) , 78 | PaymentRequestMetrics.REQUESTED_INFORMATION_NAME) ? 1 : 0) ,
79 RecordHistogram.getHistogramValueCountForTesting( 79 RecordHistogram.getHistogramValueCountForTesting(
80 "PaymentRequest.RequestedInformation", i)); 80 "PaymentRequest.RequestedInformation", i));
81 } 81 }
82 } 82 }
83 } 83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698