Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/the-window-object/open-close/closed-after-close.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
test(() => {
const w = window.open();
w.document.body.appendChild(w.document.createElement('iframe'));
w.close();
assert_true(w.closed);
assert_false(w[0].closed);
}, 'window.closed behavior after calling window.close().');
</script>