OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <iframe allow="payment"></iframe> |
| 5 <iframe allow="payment" allowpaymentrequest></iframe> |
4 <script> | 6 <script> |
5 if (window.testRunner) { | 7 var srcs = [ |
6 testRunner.dumpAsText(); | 8 "resources/feature-policy-payment.html", |
7 testRunner.dumpChildFramesAsText(); | 9 "http://localhost:8000/feature-policy/resources/feature-policy-payment.html" |
| 10 ]; |
| 11 |
| 12 function loadFrame(iframe, src) { |
| 13 var allowpaymentrequest = iframe.hasAttribute('allowpaymentrequest'); |
| 14 promise_test(function() { |
| 15 iframe.src = src; |
| 16 return new Promise(function(resolve, reject) { |
| 17 window.addEventListener('message', function(e) { |
| 18 resolve(e.data); |
| 19 }, { once: true }); |
| 20 }).then(function(data) { |
| 21 assert_true(data.enabled, 'Paymentrequest():'); |
| 22 }); |
| 23 }, 'Paymentrequest enabled by container policy on URL: ' + src + |
| 24 ' with allowpaymentrequest = ' + allowpaymentrequest); |
| 25 } |
| 26 |
| 27 window.onload = function() { |
| 28 var iframes = document.getElementsByTagName('iframe'); |
| 29 for (var iframe of iframes) { |
| 30 for (var src of srcs) { |
| 31 loadFrame(iframe, src); |
| 32 } |
8 } | 33 } |
| 34 } |
9 </script> | 35 </script> |
10 <iframe id="f1" src="resources/feature-policy-payment-enabled.html" allow="payme
nt"></iframe> | |
11 <iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-poli
cy-payment-enabled.html" allow="payment"></iframe> | |
12 <iframe id="f3" src="resources/feature-policy-payment-enabled.html" allowpayment
request allow="payment"></iframe> | |
13 <iframe id="f4" src="http://localhost:8000/feature-policy/resources/feature-poli
cy-payment-enabled.html" allowpaymentrequest allow="payment"></iframe> | |
OLD | NEW |