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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.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/PaymentRequestShippingAddressTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.java
index 7776ede9384c706b6d7eff22eb9659906613bde4..b82b016a7683a55aa5abc4f86edd76d082b13845 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.java
@@ -113,4 +113,38 @@ public class PaymentRequestShippingAddressTest extends PaymentRequestTestBase {
assertTrue(getShippingAddressOptionRowAtIndex(0).getLabelText().toString().equals(
"Seb Doe\nGoogle, 340 Main St, Los Angeles, CA 90291\n555-555-5555"));
}
+
+ /** Test that going into the editor and cancelling will leave the row checked. */
+ @MediumTest
+ @Feature({"Payments"})
+ public void testEditShippingAddressAndCancelEditorShouldKeepAddressSelected()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ triggerUIAndWait(mReadyToPay);
+ clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput);
+ expectShippingAddressRowIsSelected(0);
+ clickInShippingAddressAndWait(R.id.payments_open_editor_pencil_button, mReadyToEdit);
+
+ // Cancel the editor.
+ clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
+
+ // Expect the row to still be selected in the Shipping Address section.
+ expectShippingAddressRowIsSelected(0);
+ }
+
+ /** Test that going into the "add" flow and cancelling will leave the existing row checked. */
+ @MediumTest
+ @Feature({"Payments"})
+ public void testAddShippingAddressAndCancelEditorShouldKeepAddressSelected()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ triggerUIAndWait(mReadyToPay);
+ clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput);
+ expectShippingAddressRowIsSelected(0);
+ clickInShippingAddressAndWait(R.id.payments_add_option_button, mReadyToEdit);
+
+ // Cancel the editor.
+ clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
+
+ // Expect the existing row to still be selected in the Shipping Address section.
+ expectShippingAddressRowIsSelected(0);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698