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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java
index d2f1ea496bbd0ac26f0ff7c8b273ba4f9decce24..7612cd0b4af5a29bd3cba6223448630061d8d807 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java
@@ -321,7 +321,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT
});
}
- /** Returns the the number of payment instruments. */
+ /** Returns the number of payment instruments. */
protected int getNumberOfPaymentInstruments() throws ExecutionException {
return ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() {
@Override
@@ -332,7 +332,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT
});
}
- /** Returns the the number of contact detail suggestions. */
+ /** Returns the number of contact detail suggestions. */
protected int getNumberOfContactDetailSuggestions() throws ExecutionException {
return ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() {
@Override
@@ -595,6 +595,57 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT
});
}
+ /** Will fail if the OptionRow at |index| is not selected in Contact Details.*/
+ protected void expectContactDetailsRowIsSelected(final int index)
+ throws ExecutionException, InterruptedException {
+ CriteriaHelper.pollInstrumentationThread(new Criteria() {
+ @Override
+ public boolean isSatisfied() {
+ boolean isSelected = ((OptionSection) mUI.getContactDetailsSectionForTest())
+ .getOptionRowAtIndex(index)
+ .isChecked();
+ if (!isSelected) {
+ updateFailureReason("Contact Details row at " + index + " was not selected.");
+ }
+ return isSelected;
+ }
+ });
+ }
+
+ /** Will fail if the OptionRow at |index| is not selected in Shipping Address section.*/
+ protected void expectShippingAddressRowIsSelected(final int index)
+ throws ExecutionException, InterruptedException {
+ CriteriaHelper.pollInstrumentationThread(new Criteria() {
+ @Override
+ public boolean isSatisfied() {
+ boolean isSelected = ((OptionSection) mUI.getShippingAddressSectionForTest())
+ .getOptionRowAtIndex(index)
+ .isChecked();
+ if (!isSelected) {
+ updateFailureReason("Shipping Address row at " + index + " was not selected.");
+ }
+ return isSelected;
+ }
+ });
+ }
+
+ /** Will fail if the OptionRow at |index| is not selected in PaymentMethod section.*/
+ protected void expectPaymentMethodRowIsSelected(final int index)
+ throws ExecutionException, InterruptedException {
+ CriteriaHelper.pollInstrumentationThread(new Criteria() {
+ @Override
+ public boolean isSatisfied() {
+ boolean isSelected = ((OptionSection) mUI.getPaymentMethodSectionForTest())
+ .getOptionRowAtIndex(index)
+ .isChecked();
+ if (!isSelected) {
+ updateFailureReason("Payment Method row at " + index + " was not selected.");
+ }
+ return isSelected;
+ }
+ });
+ }
+
@Override
public void onPaymentRequestReadyForInput(PaymentRequestUI ui) {
ThreadUtils.assertOnUiThread();
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698