| Index: third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-disabled.php
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-disabled.php b/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-disabled.php
|
| index 5e134e959e9babc311d9bd0592a0163245cb3e29..bc84db6200a93005964c398e90c952b5033b0d46 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-disabled.php
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-disabled.php
|
| @@ -12,13 +12,39 @@ Header("Feature-Policy: {\"payment\": []}");
|
| <!DOCTYPE html>
|
| <script src="../../resources/testharness.js"></script>
|
| <script src="../../resources/testharnessreport.js"></script>
|
| +<iframe></iframe>
|
| +<iframe 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_false(data.enabled, 'Paymentrequest():');
|
| + assert_equals(data.name, 'SecurityError', 'Exception Name:');
|
| + assert_equals(data.message, "Failed to construct 'PaymentRequest': " +
|
| + "Must be in a top-level browsing context or an iframe needs to " +
|
| + "specify 'allowpaymentrequest' explicitly", 'Error Message:');
|
| + });
|
| + }, 'Paymentrequest disabled 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-disabled.html"></iframe>
|
| -<iframe id="f2" src="http://localhost:8000/feature-policy/resources/feature-policy-payment-disabled.html"></iframe>
|
| -<iframe id="f3" src="resources/feature-policy-payment-disabled.html" allowpaymentrequest></iframe>
|
| -<iframe id="f4" src="http://localhost:8000/feature-policy/resources/feature-policy-payment-disabled.html" allowpaymentrequest></iframe>
|
|
|