<!DOCTYPE html>
<script src="../include.js"></script>
<script>
    asyncTest(done => {
        let channel = new MessageChannel();

        const port1Logs = [];
        const port2Logs = [];
        const port3Logs = [];

        channel.port1.onmessage = (event) => {
            port1Logs.push("Port1: " + JSON.stringify(event.data));
            if (event.ports.length > 0) {
                event.ports[0].postMessage("Hello from the transferred port");
                return;
            }
            cha