PresentationRequest_sandboxing_success.https.html (1266B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Sandboxing: Creating a PresentationRequest from a nested context succeeds when allow-presentation is set</title> 4 <link rel="author" title="Francois Daoust" href="https://www.w3.org/People/#fd"> 5 <link rel="help" href="http://w3c.github.io/presentation-api/#constructing-a-presentationrequest"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script> 9 async_test(function (t) { 10 var startWhenReady = t.step_func(function (ev) { 11 var childFrame = document.getElementById('childFrame'); 12 if (ev.data === 'ready') { 13 window.removeEventListener('message', startWhenReady); 14 window.addEventListener('message', checkFinalMessage); 15 childFrame.contentWindow.postMessage('create', '*'); 16 } 17 }); 18 19 var checkFinalMessage = t.step_func_done(function (ev) { 20 assert_equals(ev.data, 'success', 'Presentation sandboxing did not work as expected.'); 21 }); 22 23 window.addEventListener('message', startWhenReady); 24 }); 25 </script> 26 <iframe id="childFrame" sandbox="allow-scripts allow-presentation" style="display:none" src="support/iframe.html"></iframe>