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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPayerInfoDetailsTest.java

Issue 2393113003: test:
Patch Set: test: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPayerInfoDetailsTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPayerInfoDetailsTest.java
similarity index 70%
rename from chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java
rename to chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPayerInfoDetailsTest.java
index 4cbd12985dba0fb77182c7ace11daeb08cb14dab..66009abc45fd4e604001220e5ec489d522bd694f 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPayerInfoDetailsTest.java
@@ -19,19 +19,19 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
/**
- * A payment integration test for a merchant that requests contact details.
+ * A payment integration test for a merchant that requests payer information details.
*/
-public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
- public PaymentRequestContactDetailsTest() {
- // The merchant requests both a phone number and an email address.
- super("payment_request_contact_details_test.html");
+public class PaymentRequestPayerInfoDetailsTest extends PaymentRequestTestBase {
+ public PaymentRequestPayerInfoDetailsTest() {
+ // The merchant requests payer information.
+ super("payment_request_payer_info_details_test.html");
}
@Override
public void onMainActivityStarted()
throws InterruptedException, ExecutionException, TimeoutException {
AutofillTestHelper helper = new AutofillTestHelper();
- // The user has valid phone number and email address on disk.
+ // The user has valid payer name, phone number and email address on disk.
String billingAddressId = helper.setProfile(new AutofillProfile("", "https://example.com",
true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "", "90291", "",
"US", "555-555-5555", "jon.doe@google.com", "en-US"));
@@ -40,7 +40,7 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
billingAddressId, "" /* serverId */));
}
- /** Provide the existing valid phone number and email address to the merchant. */
+ /** Provide the existing valid payer name, phone number and email address to the merchant. */
@MediumTest
@Feature({"Payments"})
public void testPay() throws InterruptedException, ExecutionException, TimeoutException {
@@ -48,55 +48,55 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
clickAndWait(R.id.button_primary, mReadyForUnmaskInput);
setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyToUnmask);
clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed);
- expectResultContains(new String[] {"555-555-5555", "jon.doe@google.com"});
+ expectResultContains(new String[] {"Jon Doe", "555-555-5555", "jon.doe@google.com"});
}
- /** Attempt to add invalid phone number and email address and cancel the transaction. */
+ /** Attempt to add invalid payer information and cancel the transaction. */
@MediumTest
@Feature({"Payments"})
- public void testAddInvalidContactAndCancel()
+ public void testAddInvalidPayerInfoAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyToPay);
- clickInContactInfoAndWait(R.id.payments_section, mReadyForInput);
- clickInContactInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
- setTextInEditorAndWait(new String[] {"+++", "jane.jones"}, mEditorTextUpdate);
+ clickInPayerInfoAndWait(R.id.payments_section, mReadyForInput);
+ clickInPayerInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
+ setTextInEditorAndWait(new String[] {"", "+++", "jane.jones"}, mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
- /** Add new phone number and email address and provide that to the merchant. */
+ /** Add new payer name, phone number and email address and provide that to the merchant. */
@MediumTest
@Feature({"Payments"})
- public void testAddContactAndPay()
+ public void testAddPayerInfoAndPay()
throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyToPay);
- clickInContactInfoAndWait(R.id.payments_section, mReadyForInput);
- clickInContactInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
- setTextInEditorAndWait(new String[] {"999-999-9999", "jane.jones@google.com"},
+ clickInPayerInfoAndWait(R.id.payments_section, mReadyForInput);
+ clickInPayerInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
+ setTextInEditorAndWait(new String[] {"Jane Jones", "999-999-9999", "jane.jones@google.com"},
mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToPay);
clickAndWait(R.id.button_primary, mReadyForUnmaskInput);
setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyToUnmask);
clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed);
- expectResultContains(new String[] {"999-999-9999", "jane.jones@google.com"});
+ expectResultContains(new String[] {"Jane Jones", "999-999-9999", "jane.jones@google.com"});
}
- /** Quickly pressing on "add contact info" and then [X] should not crash. */
+ /** Quickly pressing on "add payer info" and then [X] should not crash. */
@MediumTest
@Feature({"Payments"})
- public void testQuickAddContactAndCloseShouldNotCrash()
+ public void testQuickAddPayerInfoAndCloseShouldNotCrash()
throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyToPay);
- clickInContactInfoAndWait(R.id.payments_section, mReadyForInput);
+ clickInPayerInfoAndWait(R.id.payments_section, mReadyForInput);
- // Quickly press on "add contact info" and then [X].
+ // Quickly press on "add payer info" and then [X].
int callCount = mReadyToEdit.getCallCount();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- mUI.getContactDetailsSectionForTest().findViewById(
+ mUI.getPayerInfoDetailsSectionForTest().findViewById(
R.id.payments_add_option_button).performClick();
mUI.getDialogForTest().findViewById(R.id.close_button).performClick();
}
@@ -108,21 +108,21 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
expectResultContains(new String[] {"Request cancelled"});
}
- /** Quickly pressing on [X] and then "add contact info" should not crash. */
+ /** Quickly pressing on [X] and then "add payer info" should not crash. */
@MediumTest
@Feature({"Payments"})
- public void testQuickCloseAndAddContactShouldNotCrash()
+ public void testQuickCloseAndAddPayerInfoShouldNotCrash()
throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyToPay);
- clickInContactInfoAndWait(R.id.payments_section, mReadyForInput);
+ clickInPayerInfoAndWait(R.id.payments_section, mReadyForInput);
- // Quickly press on [X] and then "add contact info."
+ // Quickly press on [X] and then "add payer info."
int callCount = mDismissed.getCallCount();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
mUI.getDialogForTest().findViewById(R.id.close_button).performClick();
- mUI.getContactDetailsSectionForTest().findViewById(
+ mUI.getPayerInfoDetailsSectionForTest().findViewById(
R.id.payments_add_option_button).performClick();
}
});
@@ -131,20 +131,20 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
expectResultContains(new String[] {"Request cancelled"});
}
- /** Quickly pressing on "add contact info" and then "cancel" should not crash. */
+ /** Quickly pressing on "add payer info" and then "cancel" should not crash. */
@MediumTest
@Feature({"Payments"})
- public void testQuickAddContactAndCancelShouldNotCrash()
+ public void testQuickAddPayerInfoAndCancelShouldNotCrash()
throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyToPay);
- clickInContactInfoAndWait(R.id.payments_section, mReadyForInput);
+ clickInPayerInfoAndWait(R.id.payments_section, mReadyForInput);
- // Quickly press on "add contact info" and then "cancel."
+ // Quickly press on "add payer info" and then "cancel."
int callCount = mReadyToEdit.getCallCount();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- mUI.getContactDetailsSectionForTest().findViewById(
+ mUI.getPayerInfoDetailsSectionForTest().findViewById(
R.id.payments_add_option_button).performClick();
mUI.getDialogForTest().findViewById(R.id.button_secondary).performClick();
}
@@ -156,21 +156,21 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
expectResultContains(new String[] {"Request cancelled"});
}
- /** Quickly pressing on "cancel" and then "add contact info" should not crash. */
+ /** Quickly pressing on "cancel" and then "add payer info" should not crash. */
@MediumTest
@Feature({"Payments"})
- public void testQuickCancelAndAddContactShouldNotCrash()
+ public void testQuickCancelAndAddPayerInfoShouldNotCrash()
throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyToPay);
- clickInContactInfoAndWait(R.id.payments_section, mReadyForInput);
+ clickInPayerInfoAndWait(R.id.payments_section, mReadyForInput);
- // Quickly press on "cancel" and then "add contact info."
+ // Quickly press on "cancel" and then "add payer info."
int callCount = mDismissed.getCallCount();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
mUI.getDialogForTest().findViewById(R.id.button_secondary).performClick();
- mUI.getContactDetailsSectionForTest().findViewById(
+ mUI.getPayerInfoDetailsSectionForTest().findViewById(
R.id.payments_add_option_button).performClick();
}
});

Powered by Google App Engine
This is Rietveld 408576698