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

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

Issue 1931233002: Implement PaymentRequestUpdateEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicit-shipping
Patch Set: Created 4 years, 8 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/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 8b1157e40a76c81b4195c1f2c93ac0fef145c6d6..03fa2675d82af849b6a85486144e51ef1febea8b 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
@@ -66,18 +66,26 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
}
protected void clickClosePaymentUIButton() throws InterruptedException {
- clickPaymentUIButton("close", R.id.close_button);
+ clickPaymentUIView("close button", R.id.close_button);
}
protected void clickSecondaryPaymentUIButton() throws InterruptedException {
- clickPaymentUIButton("secondary", R.id.editButton);
+ clickPaymentUIView("secondary button", R.id.editButton);
}
protected void clickPrimaryPaymentUIButton() throws InterruptedException {
- clickPaymentUIButton("primary", R.id.payButton);
+ clickPaymentUIView("primary button", R.id.payButton);
}
- private void clickPaymentUIButton(final String buttonName, final int resourceId)
+ protected void expandShippingAddressSection() throws InterruptedException {
+ clickPaymentUIView("shipping section", R.id.shippingSummaryLabel);
+ }
+
+ protected void selectOptionInExpandedSection() throws InterruptedException {
+ clickPaymentUIView("option line", R.id.paymentOptionLine);
+ }
+
+ private void clickPaymentUIView(final String viewName, final int resourceId)
throws InterruptedException {
CriteriaHelper.pollUiThread(new Criteria() {
@Override
@@ -91,13 +99,13 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
View button = dialog.findViewById(resourceId);
if (button == null) {
updateFailureReason(
- String.format("Cannot find the %s button on payment UI", buttonName));
+ String.format("Cannot find the %s on payment UI", viewName));
return false;
}
if (!button.isEnabled()) {
updateFailureReason(
- String.format("The %s button on payment UI is disabled", buttonName));
+ String.format("The %s on payment UI is disabled", viewName));
return false;
}

Powered by Google App Engine
This is Rietveld 408576698