| <!DOCTYPE html> |
| <meta charset=utf-8> |
| <link rel="help" href="https://html.spec.whatwg.org/multipage/comms.html#messageevent"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script> |
| |
| async_test(t => { |
| function workerCode() { |
| close(); |
| var mc = new MessageChannel(); |
| mc.port1.postMessage(42); |
| mc.port2.postMessage(42); |
| postMessage(true); |
| } |
| |
| var workerBlob = new Blob([workerCode.toString() + ";workerCode();"], {type:"application/javascript"}); |
| |
| var w = new Worker(URL.createObjectURL(workerBlob)); |
| w.onmessage = function(e) { |
| assert_true(e.data, "MessageChannel created on worker shutdown."); |
| t.done(); |
| } |
| }, 'MessageChannel/MessagePort created and used after a worker self.close()'); |
| |
| </script> |