blob: 503f98213b9209b0af13f5d1b250aa03688dcff5 [file] [log] [blame]
<!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>