4 https://bugzilla.mozilla.org/show_bug.cgi?id=635636
7 <title>Test for Bug
635636</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=635636">Mozilla Bug
635636</a>
18 <script type=
"application/javascript">
20 /** Test for Bug
635636 **/
21 SimpleTest.waitForExplicitFinish();
22 addLoadEvent(async function() {
23 function openNewWindow(aURL) {
24 return new Promise(resolve =
> {
25 let contentWindow = window.open(aURL);
26 contentWindow.addEventListener(
"load", () =
> {
27 ok(true, aURL +
" is loaded");
28 resolve(contentWindow);
33 function unloadWindow(aWindow) {
34 return new Promise(resolve =
> {
35 aWindow.addEventListener(
"unload", () =
> {
36 ok(true,
"The window has been unloaded");
37 SimpleTest.executeSoon(() =
> { resolve(
0); });
39 aWindow.location =
"file_bug635636_2.html";
43 let contentWindow = await openNewWindow(
"file_bug635636.xhtml");
45 contentWindow.addEventListener(
"load", () =
> { ok(true,
"load"); });
46 contentWindow.addEventListener(
"pageshow", () =
> { ok(true,
"pageshow"); });
48 let div = contentWindow.document.getElementsByTagName(
"div")[
0];
49 contentWindow.document.designMode =
"on";
51 await unloadWindow(contentWindow);
54 ok(true,
"Should not crash");
55 // Not needed for the crash
56 contentWindow.close();