gecko-dev/docshell/test/test_close_onpagehide_by_window_close.html
Hiroyuki Ikezoe fbdb88bdd8 Bug 1432396 - Do not process nsDocShell::Destroy() if the docshell is already being destroyed. r=bz
The test case in this patch is harmless without this fix, no assertion happens,
no failure happens in the test, but nsDocShell::Destroy() is processed twice.

MozReview-Commit-ID: 2g949emc7at

--HG--
extra : rebase_source : 34209e5cd5310521b2eec4d4f67f355bfdae5d8d
2018-02-16 06:15:04 +09:00

21 lines
760 B
HTML

<!doctype html>
<title>Test for closing window in pagehide event callback caused by window.close()</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1432396">Mozilla Bug 1432396</a>
<p id="display"></p>
<script>
SimpleTest.waitForExplicitFinish();
const w = window.open("file_close_onpagehide1.html");
window.addEventListener("message", e => {
is(e.data, "initial", "The initial page loaded");
w.onpagehide = () => {
w.close();
info("try to close the popped up window in onpagehide");
SimpleTest.finish();
};
w.close();
}, { once: true });
</script>