chromium/third_party/blink/web_tests/http/tests/serviceworker/navigation_preload/navigation-preload-gc-before-response.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>GC before preload response shouldn't free the resolver function</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/test-helpers.js"></script>
<script>

promise_test(t => {
    var script = 'resources/navigation-preload-gc-before-response-worker.js';
    var scope = 'resources/navigation-preload-gc-before-response-scope.php';
    return service_worker_unregister_and_register(t, script, scope)
      .then(registration => {
          add_completion_callback(_ => registration.unregister());
          var worker = registration.installing;
          return wait_for_state(t, worker, 'activated');
        })
      .then(_ => with_iframe(scope))
      .then(frame => {
          assert_equals(frame.contentWindow.document.body.innerText, 'hello');
        });
  }, 'GC before preload response shouldn\'t free the resolver function.');

</script>