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.support.test.filters.MediumTest; | 8 import android.support.test.filters.MediumTest; |
9 | 9 |
10 import org.chromium.base.ThreadUtils; | 10 import org.chromium.base.ThreadUtils; |
(...skipping 30 matching lines...) Expand all Loading... |
41 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, | 41 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, |
42 billingAddressId, "" /* serverId */)); | 42 billingAddressId, "" /* serverId */)); |
43 } | 43 } |
44 | 44 |
45 /** The shipping address should not be selected in UI by default. */ | 45 /** The shipping address should not be selected in UI by default. */ |
46 @MediumTest | 46 @MediumTest |
47 @Feature({"Payments"}) | 47 @Feature({"Payments"}) |
48 public void testAddressNotSelected() | 48 public void testAddressNotSelected() |
49 throws InterruptedException, ExecutionException, TimeoutException { | 49 throws InterruptedException, ExecutionException, TimeoutException { |
50 triggerUIAndWait(mReadyForInput); | 50 triggerUIAndWait(mReadyForInput); |
51 assertEquals(PaymentRequestSection.EDIT_BUTTON_SELECT, getSummarySection
ButtonState()); | 51 assertEquals(PaymentRequestSection.EDIT_BUTTON_CHOOSE, getSummarySection
ButtonState()); |
52 } | 52 } |
53 | 53 |
54 /** Expand the shipping address section, select an address, and click "Pay."
*/ | 54 /** Expand the shipping address section, select an address, and click "Pay."
*/ |
55 @MediumTest | 55 @MediumTest |
56 @Feature({"Payments"}) | 56 @Feature({"Payments"}) |
57 public void testSelectValidAddressAndPay() | 57 public void testSelectValidAddressAndPay() |
58 throws InterruptedException, ExecutionException, TimeoutException { | 58 throws InterruptedException, ExecutionException, TimeoutException { |
59 triggerUIAndWait(mReadyForInput); | 59 triggerUIAndWait(mReadyForInput); |
60 // Check that there is a selected payment method (makes sure we are not
ready to pay because | 60 // Check that there is a selected payment method (makes sure we are not
ready to pay because |
61 // of the Shipping Address). | 61 // of the Shipping Address). |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 mUI.getDialogForTest().findViewById(R.id.button_secondary).perfo
rmClick(); | 250 mUI.getDialogForTest().findViewById(R.id.button_secondary).perfo
rmClick(); |
251 mUI.getShippingAddressSectionForTest().findViewById( | 251 mUI.getShippingAddressSectionForTest().findViewById( |
252 R.id.payments_add_option_button).performClick(); | 252 R.id.payments_add_option_button).performClick(); |
253 } | 253 } |
254 }); | 254 }); |
255 mDismissed.waitForCallback(callCount); | 255 mDismissed.waitForCallback(callCount); |
256 | 256 |
257 expectResultContains(new String[] {"Request cancelled"}); | 257 expectResultContains(new String[] {"Request cancelled"}); |
258 } | 258 } |
259 } | 259 } |
OLD | NEW |