Bug 1776680 [wpt PR 34603] - [@container] Test invalidation of font-relative units...
[gecko.git] / dom / events / test / test_bug322588.html
blob25008cb375891d46ceabc34efc5a40712ff8291a
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=322588
5 -->
6 <head>
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"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=322588">Mozilla Bug 322588 - onBlur window close no longer works</a>
14 <p id="display">
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
17 </p>
18 <div id="content" style="display: none">
20 </div>
21 <pre id="test">
22 <script type="application/javascript">
24 /** Test for Bug 322588 **/
26 var result = "";
28 var w;
29 function pop350d(url) {
30 w = window.open();
31 w.addEventListener("unload", function () { result += " unload";});
32 w.addEventListener("load", function () { result += " load"; setTimeout(done, 1000);});
33 w.addEventListener("blur", function () { result += " blur";});
34 w.location = url;
37 function doTest() {
38 try {
39 sendMouseEvent({type:'click'}, 'link');
40 } catch(e) {
41 if (w)
42 w.close();
43 throw e;
47 function done() {
48 is(result," unload load","unexpected events"); // The first unload is for about:blank
49 if (w)
50 w.close();
51 SimpleTest.finish();
54 SimpleTest.waitForExplicitFinish();
55 SimpleTest.requestFlakyTimeout("untriaged");
56 addLoadEvent(function() {
57 SpecialPowers.pushPrefEnv({"set": [
58 ["browser.newtab.preload", false]
59 ]}, doTest);
60 });
63 </script>
64 </pre>
65 </body>
66 </html>