chromium/third_party/blink/web_tests/http/tests/cachestorage/worker-deleted.html

<!DOCTYPE html>
<meta charset=utf-8>
<title>Cache Storage: Verify Worker calling close doesnt crash render process </title>
<link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-storage">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var worker_script = 'serviceworker/worker-closer.js';
var worker_script2 = 'serviceworker/worker-closer2.js';
var worker1Started = false;
var worker2Started = false;
function waitUntilWorkerThreadsExit(callback) {
  if (internals.workerThreadCount > 0) {
    setTimeout(() => { waitUntilWorkerThreadsExit(callback) }, 10);
  } else {
    callback();
  }
}
function workerOnMesage(message, callback) {
  assert_equals('started', message);
  if (worker1Started && worker2Started) {
    waitUntilWorkerThreadsExit(callback);
  }
}
promise_test(function(t) {
  return new Promise(function(resolve) {
      var worker1 = new Worker(worker_script);
      var worker2 = new Worker(worker_script2);
      worker1.onmessage = function(message) {
        worker1Started = true;
        workerOnMesage(message.data, resolve);
      };
      worker2.onmessage = function(message) {
        worker2Started = true;
        workerOnMesage(message.data, resolve);
      };
  }).then(() => { gc(true); });
});
</script>
<body> Something
</body>
</html>