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

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

Issue 2189563002: Use server ID to identify server cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServerCardTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFailCompleteTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServerCardTest.java
similarity index 61%
copy from chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFailCompleteTest.java
copy to chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServerCardTest.java
index 2b0a25cef9854cacff2e8eb40d3ca70a5836e69e..225238119182f5c56427fc9111248dc7c8745126 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFailCompleteTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServerCardTest.java
@@ -16,11 +16,11 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
/**
- * A payment integration test for a merchant that always fails to complete the transaction.
+ * A test for using a server card in payments UI.
*/
-public class PaymentRequestFailCompleteTest extends PaymentRequestTestBase {
- public PaymentRequestFailCompleteTest() {
- super("payment_request_fail_complete_test.html");
+public class PaymentRequestServerCardTest extends PaymentRequestTestBase {
+ public PaymentRequestServerCardTest() {
+ super("payment_request_no_shipping_test.html");
}
@Override
@@ -30,18 +30,20 @@ public class PaymentRequestFailCompleteTest extends PaymentRequestTestBase {
String billingAddressId = helper.setProfile(new AutofillProfile("", "https://example.com",
true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "", "90291", "",
"US", "310-310-6000", "jon.doe@gmail.com", "en-US"));
- helper.setCreditCard(new CreditCard("", "https://example.com", true, true, "Jon Doe",
+ helper.addServerCreditCard(new CreditCard("4754d21d-8773-40b6-b4be-5f7486be834f",
+ "https://example.com", false /* isLocal */, true /* isCached */, "Jon Doe",
"4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_visa,
- billingAddressId));
+ billingAddressId, "" /* serverId */));
}
+ /** Click [PAY] and dismiss the card unmask dialog. */
@MediumTest
- public void testPay() throws InterruptedException, ExecutionException, TimeoutException {
+ public void testPayAndDontUnmask() throws InterruptedException, ExecutionException,
+ TimeoutException {
triggerUIAndWait(mReadyToPay);
clickAndWait(R.id.button_primary, mReadyForUnmaskInput);
- setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyToUnmask);
- clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mResultReady);
- clickAndWait(R.id.ok_button, mDismissed);
- expectResultContains(new String[] {"Transaction failed"});
+ clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_NEGATIVE, mReadyToPay);
+ clickAndWait(R.id.close_button, mDismissed);
+ expectResultContains(new String[] {"Request cancelled"});
}
}

Powered by Google App Engine
This is Rietveld 408576698