| 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.chrome.R; | 11 import org.chromium.chrome.R; |
| 11 import org.chromium.chrome.browser.autofill.AutofillTestHelper; | 12 import org.chromium.chrome.browser.autofill.AutofillTestHelper; |
| 12 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; | 13 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
| 13 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; | 14 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; |
| 14 | 15 |
| 15 import java.util.concurrent.ExecutionException; | 16 import java.util.concurrent.ExecutionException; |
| 16 import java.util.concurrent.TimeoutException; | 17 import java.util.concurrent.TimeoutException; |
| 17 | 18 |
| 18 /** | 19 /** |
| 19 * A test for using a server card in payments UI. | 20 * A test for using a server card in payments UI. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 31 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "
", "90291", "", | 32 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "
", "90291", "", |
| 32 "US", "310-310-6000", "jon.doe@gmail.com", "en-US")); | 33 "US", "310-310-6000", "jon.doe@gmail.com", "en-US")); |
| 33 helper.addServerCreditCard(new CreditCard("4754d21d-8773-40b6-b4be-5f748
6be834f", | 34 helper.addServerCreditCard(new CreditCard("4754d21d-8773-40b6-b4be-5f748
6be834f", |
| 34 "https://example.com", false /* isLocal */, true /* isCached */,
"Jon Doe", | 35 "https://example.com", false /* isLocal */, true /* isCached */,
"Jon Doe", |
| 35 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, | 36 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, |
| 36 billingAddressId, "" /* serverId */)); | 37 billingAddressId, "" /* serverId */)); |
| 37 } | 38 } |
| 38 | 39 |
| 39 /** Click [PAY] and dismiss the card unmask dialog. */ | 40 /** Click [PAY] and dismiss the card unmask dialog. */ |
| 40 @MediumTest | 41 @MediumTest |
| 42 @Feature({"Payments"}) |
| 41 public void testPayAndDontUnmask() throws InterruptedException, ExecutionExc
eption, | 43 public void testPayAndDontUnmask() throws InterruptedException, ExecutionExc
eption, |
| 42 TimeoutException { | 44 TimeoutException { |
| 43 triggerUIAndWait(mReadyToPay); | 45 triggerUIAndWait(mReadyToPay); |
| 44 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); | 46 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
| 45 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_NEGATIVE, mReadyToPa
y); | 47 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_NEGATIVE, mReadyToPa
y); |
| 46 clickAndWait(R.id.close_button, mDismissed); | 48 clickAndWait(R.id.close_button, mDismissed); |
| 47 expectResultContains(new String[] {"Request cancelled"}); | 49 expectResultContains(new String[] {"Request cancelled"}); |
| 48 } | 50 } |
| 49 } | 51 } |
| OLD | NEW |