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

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

Issue 2867273003: PaymentHandler: Replace GetAllManifests() with GetAllPaymentApps(). (Closed)
Patch Set: rebased Created 3 years, 7 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/PaymentRequestServiceWorkerPaymentAppTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java
index 6a4b47572a2fcfa7f4faf338a54d1a1c4bc25862..3cec2d6e264f94069102586bce4c4ef9499a7c9f 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestServiceWorkerPaymentAppTest.java
@@ -9,7 +9,10 @@ import android.support.test.filters.MediumTest;
import org.chromium.base.test.util.Feature;
import org.chromium.content_public.browser.WebContents;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
@@ -43,33 +46,26 @@ public class PaymentRequestServiceWorkerPaymentAppTest extends PaymentRequestTes
@Override
public void create(WebContents webContents, Set<String> methodNames,
PaymentAppFactory.PaymentAppCreatedCallback callback) {
- ServiceWorkerPaymentAppBridge.Manifest testManifest =
- new ServiceWorkerPaymentAppBridge.Manifest();
- testManifest.registrationId = 0;
- testManifest.label = "BobPay";
+ List<PaymentInstrument> instruments = new ArrayList<PaymentInstrument>();
if (instrumentPresence != NO_OPTIONS) {
- ServiceWorkerPaymentAppBridge.Option testOption =
- new ServiceWorkerPaymentAppBridge.Option();
- testOption.id = "new";
- testOption.label = "Create BobPay account";
- testOption.enabledMethods =
- Arrays.asList("https://bobpay.com", "basic-card");
- testManifest.options.add(testOption);
+ instruments.add(new ServiceWorkerPaymentInstrument(webContents,
+ 0 /* swRegistrationId */, "new" /* instrumentId */,
+ "Create BobPay account" /* label */,
+ new HashSet<String>(Arrays.asList("https://bobpay.com",
+ "basic-card")) /* methodNames */));
}
if (instrumentPresence == TWO_OPTIONS) {
- ServiceWorkerPaymentAppBridge.Option testOption =
- new ServiceWorkerPaymentAppBridge.Option();
- testOption.id = "existing";
- testOption.label = "Existing BobPay account";
- testOption.enabledMethods =
- Arrays.asList("https://bobpay.com", "basic-card");
- testManifest.options.add(testOption);
+ instruments.add(new ServiceWorkerPaymentInstrument(webContents,
+ 0 /* swRegistrationId */, "existing" /* instrumentId */,
+ "Existing BobPay account" /* label */,
+ new HashSet<String>(Arrays.asList("https://bobpay.com",
+ "basic-card")) /* methodNames */));
}
callback.onPaymentAppCreated(
- new ServiceWorkerPaymentApp(webContents, testManifest));
+ new ServiceWorkerPaymentApp(webContents, instruments));
callback.onAllPaymentAppsCreated();
}
});

Powered by Google App Engine
This is Rietveld 408576698