| <!DOCTYPE html> |
| <html> |
| <body> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <iframe sandbox="allow-scripts allow-same-origin"></iframe> |
| <script> |
| |
| var iframe = document.querySelector('iframe'); |
| |
| async_test(t => { |
| iframe.onload = t.step_func(() => { |
| iframe.contentWindow.postMessage('create', '*'); |
| }); |
| |
| window.addEventListener('message', t.step_func_done(e => { |
| assert_equals(e.data, 'SecurityError'); |
| })); |
| |
| // Navigate the iframe |
| iframe.src = 'resources/iframe-sandbox.html'; |
| }, "Test that creating PresentationRequest throws SecurityError if 'allow-presentation' keyword is missing on a sandboxed iframe."); |
| |
| </script> |
| </body> |
| </html> |