no-secure-context.html (735B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/get-host-info.sub.js"></script> 6 <div id=log></div> 7 <script> 8 async_test(t => { 9 const frame = document.body.appendChild(document.createElement("iframe")); 10 t.add_cleanup(() => frame.remove()); 11 frame.src = get_host_info().HTTP_NOTSAMESITE_ORIGIN + new URL("resources/iframe.html", location).pathname; 12 window.onmessage = t.step_func_done(({ data }) => { 13 assert_equals(data, "success"); 14 }); 15 frame.onload = t.step_func(() => { 16 frame.contentWindow.postMessage("parent.postMessage('success', '*');", "*"); 17 }); 18 }, "COEP requires a secure context"); 19 </script>