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 11 matching lines...) Expand all Loading... |
22 public class PaymentRequestIncompleteContactDetailsTest extends PaymentRequestTe
stBase { | 22 public class PaymentRequestIncompleteContactDetailsTest extends PaymentRequestTe
stBase { |
23 public PaymentRequestIncompleteContactDetailsTest() { | 23 public PaymentRequestIncompleteContactDetailsTest() { |
24 // This merchant requests both a phone number and an email address. | 24 // This merchant requests both a phone number and an email address. |
25 super("payment_request_contact_details_test.html"); | 25 super("payment_request_contact_details_test.html"); |
26 } | 26 } |
27 | 27 |
28 @Override | 28 @Override |
29 public void onMainActivityStarted() | 29 public void onMainActivityStarted() |
30 throws InterruptedException, ExecutionException, TimeoutException { | 30 throws InterruptedException, ExecutionException, TimeoutException { |
31 AutofillTestHelper helper = new AutofillTestHelper(); | 31 AutofillTestHelper helper = new AutofillTestHelper(); |
32 // The user has an invalid phone number and an invalid email address on
disk. | 32 // The user has an invalid email address on disk. |
33 String billingAddressId = helper.setProfile(new AutofillProfile("", "htt
ps://example.com", | 33 String billingAddressId = helper.setProfile(new AutofillProfile("", "htt
ps://example.com", |
34 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "
", "90291", "", | 34 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "
", "90291", "", |
35 "US", "+++" /* invalid phone number */, "jon.doe" /* invalid ema
il address */, | 35 "US", "333-333-3333", "jon.doe" /* invalid email address */, "en
-US")); |
36 "en-US")); | |
37 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru
e, "Jon Doe", | 36 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru
e, "Jon Doe", |
38 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, | 37 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, |
39 billingAddressId)); | 38 billingAddressId)); |
40 } | 39 } |
41 | 40 |
42 /** Attempt to update the contact information with invalid data and cancel t
he transaction. */ | 41 /** Attempt to update the contact information with invalid data and cancel t
he transaction. */ |
43 @MediumTest | 42 @MediumTest |
44 public void testEditIncompleteContactAndCancel() | 43 public void testEditIncompleteContactAndCancel() |
45 throws InterruptedException, ExecutionException, TimeoutException { | 44 throws InterruptedException, ExecutionException, TimeoutException { |
46 triggerUIAndWait(mReadyForInput); | 45 triggerUIAndWait(mReadyForInput); |
(...skipping 15 matching lines...) Expand all Loading... |
62 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit
); | 61 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit
); |
63 setTextInEditorAndWait(new String[] {"555-555-5555", "jon.doe@google.com
"}, | 62 setTextInEditorAndWait(new String[] {"555-555-5555", "jon.doe@google.com
"}, |
64 mEditorTextUpdate); | 63 mEditorTextUpdate); |
65 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); | 64 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); |
66 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); | 65 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
67 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo
Unmask); | 66 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo
Unmask); |
68 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed
); | 67 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed
); |
69 expectResultContains(new String[] {"555-555-5555", "jon.doe@google.com"}
); | 68 expectResultContains(new String[] {"555-555-5555", "jon.doe@google.com"}
); |
70 } | 69 } |
71 } | 70 } |
OLD | NEW |