wpt / close-watcher / user-activation / n.html?CloseWatcher

Open test on wpt.live | wpt.fyi

Runs: Chrome 160.0.8195.0 (wpt@1ab8957e4, 2026-12-01) | Firefox 163.0a1 (wpt@1ab8957e4, 2026-12-01) | Safari 257 preview (wpt@a5fdc5198, 2026-12-01) | Ladybird 1.0-f51e5 (wpt@ec46ed6ca, 2026-12-01) | Servo Servo 0.8 (wpt@75c11f957, 2026-12-01) | Blitz 713a982dc (wpt@705f393a6, 2026-12-01)

ChromeFirefoxSafariLadybirdServoBlitz
Total1/11/10/11/11/1NOT RUN
SubtestChromeFirefoxSafariLadybirdServoBlitz
Create a close watcher without user activationPASSPASSFAILPASSPASS—

/close-watcher/user-activation/n.html

<!doctype html>
<meta name=variant content="?dialog">
<meta name=variant content="?CloseWatcher">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/common/top-layer.js"></script>
<script src="../resources/helpers.js"></script>

<body>
<script>
const type = location.search.substring(1);

promise_test(async t => {
  const events = [];

  createRecordingCloseWatcher(t, events, undefined, type);

  await sendCloseRequest();
  await waitForPotentialCloseEvent();
  assert_array_equals(events, ["cancel[cancelable=false]", "close"]);
}, "Create a close watcher without user activation");
</script>