| 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.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.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
| 11 import org.chromium.base.test.util.RetryOnFailure; | |
| 12 import org.chromium.chrome.R; | 11 import org.chromium.chrome.R; |
| 13 import org.chromium.chrome.browser.autofill.AutofillTestHelper; | 12 import org.chromium.chrome.browser.autofill.AutofillTestHelper; |
| 14 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; | 13 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
| 15 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; | 14 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; |
| 16 | 15 |
| 17 import java.util.concurrent.ExecutionException; | 16 import java.util.concurrent.ExecutionException; |
| 18 import java.util.concurrent.TimeoutException; | 17 import java.util.concurrent.TimeoutException; |
| 19 | 18 |
| 20 /** | 19 /** |
| 21 * A payment integration test for a merchant that requests payment via Bob Pay o
r cards. | 20 * A payment integration test for a merchant that requests payment via Bob Pay o
r cards. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 "4111111111111111", "", "12", "2050", "visa", R.drawable.pr_visa
, billingAddressId, | 40 "4111111111111111", "", "12", "2050", "visa", R.drawable.pr_visa
, billingAddressId, |
| 42 "" /* serverId */)); | 41 "" /* serverId */)); |
| 43 } | 42 } |
| 44 | 43 |
| 45 /** | 44 /** |
| 46 * If Bob Pay does not have any instruments, show [visa, mastercard]. Here t
he payment app | 45 * If Bob Pay does not have any instruments, show [visa, mastercard]. Here t
he payment app |
| 47 * responds quickly. | 46 * responds quickly. |
| 48 */ | 47 */ |
| 49 @MediumTest | 48 @MediumTest |
| 50 @Feature({"Payments"}) | 49 @Feature({"Payments"}) |
| 51 @RetryOnFailure | |
| 52 public void testNoInstrumentsInFastBobPay() throws InterruptedException, Exe
cutionException, | 50 public void testNoInstrumentsInFastBobPay() throws InterruptedException, Exe
cutionException, |
| 53 TimeoutException { | 51 TimeoutException { |
| 54 runTest(NO_INSTRUMENTS, IMMEDIATE_RESPONSE); | 52 runTest(NO_INSTRUMENTS, IMMEDIATE_RESPONSE); |
| 55 } | 53 } |
| 56 | 54 |
| 57 /** | 55 /** |
| 58 * If Bob Pay does not have any instruments, show [visa, mastercard]. Here t
he payment app | 56 * If Bob Pay does not have any instruments, show [visa, mastercard]. Here t
he payment app |
| 59 * responds slowly. | 57 * responds slowly. |
| 60 */ | 58 */ |
| 61 @MediumTest | 59 @MediumTest |
| 62 @Feature({"Payments"}) | 60 @Feature({"Payments"}) |
| 63 @RetryOnFailure | |
| 64 public void testNoInstrumentsInSlowBobPay() throws InterruptedException, Exe
cutionException, | 61 public void testNoInstrumentsInSlowBobPay() throws InterruptedException, Exe
cutionException, |
| 65 TimeoutException { | 62 TimeoutException { |
| 66 runTest(NO_INSTRUMENTS, DELAYED_RESPONSE); | 63 runTest(NO_INSTRUMENTS, DELAYED_RESPONSE); |
| 67 } | 64 } |
| 68 | 65 |
| 69 /** | 66 /** |
| 70 * If Bob Pay has instruments, show [bobpay, visa, mastercard]. Here the pay
ment app responds | 67 * If Bob Pay has instruments, show [bobpay, visa, mastercard]. Here the pay
ment app responds |
| 71 * quickly. | 68 * quickly. |
| 72 */ | 69 */ |
| 73 @MediumTest | 70 @MediumTest |
| 74 @Feature({"Payments"}) | 71 @Feature({"Payments"}) |
| 75 @RetryOnFailure | |
| 76 public void testHaveInstrumentsInFastBobPay() throws InterruptedException, E
xecutionException, | 72 public void testHaveInstrumentsInFastBobPay() throws InterruptedException, E
xecutionException, |
| 77 TimeoutException { | 73 TimeoutException { |
| 78 runTest(HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE); | 74 runTest(HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE); |
| 79 } | 75 } |
| 80 | 76 |
| 81 /** | 77 /** |
| 82 * If Bob Pay has instruments, show [bobpay, visa, mastercard]. Here the pay
ment app responds | 78 * If Bob Pay has instruments, show [bobpay, visa, mastercard]. Here the pay
ment app responds |
| 83 * slowly. | 79 * slowly. |
| 84 */ | 80 */ |
| 85 @MediumTest | 81 @MediumTest |
| (...skipping 28 matching lines...) Expand all Loading... |
| 114 expectResultContains(new String[]{"https://bobpay.com", "\"transacti
on\"", "1337"}); | 110 expectResultContains(new String[]{"https://bobpay.com", "\"transacti
on\"", "1337"}); |
| 115 } else { | 111 } else { |
| 116 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); | 112 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
| 117 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mRea
dyToUnmask); | 113 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mRea
dyToUnmask); |
| 118 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismi
ssed); | 114 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismi
ssed); |
| 119 expectResultContains(new String[] {"Jon Doe", "4111111111111111", "1
2", "2050", "visa", | 115 expectResultContains(new String[] {"Jon Doe", "4111111111111111", "1
2", "2050", "visa", |
| 120 "123"}); | 116 "123"}); |
| 121 } | 117 } |
| 122 } | 118 } |
| 123 } | 119 } |
| OLD | NEW |