11cb0ef41Sopenharmony_ci<!doctype html> 21cb0ef41Sopenharmony_ci<html> 31cb0ef41Sopenharmony_ci<head> 41cb0ef41Sopenharmony_ci<meta charset=utf-8> 51cb0ef41Sopenharmony_ci<title></title> 61cb0ef41Sopenharmony_ci<script src=/resources/testharness.js></script> 71cb0ef41Sopenharmony_ci<script src=/resources/testharnessreport.js></script> 81cb0ef41Sopenharmony_ci</head> 91cb0ef41Sopenharmony_ci<body> 101cb0ef41Sopenharmony_ci<script> 111cb0ef41Sopenharmony_ci<!-- 121cb0ef41Sopenharmony_cipromise_test(t => { 131cb0ef41Sopenharmony_ci return new Promise((resolve) => { 141cb0ef41Sopenharmony_ci let ifr = document.createElement("iframe"); 151cb0ef41Sopenharmony_ci ifr.src = 161cb0ef41Sopenharmony_ci "data:text/html,<script> let bc = new BroadcastChannel(\"test\");" + 171cb0ef41Sopenharmony_ci "bc.onmessage = (e) => {" + 181cb0ef41Sopenharmony_ci " if (e.data == \"ping\") bc.postMessage('pong');"+ 191cb0ef41Sopenharmony_ci " else parent.postMessage({workerMessageOrigin: e.data, messageOrigin: e.origin}, \"*\"); };" + 201cb0ef41Sopenharmony_ci "new Worker(URL.createObjectURL(new Blob([\"" + 211cb0ef41Sopenharmony_ci "let bc2 = new BroadcastChannel('test'); bc2.postMessage('ping'); " + 221cb0ef41Sopenharmony_ci "bc2.onmessage = e => bc2.postMessage(e.origin);" + 231cb0ef41Sopenharmony_ci "\"], {type: 'text/javascript'}))); </script>"; 241cb0ef41Sopenharmony_ci window.addEventListener("message", t.step_func(e => { 251cb0ef41Sopenharmony_ci assert_equals(e.data.workerMessageOrigin, "null"); 261cb0ef41Sopenharmony_ci assert_equals(e.data.messageOrigin, "null"); 271cb0ef41Sopenharmony_ci resolve(); 281cb0ef41Sopenharmony_ci }), {once: true}); 291cb0ef41Sopenharmony_ci document.body.appendChild(ifr); 301cb0ef41Sopenharmony_ci }); 311cb0ef41Sopenharmony_ci}, "Opaque origin should be serialized to \"null\""); 321cb0ef41Sopenharmony_ci//--> 331cb0ef41Sopenharmony_ci</script> 341cb0ef41Sopenharmony_ci</body> 351cb0ef41Sopenharmony_ci</html> 36