Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestAbortTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestAbortTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestAbortTest.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3a9986ccf891b131a6b87abea848d19dbdd401eb |
--- /dev/null |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestAbortTest.java |
@@ -0,0 +1,47 @@ |
+// 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.test.suitebuilder.annotation.MediumTest; |
+ |
+import org.chromium.chrome.R; |
+import org.chromium.chrome.browser.autofill.AutofillTestHelper; |
+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 aborts their payment request. |
+ */ |
+public class PaymentRequestAbortTest extends PaymentRequestTestBase { |
+ public PaymentRequestAbortTest() { |
+ super("payment_request_abort_test.html"); |
+ } |
+ |
+ @Override |
+ public void onMainActivityStarted() |
+ throws InterruptedException, ExecutionException, TimeoutException { |
+ new AutofillTestHelper().setCreditCard(new CreditCard("", "https://example.com", true, true, |
+ "Jon Doe", "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_visa)); |
+ } |
+ |
+ @MediumTest |
+ public void testAbortBeforePayClicked() throws InterruptedException, ExecutionException, |
+ TimeoutException { |
+ triggerUIAndWait(mReadyToPay); |
+ clickNodeAndWait("abort", mDismissed); |
+ expectResultContains(new String[] {"Aborted"}); |
+ } |
+ |
+ @MediumTest |
+ public void testAbortWhileUnmaskingCard() throws InterruptedException, ExecutionException, |
+ TimeoutException { |
+ triggerUIAndWait(mReadyToPay); |
+ clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
+ clickNode("abort"); |
gone
2016/06/09 15:49:28
This will likely be flaky. Any timing hiccups wou
please use gerrit instead
2016/06/09 22:36:14
Done.
|
+ expectResultContains(new String[] {"Cannot abort"}); |
+ } |
+} |