<!DOCTYPE html>
<title>DedicatedWorker: new Worker()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
let worker;

// Creates a new dedicated worker for a given script url.
window.onmessage = e => {
  worker = new Worker(e.data, { type: 'module' });
  worker.postMessage('start');
  worker.onmessage = msg => window.opener.postMessage(msg.data, '*');
  worker.onerror = err => {
      window.opener.postMessage(['ERROR'], '*');
      err.preventDefault();
  };
};
window.opener.postMessage('LOADED', '*');
</script>
