4 https://bugzilla.mozilla.org/show_bug.cgi?id=322588
7 <title>Test for Bug
322588 - onBlur window close no longer works
</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=322588">Mozilla Bug
322588 - onBlur window close no longer works
</a>
15 <a id=
"link" href=
"javascript:pop350d('bug322588-popup.html#target')">Openwindow
</a><br>
16 The opened window should not directly close when clicking on the Openwindow link
18 <div id=
"content" style=
"display: none">
22 <script type=
"application/javascript">
24 /** Test for Bug
322588 **/
29 function pop350d(url) {
31 w.addEventListener(
"unload", function () { result +=
" unload";});
32 w.addEventListener(
"load", function () { result +=
" load"; setTimeout(done,
1000);});
33 w.addEventListener(
"blur", function () { result +=
" blur";});
39 sendMouseEvent({type:'click'}, 'link');
48 is(result,
" unload load",
"unexpected events"); // The first unload is for about:blank
54 SimpleTest.waitForExplicitFinish();
55 SimpleTest.requestFlakyTimeout(
"untriaged");
56 addLoadEvent(function() {
57 SpecialPowers.pushPrefEnv({
"set": [
58 [
"browser.newtab.preload", false]