| OLD | NEW |
| 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.support.test.filters.MediumTest; | 7 import android.support.test.filters.MediumTest; |
| 8 | 8 |
| 9 import org.chromium.base.test.util.Feature; | 9 import org.chromium.base.test.util.Feature; |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 @Override | 22 @Override |
| 23 public void onMainActivityStarted() throws InterruptedException, ExecutionEx
ception, | 23 public void onMainActivityStarted() throws InterruptedException, ExecutionEx
ception, |
| 24 TimeoutException {} | 24 TimeoutException {} |
| 25 | 25 |
| 26 @MediumTest | 26 @MediumTest |
| 27 @Feature({"Payments"}) | 27 @Feature({"Payments"}) |
| 28 public void testNoBobPayInstalled() throws InterruptedException, ExecutionEx
ception, | 28 public void testNoBobPayInstalled() throws InterruptedException, ExecutionEx
ception, |
| 29 TimeoutException { | 29 TimeoutException { |
| 30 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); | 30 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); |
| 31 expectResultContains(new String[]{"false, false"}); | 31 expectResultContains(new String[] {"false, false"}); |
| 32 | 32 |
| 33 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); | 33 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); |
| 34 expectResultContains(new String[]{"false, QuotaExceededError"}); | 34 expectResultContains(new String[] {"false, QuotaExceededError"}); |
| 35 } | 35 } |
| 36 | 36 |
| 37 @MediumTest | 37 @MediumTest |
| 38 @Feature({"Payments"}) |
| 39 public void testBobPayInstalledLater() |
| 40 throws InterruptedException, ExecutionException, TimeoutException { |
| 41 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); |
| 42 expectResultContains(new String[] {"false, false"}); |
| 43 |
| 44 installPaymentApp(HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE); |
| 45 |
| 46 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); |
| 47 expectResultContains(new String[] {"true, QuotaExceededError"}); |
| 48 } |
| 49 |
| 50 @MediumTest |
| 38 @Feature({"Payments"}) | 51 @Feature({"Payments"}) |
| 39 public void testNoInstrumentsInFastBobPay() throws InterruptedException, Exe
cutionException, | 52 public void testNoInstrumentsInFastBobPay() throws InterruptedException, Exe
cutionException, |
| 40 TimeoutException { | 53 TimeoutException { |
| 41 installPaymentApp(NO_INSTRUMENTS, IMMEDIATE_RESPONSE); | 54 installPaymentApp(NO_INSTRUMENTS, IMMEDIATE_RESPONSE); |
| 42 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); | 55 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); |
| 43 expectResultContains(new String[]{"false, false"}); | 56 expectResultContains(new String[] {"false, false"}); |
| 44 | 57 |
| 45 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); | 58 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); |
| 46 expectResultContains(new String[]{"false, QuotaExceededError"}); | 59 expectResultContains(new String[] {"false, QuotaExceededError"}); |
| 47 } | 60 } |
| 48 | 61 |
| 49 @MediumTest | 62 @MediumTest |
| 50 @Feature({"Payments"}) | 63 @Feature({"Payments"}) |
| 51 public void testNoInstrumentsInSlowBobPay() throws InterruptedException, Exe
cutionException, | 64 public void testNoInstrumentsInSlowBobPay() throws InterruptedException, Exe
cutionException, |
| 52 TimeoutException { | 65 TimeoutException { |
| 53 installPaymentApp(NO_INSTRUMENTS, DELAYED_RESPONSE); | 66 installPaymentApp(NO_INSTRUMENTS, DELAYED_RESPONSE); |
| 54 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); | 67 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); |
| 55 expectResultContains(new String[]{"false, false"}); | 68 expectResultContains(new String[] {"false, false"}); |
| 56 | 69 |
| 57 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); | 70 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); |
| 58 expectResultContains(new String[]{"false, QuotaExceededError"}); | 71 expectResultContains(new String[] {"false, QuotaExceededError"}); |
| 59 } | 72 } |
| 60 | 73 |
| 61 @MediumTest | 74 @MediumTest |
| 62 @Feature({"Payments"}) | 75 @Feature({"Payments"}) |
| 63 public void testPayViaFastBobPay() throws InterruptedException, ExecutionExc
eption, | 76 public void testPayViaFastBobPay() throws InterruptedException, ExecutionExc
eption, |
| 64 TimeoutException { | 77 TimeoutException { |
| 65 installPaymentApp(HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE); | 78 installPaymentApp(HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE); |
| 66 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); | 79 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); |
| 67 expectResultContains(new String[]{"true, true"}); | 80 expectResultContains(new String[] {"true, true"}); |
| 68 | 81 |
| 69 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); | 82 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); |
| 70 expectResultContains(new String[]{"true, QuotaExceededError"}); | 83 expectResultContains(new String[] {"true, QuotaExceededError"}); |
| 71 } | 84 } |
| 72 | 85 |
| 73 @MediumTest | 86 @MediumTest |
| 74 @Feature({"Payments"}) | 87 @Feature({"Payments"}) |
| 75 public void testPayViaSlowBobPay() throws InterruptedException, ExecutionExc
eption, | 88 public void testPayViaSlowBobPay() throws InterruptedException, ExecutionExc
eption, |
| 76 TimeoutException { | 89 TimeoutException { |
| 77 installPaymentApp(HAVE_INSTRUMENTS, DELAYED_RESPONSE); | 90 installPaymentApp(HAVE_INSTRUMENTS, DELAYED_RESPONSE); |
| 78 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); | 91 openPageAndClickBuyAndWait(mCanMakePaymentQueryResponded); |
| 79 expectResultContains(new String[]{"true, true"}); | 92 expectResultContains(new String[] {"true, true"}); |
| 80 | 93 |
| 81 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); | 94 clickNodeAndWait("otherBuy", mCanMakePaymentQueryResponded); |
| 82 expectResultContains(new String[]{"true, QuotaExceededError"}); | 95 expectResultContains(new String[] {"true, QuotaExceededError"}); |
| 83 } | 96 } |
| 84 } | 97 } |
| OLD | NEW |