Bug 1470678 [wpt PR 11640] - Add a test for text-decoration in tables quirk, a=testonly
[gecko.git] / docshell / test / test_close_onpagehide_by_history_back.html
blob023be6a4732a70787e1265a9205f61af18f8a2de
1 <!doctype html>
2 <title>Test for closing window in pagehide event callback caused by history.back()</title>
3 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
4 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
5 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1432396">Mozilla Bug 1432396</a>
6 <p id="display"></p>
7 <script>
8 SimpleTest.waitForExplicitFinish();
10 const w = window.open("file_close_onpagehide1.html");
11 window.addEventListener("message", e => {
12 is(e.data, "initial", "The initial page loaded");
13 window.addEventListener("message", e => {
14 is(e.data, "second", "The second page loaded");
15 w.onpagehide = () => {
16 w.close();
17 info("try to close the popped up window in onpagehide");
18 SimpleTest.finish();
20 w.history.back();
21 }, { once: true });
22 w.location = "file_close_onpagehide2.html";
23 }, { once: true });
24 </script>