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

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

Issue 2097713002: Specify billing address for autofill cards in PaymentRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 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.test.suitebuilder.annotation.MediumTest; 8 import android.test.suitebuilder.annotation.MediumTest;
9 9
10 import org.chromium.chrome.R; 10 import org.chromium.chrome.R;
(...skipping 11 matching lines...) Expand all
22 public PaymentRequestFreeShippingTest() { 22 public PaymentRequestFreeShippingTest() {
23 // This merchant provides free shipping worldwide. 23 // This merchant provides free shipping worldwide.
24 super("payment_request_free_shipping_test.html"); 24 super("payment_request_free_shipping_test.html");
25 } 25 }
26 26
27 @Override 27 @Override
28 public void onMainActivityStarted() 28 public void onMainActivityStarted()
29 throws InterruptedException, ExecutionException, TimeoutException { 29 throws InterruptedException, ExecutionException, TimeoutException {
30 AutofillTestHelper helper = new AutofillTestHelper(); 30 AutofillTestHelper helper = new AutofillTestHelper();
31 // The user has a shipping address on disk. 31 // The user has a shipping address on disk.
32 helper.setProfile(new AutofillProfile("", "https://example.com", true, " Jon Doe", "Google", 32 String billingAddressId = helper.setProfile(new AutofillProfile("", "htt ps://example.com",
33 "340 Main St", "CA", "Los Angeles", "", "90291", "", "US", "", " ", "en-US")); 33 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", " ", "90291", "",
34 "US", "", "", "en-US"));
34 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru e, "Jon Doe", 35 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru e, "Jon Doe",
35 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_ visa, 36 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_ visa,
36 "" /* billingAddressId */)); 37 billingAddressId));
37 } 38 }
38 39
39 /** Submit the shipping address to the merchant when the user clicks "Pay." */ 40 /** Submit the shipping address to the merchant when the user clicks "Pay." */
40 @MediumTest 41 @MediumTest
41 public void testPay() throws InterruptedException, ExecutionException, Timeo utException { 42 public void testPay() throws InterruptedException, ExecutionException, Timeo utException {
42 triggerUIAndWait(mReadyToPay); 43 triggerUIAndWait(mReadyToPay);
43 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); 44 clickAndWait(R.id.button_primary, mReadyForUnmaskInput);
44 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo Unmask); 45 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo Unmask);
45 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed ); 46 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed );
46 expectResultContains(new String[] {"Jon Doe", "4111111111111111", "12", "2050", "visa", 47 expectResultContains(new String[] {"Jon Doe", "4111111111111111", "12", "2050", "visa",
47 "123", "Google", "340 Main St", "CA", "Los Angeles", "90291", "U S", "en", 48 "123", "Google", "340 Main St", "CA", "Los Angeles", "90291", "U S", "en",
48 "freeShippingOption"}); 49 "freeShippingOption"});
49 } 50 }
50 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698