gecko/dom/base/test/iframe_messageChannel_cloning.html
Steve Fink 03f42f68f4 Bug 912456 - transferable MessagePorts, r=jorendorff
--HG--
extra : rebase_source : 5b8a2a9b261c53f0ff5a860e1dc2e7ede711105f
2013-11-14 20:42:34 -08:00

23 lines
541 B
HTML

<!DOCTYPE HTML>
<html>
<body>
<script type="application/javascript">
function ok(a, msg) {
window.parent.postMessage({ status: a ? "OK" : "KO", message: msg }, "*");
}
window.addEventListener('message', receiveMessage, false);
function receiveMessage(evt) {
ok (evt.data, "Data received");
ok (evt.data.port instanceof MessagePort, "Data contains a MessagePort");
var a = new MessageChannel();
window.parent.postMessage({ status: "FINISH", port: a.port2 }, '*', [a.port2]);
}
</script>
</body>
</html>