c(e => {
      if (e.data == 'done') {
        assert_equals(events.length, 0);
        resolve();
      }
    }));
  });
}

promise_test(async t => {

  const bc0 = new BroadcastChannel('no-cross-origin-messages');
  bc0.onmessage = e => {window.events.push(e);};

  const testResults = testCompletion(t);
  const url = get_host_info().HTTPS_NOTSAMESITE_ORIGIN +
    '/webmessaging/broadcastchannel/resources/cross-origin.html';
  await with_iframe(url);

  return testResults;
}, "Messages aren't delivered acr