| Index: third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-allowed-by-container-policy.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-allowed-by-container-policy.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-allowed-by-container-policy.html
|
| index dfc991ce53fb34a84bff7d748d8c5b08ead3c3c2..d42fe66acef758956661b3b8c24ac8ea88ef9122 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-allowed-by-container-policy.html
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-allowed-by-container-policy.html
|
| @@ -1,13 +1,35 @@
|
| <!DOCTYPE html>
|
| <script src="../../resources/testharness.js"></script>
|
| <script src="../../resources/testharnessreport.js"></script>
|
| +<iframe allow="payment"></iframe>
|
| +<iframe allow="payment" allowpaymentrequest></iframe>
|
| <script>
|
| - if (window.testRunner) {
|
| - testRunner.dumpAsText();
|
| - testRunner.dumpChildFramesAsText();
|
| +var srcs = [
|
| + "resources/feature-policy-payment.html",
|
| + "http://localhost:8000/feature-policy/resources/feature-policy-payment.html"
|
| +];
|
| +
|
| +function loadFrame(iframe, src) {
|
| + var allowpaymentrequest = iframe.hasAttribute('allowpaymentrequest');
|
| + promise_test(function() {
|
| + iframe.src = src;
|
| + return new Promise(function(resolve, reject) {
|
| + window.addEventListener('message', function(e) {
|
| + resolve(e.data);
|
| + }, { once: true });
|
| + }).then(function(data) {
|
| + assert_true(data.enabled, 'Paymentrequest():');
|
| + });
|
| + }, 'Paymentrequest enabled by container policy on URL: ' + src +
|
| + ' with allowpaymentrequest = ' + allowpaymentrequest);
|
| +}
|
| +
|
| +window.onload = function() {
|
| + var iframes = document.getElementsByTagName('iframe');
|
| + for (var iframe of iframes) {
|
| + for (var src of srcs) {
|
| + loadFrame(iframe, src);
|
| + }
|
| }
|
| +}
|
| </script>
|
| -<iframe id="f1" src="resources/feature-policy-payment-enabled.html" allow="payment"></iframe>
|
| -<iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-policy-payment-enabled.html" allow="payment"></iframe>
|
| -<iframe id="f3" src="resources/feature-policy-payment-enabled.html" allowpaymentrequest allow="payment"></iframe>
|
| -<iframe id="f4" src="http://localhost:8000/feature-policy/resources/feature-policy-payment-enabled.html" allowpaymentrequest allow="payment"></iframe>
|
|
|