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

Unified Diff: content/test/data/payments/payment_app.js

Issue 2887713002: PaymentHandler: Merge PaymentAppRequest and PaymentRequestEvent. (Closed)
Patch Set: rebase 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: content/test/data/payments/payment_app.js
diff --git a/content/test/data/payments/payment_app.js b/content/test/data/payments/payment_app.js
index ce0246420a7d16d230adb2c358fdc5a69ff162b9..f6b2d38b3b58a6d59de45e71dc583df7eba156de 100644
--- a/content/test/data/payments/payment_app.js
+++ b/content/test/data/payments/payment_app.js
@@ -3,6 +3,20 @@
// found in the LICENSE file.
self.addEventListener('paymentrequest', e => {
+ e.waitUntil(clients.matchAll({includeUncontrolled: true}).then(clients => {
+ clients.forEach(client => {
+ if (client.url.indexOf('payment_app_invocation.html') != -1) {
+ client.postMessage(e.topLevelOrigin);
+ client.postMessage(e.paymentRequestOrigin);
+ client.postMessage(e.paymentRequestId);
+ client.postMessage(JSON.stringify(e.methodData));
+ client.postMessage(JSON.stringify(e.total));
+ client.postMessage(JSON.stringify(e.modifiers));
+ client.postMessage(e.instrumentKey);
+ }
+ });
+ }));
+
// SW -------------------- openWindow() ------------------> payment_app_window
// SW <----- postMessage('payment_app_window_ready') ------ payment_app_window
// SW -------- postMessage('payment_app_request') --------> payment_app_window

Powered by Google App Engine
This is Rietveld 408576698