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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.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/PaymentRequestContactDetailsTest.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/PaymentRequestContactDetailsTest.java
index 0d248749d259617d6d804b659875dd85fa4b0424..5c243dc5794749426ca0ff1fd97d0bfb0dcbf22e 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java
@@ -131,6 +131,40 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
expectResultContains(new String[] {"Request cancelled"});
}
+ /** Test that going into the editor and cancelling will leave the row checked. */
+ @MediumTest
+ @Feature({"Payments"})
+ public void testEditContactAndCancelEditorShouldKeepContactSelected()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ triggerUIAndWait(mReadyToPay);
+ clickInContactInfoAndWait(R.id.payments_section, mReadyForInput);
+ expectContactDetailsRowIsSelected(0);
+ clickInContactInfoAndWait(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 Contact Details section.
+ expectContactDetailsRowIsSelected(0);
+ }
+
+ /** Test that going into the "add" flow and cancelling will leave existing row checked. */
+ @MediumTest
+ @Feature({"Payments"})
+ public void testAddContactAndCancelEditorShouldKeepContactSelected()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ triggerUIAndWait(mReadyToPay);
+ clickInContactInfoAndWait(R.id.payments_section, mReadyForInput);
+ expectContactDetailsRowIsSelected(0);
+ clickInContactInfoAndWait(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 Contact Details section.
+ expectContactDetailsRowIsSelected(0);
+ }
+
/** Quickly pressing on "add contact info" and then "cancel" should not crash. */
@MediumTest
@Feature({"Payments"})

Powered by Google App Engine
This is Rietveld 408576698