Index: content/test/data/payments/payment_app_invocation.html |
diff --git a/content/test/data/payments/payment_app_invocation.html b/content/test/data/payments/payment_app_invocation.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..672992b46ac0426597e19f91a174de43f0631163 |
--- /dev/null |
+++ b/content/test/data/payments/payment_app_invocation.html |
@@ -0,0 +1,36 @@ |
+<!doctype html> |
+<title>Payment App: Test for invoking payment app</title> |
+<script src="./result_queue.js"></script> |
+<script> |
+ |
+function registerPaymentApp() { |
+ navigator.serviceWorker.register('payment_app.js', { scope: './' }) |
+ .then(() => { |
+ return navigator.serviceWorker.ready; |
+ }) |
+ .then(registration => { |
+ return registration.paymentAppManager.setManifest({ |
+ name: 'Payment App', |
+ icon: 'payment-app-icon', |
+ options: [{ |
+ name: 'Visa ****', |
+ icon: 'payment-app-icon', |
+ id: 'payment-app-id', |
+ enabledMethods: ['visa'] |
+ }] |
+ }); |
+ }) |
+ .then(result => { |
+ sendResultToTest('registered'); |
+ }) |
+ .catch(result => { |
+ sendResultToTest('error'); |
+ }); |
+} |
+ |
+var resultQueue = new ResultQueue(); |
+navigator.serviceWorker.addEventListener('message', e => { |
+ resultQueue.push(e.data); |
+}); |
+ |
+</script> |