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.chrome.R; | 10 import org.chromium.chrome.R; |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 @Override | 26 @Override |
27 public void onMainActivityStarted() | 27 public void onMainActivityStarted() |
28 throws InterruptedException, ExecutionException, TimeoutException { | 28 throws InterruptedException, ExecutionException, TimeoutException { |
29 AutofillTestHelper helper = new AutofillTestHelper(); | 29 AutofillTestHelper helper = new AutofillTestHelper(); |
30 String billingAddressId = helper.setProfile(new AutofillProfile("", "htt
ps://example.com", | 30 String billingAddressId = helper.setProfile(new AutofillProfile("", "htt
ps://example.com", |
31 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "
", "90291", "", | 31 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "
", "90291", "", |
32 "US", "310-310-6000", "jon.doe@gmail.com", "en-US")); | 32 "US", "310-310-6000", "jon.doe@gmail.com", "en-US")); |
33 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru
e, "Jon Doe", | 33 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru
e, "Jon Doe", |
34 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, | 34 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, |
35 billingAddressId)); | 35 billingAddressId, "" /* serverId */)); |
36 } | 36 } |
37 | 37 |
38 @MediumTest | 38 @MediumTest |
39 public void testPay() throws InterruptedException, ExecutionException, Timeo
utException { | 39 public void testPay() throws InterruptedException, ExecutionException, Timeo
utException { |
40 triggerUIAndWait(mReadyToPay); | 40 triggerUIAndWait(mReadyToPay); |
41 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); | 41 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
42 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo
Unmask); | 42 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo
Unmask); |
43 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mResultRea
dy); | 43 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mResultRea
dy); |
44 clickAndWait(R.id.ok_button, mDismissed); | 44 clickAndWait(R.id.ok_button, mDismissed); |
45 expectResultContains(new String[] {"Transaction failed"}); | 45 expectResultContains(new String[] {"Transaction failed"}); |
46 } | 46 } |
47 } | 47 } |
OLD | NEW |