Chromium Code Reviews| Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java |
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..489bb18945d44291480682fefbec3b025b25455e |
| --- /dev/null |
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.browser.payments; |
| + |
| +import android.content.DialogInterface; |
| +import android.test.suitebuilder.annotation.MediumTest; |
| + |
| +import org.chromium.chrome.R; |
| +import org.chromium.chrome.browser.autofill.AutofillTestHelper; |
| +import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
| +import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; |
| + |
| +import java.util.concurrent.ExecutionException; |
| +import java.util.concurrent.TimeoutException; |
| + |
| +/** |
| + * A payment integration test for a merchant that provides free shipping regardless of address. |
| + */ |
| +public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase { |
| + public PaymentRequestFreeShippingTest() { |
| + super("payment_request_free_shipping_test.html"); |
| + } |
| + |
| + @Override |
| + public void onMainActivityStarted() |
| + throws InterruptedException, ExecutionException, TimeoutException { |
| + AutofillTestHelper helper = new AutofillTestHelper(); |
| + helper.setProfile(new AutofillProfile("", "https://example.com", true, "Jon Doe", "Google", |
| + "340 Main St", "CA", "Los Angeles", "", "90291", "", "US", "", "", "en-US")); |
| + helper.setCreditCard(new CreditCard("", "https://example.com", true, true, "Jon Doe", |
| + "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_visa)); |
|
gone
2016/05/12 02:40:27
At some point, it might make sense to move this up
please use gerrit instead
2016/05/12 02:58:12
Acknowledged.
|
| + } |
| + |
| + @MediumTest |
| + public void testPay() throws InterruptedException, ExecutionException, TimeoutException { |
| + triggerUIAndWait(mReadyToPay); |
| + clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
| + typeInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", |
| + mReadyForUnmaskInput.getTarget(), mReadyToUnmask); |
| + clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, |
| + mReadyToUnmask.getTarget(), mDismissed); |
| + expectResultContains(new String[] {"Jon Doe", "4111111111111111", "12", "2050", "visa", |
| + "123", "Google", "340 Main St", "CA", "Los Angeles", "90291", "US", "en", |
| + "freeShippingOption"}); |
| + } |
| +} |