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

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

Issue 2561373002: [Payment Request] Keep selection for edited item when canceling editors (Closed)
Patch Set: move id to xml Created 4 years 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/PaymentRequestPaymentAppAndCardsTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppAndCardsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppAndCardsTest.java
index 94d6b6b00d3fdd35f81b9da5b5e642eb3627b5c8..be0b9c9b972855a02895de168dc60a44a90ad3d2 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppAndCardsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppAndCardsTest.java
@@ -85,6 +85,40 @@ public class PaymentRequestPaymentAppAndCardsTest extends PaymentRequestTestBase
runTest(HAVE_INSTRUMENTS, DELAYED_RESPONSE);
}
+ /** Test that going into the editor and cancelling will leave the row checked. */
+ @MediumTest
+ @Feature({"Payments"})
+ public void testEditPaymentMethodAndCancelEditorShouldKeepCardSelected()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ triggerUIAndWait(mReadyToPay);
+ clickInPaymentMethodAndWait(R.id.payments_section, mReadyForInput);
+ expectPaymentMethodRowIsSelected(0);
+ clickInPaymentMethodAndWait(R.id.payments_add_option_button, mReadyToEdit);
+
+ // Cancel the editor.
+ clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
+
+ // Expect the existing row to still be selected in the Shipping Address section.
+ expectPaymentMethodRowIsSelected(0);
+ }
+
+ /** Test that going into "add" flow editor and cancelling will leave existing row checked. */
+ @MediumTest
+ @Feature({"Payments"})
+ public void testAddPaymentMethodAndCancelEditorShouldKeepExistingCardSelected()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ triggerUIAndWait(mReadyToPay);
+ clickInPaymentMethodAndWait(R.id.payments_section, mReadyForInput);
+ expectPaymentMethodRowIsSelected(0);
+ clickInPaymentMethodAndWait(R.id.payments_open_editor_pencil_button, mReadyToEdit);
+
+ // Cancel the editor.
+ clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
+
+ // Expect the row to still be selected in the Shipping Address section.
+ expectPaymentMethodRowIsSelected(0);
+ }
+
private void runTest(int instrumentPresence, int responseSpeed) throws InterruptedException,
ExecutionException, TimeoutException {
installPaymentApp(instrumentPresence, responseSpeed);

Powered by Google App Engine
This is Rietveld 408576698