Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestIncompleteContactDetailsTest.java

Issue 2116583002: Credit card editor for PaymentRequest UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failing test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698