| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.chrome.browser.payments; | |
| 6 | |
| 7 import android.test.suitebuilder.annotation.MediumTest; | |
| 8 | |
| 9 import org.chromium.base.test.util.CommandLineFlags; | |
| 10 import org.chromium.base.test.util.Feature; | |
| 11 | |
| 12 import java.util.concurrent.ExecutionException; | |
| 13 import java.util.concurrent.TimeoutException; | |
| 14 | |
| 15 /** | |
| 16 * A payment integration test for checking whether user can make active payment
using a payment app. | |
| 17 */ | |
| 18 @CommandLineFlags.Add("enable-blink-features=CanMakeActivePayment") | |
| 19 public class PaymentRequestPaymentAppActivePaymentQueryTest extends PaymentReque
stTestBase { | |
| 20 public PaymentRequestPaymentAppActivePaymentQueryTest() { | |
| 21 super("payment_request_active_payment_query_bobpay_test.html"); | |
| 22 } | |
| 23 | |
| 24 @Override | |
| 25 public void onMainActivityStarted() throws InterruptedException, ExecutionEx
ception, | |
| 26 TimeoutException {} | |
| 27 | |
| 28 @MediumTest | |
| 29 @Feature({"Payments"}) | |
| 30 public void testNoBobPayInstalled() throws InterruptedException, ExecutionEx
ception, | |
| 31 TimeoutException { | |
| 32 triggerUIAndWait(mActivePaymentQueryResponded); | |
| 33 expectResultContains(new String[]{"false, false"}); | |
| 34 | |
| 35 clickNodeAndWait("otherBuy", mActivePaymentQueryResponded); | |
| 36 expectResultContains(new String[]{"false, QuotaExceededError"}); | |
| 37 } | |
| 38 | |
| 39 @MediumTest | |
| 40 @Feature({"Payments"}) | |
| 41 public void testNoInstrumentsInFastBobPay() throws InterruptedException, Exe
cutionException, | |
| 42 TimeoutException { | |
| 43 installPaymentApp(NO_INSTRUMENTS, IMMEDIATE_RESPONSE); | |
| 44 triggerUIAndWait(mActivePaymentQueryResponded); | |
| 45 expectResultContains(new String[]{"false, false"}); | |
| 46 | |
| 47 clickNodeAndWait("otherBuy", mActivePaymentQueryResponded); | |
| 48 expectResultContains(new String[]{"false, QuotaExceededError"}); | |
| 49 } | |
| 50 | |
| 51 @MediumTest | |
| 52 @Feature({"Payments"}) | |
| 53 public void testNoInstrumentsInSlowBobPay() throws InterruptedException, Exe
cutionException, | |
| 54 TimeoutException { | |
| 55 installPaymentApp(NO_INSTRUMENTS, DELAYED_RESPONSE); | |
| 56 triggerUIAndWait(mActivePaymentQueryResponded); | |
| 57 expectResultContains(new String[]{"false, false"}); | |
| 58 | |
| 59 clickNodeAndWait("otherBuy", mActivePaymentQueryResponded); | |
| 60 expectResultContains(new String[]{"false, QuotaExceededError"}); | |
| 61 } | |
| 62 | |
| 63 @MediumTest | |
| 64 @Feature({"Payments"}) | |
| 65 public void testPayViaFastBobPay() throws InterruptedException, ExecutionExc
eption, | |
| 66 TimeoutException { | |
| 67 installPaymentApp(HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE); | |
| 68 triggerUIAndWait(mActivePaymentQueryResponded); | |
| 69 expectResultContains(new String[]{"true, true"}); | |
| 70 | |
| 71 clickNodeAndWait("otherBuy", mActivePaymentQueryResponded); | |
| 72 expectResultContains(new String[]{"true, QuotaExceededError"}); | |
| 73 } | |
| 74 | |
| 75 @MediumTest | |
| 76 @Feature({"Payments"}) | |
| 77 public void testPayViaSlowBobPay() throws InterruptedException, ExecutionExc
eption, | |
| 78 TimeoutException { | |
| 79 installPaymentApp(HAVE_INSTRUMENTS, DELAYED_RESPONSE); | |
| 80 triggerUIAndWait(mActivePaymentQueryResponded); | |
| 81 expectResultContains(new String[]{"true, true"}); | |
| 82 | |
| 83 clickNodeAndWait("otherBuy", mActivePaymentQueryResponded); | |
| 84 expectResultContains(new String[]{"true, QuotaExceededError"}); | |
| 85 } | |
| 86 } | |
| OLD | NEW |