startNewPresentation_sandboxing_success-manual.https.html (1428B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Sandboxing: starting a presentation 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/#dom-presentationrequest-start"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 9 <iframe id="childFrame" sandbox="allow-scripts allow-presentation" style="display:none" src="support/iframe.html"></iframe> 10 <p>Click the button below to start the manual test. If prompted to select a device, please dismiss the dialog box. The test passes if a "PASS" result appears.</p> 11 <button id="presentBtn" onclick="startPresentationTest()">Start Presentation Test</button> 12 13 <script> 14 setup({explicit_timeout: true}); 15 16 var presentBtn = document.getElementById('presentBtn'); 17 var childFrame = document.getElementById('childFrame'); 18 19 function startPresentationTest() { 20 presentBtn.disabled = true; 21 async_test(function (t) { 22 childFrame.contentWindow.postMessage('start', '*'); 23 window.addEventListener('message', t.step_func(function (ev) { 24 assert_equals(ev.data, 'success', 25 'Presentation could not be started from nested frame.'); 26 t.done(); 27 })); 28 }); 29 } 30 </script>