testing/web-platform/tests/navigation-api/per-entry-events/dispose-same-document-reload-with-intercept.html
author Emilio Cobos Álvarez <emilio@crisal.io>
Thu, 10 Jul 2025 09:08:54 +0000 (6 hours ago)
changeset 795952 1d422913e1cb1658224a2d269f8e4c9e80032d29
parent 624853 7aa1ba1f4e44aef1739dfedc2e99bd7894dc251b
permissions -rw-r--r--
Bug 1976623 - Create drag popups eagerly for now. r=tnikkel,layout-reviewers Trivially restores pre-regression behavior, for now. Differential Revision: https://phabricator.services.mozilla.com/D256769
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script>
promise_test(async (t) => {
  // Wait for after the load event so that the navigation doesn't get converted
  // into a replace navigation.
  await new Promise(r => window.onload = () => t.step_timeout(r, 0));

  navigation.currentEntry.ondispose = t.unreached_func("dispose must not happen for reloads");

  navigation.addEventListener("navigate", e => e.intercept());

  await navigation.reload().finished;
}, "dispose events are not fired when doing a same-document reload using navigation.reload() and intercept()");
</script>