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

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

Issue 2120973002: [Payments] Show complete profiles first and limit to 4 suggestions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the null return value Created 4 years, 5 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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMultipleContactDetailsTest.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 a117f225ee5949f187331eee87f027620e040b90..a38ca770f91ddf814749563d67163e9477ce5c00 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
@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.autofill.CardUnmaskPrompt;
import org.chromium.chrome.browser.autofill.CardUnmaskPrompt.CardUnmaskObserverForTest;
import org.chromium.chrome.browser.payments.PaymentRequestImpl.PaymentRequestServiceObserverForTest;
import org.chromium.chrome.browser.payments.ui.EditorTextField;
+import org.chromium.chrome.browser.payments.ui.PaymentRequestSection.OptionSection;
import org.chromium.chrome.browser.payments.ui.PaymentRequestUI;
import org.chromium.chrome.browser.payments.ui.PaymentRequestUI.PaymentRequestObserverForTest;
import org.chromium.chrome.test.ChromeActivityTestCaseBase;
@@ -206,6 +207,66 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
});
}
+ /**
+ * Returns the label corresponding to the contact detail suggestion at the specified
+ * |suggestionIndex|.
+ */
+ protected String getContactDetailsSuggestionLabel(final int suggestionIndex)
+ throws ExecutionException {
+ assert (suggestionIndex < getNumberOfContactDetailSuggestions());
+
+ return ThreadUtils.runOnUiThreadBlocking(new Callable<String>() {
+ @Override
+ public String call() {
+ return ((OptionSection) mUI.getContactDetailsSectionForTest())
+ .getOptionLabelsForTest(suggestionIndex).getText().toString();
+ }
+ });
+ }
+
+ /**
+ * Returns the the number of contact detail suggestions,
+ */
+ protected int getNumberOfContactDetailSuggestions() throws ExecutionException {
+ return ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() {
+ @Override
+ public Integer call() {
+ return ((OptionSection) mUI.getContactDetailsSectionForTest())
+ .getNumberOfOptionLabelsForTest();
+ }
+ });
+ }
+
+ /**
+ * Returns the label corresponding to the shipping address suggestion at the specified
+ * |suggestionIndex|.
+ */
+ protected String getShippingAddressSuggestionLabel(final int suggestionIndex)
+ throws ExecutionException {
+ assert (suggestionIndex < getNumberOfShippingAddressSuggestions());
+
+ return ThreadUtils.runOnUiThreadBlocking(new Callable<String>() {
+ @Override
+ public String call() {
+ return ((OptionSection) mUI.getShippingAddressSectionForTest())
+ .getOptionLabelsForTest(suggestionIndex).getText().toString();
+ }
+ });
+ }
+
+ /**
+ * Returns the the number of shipping address suggestions,
+ */
+ protected int getNumberOfShippingAddressSuggestions() throws ExecutionException {
+ return ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() {
+ @Override
+ public Integer call() {
+ return ((OptionSection) mUI.getShippingAddressSectionForTest())
+ .getNumberOfOptionLabelsForTest();
+ }
+ });
+ }
+
/** Selects the spinner value in the editor UI. */
protected void setSpinnerSelectionInEditor(final int selection, CallbackHelper helper)
throws InterruptedException, TimeoutException {
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestMultipleContactDetailsTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698