CLOSED TREE: TraceMonkey merge head. (a=blockers)
[mozilla-central.git] / docshell / test / test_bug511449.html
blob1e2aa1524c76b8fb2ddec65d4968d08aa531cf42
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=511449
5 -->
6 <head>
7 <title>Test for Bug 511449</title>
8 <script type="application/javascript" src="/MochiKit/packed.js"></script>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
12 </head>
13 <body>
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=511449">Mozilla Bug 511449</a>
15 <p id="display"></p>
16 <div id="status"></div>
17 <div id="content">
18 </div>
19 <input type="text" id="input">
20 <pre id="test">
21 <script type="application/javascript;version=1.7">
23 /** Test for Bug 511449 **/
25 SimpleTest.waitForExplicitFinish();
26 window.addEventListener('load', runTest, false);
28 var win = null;
30 function runTest() {
31 document.getElementById("input").focus();
32 win = window.open("file_bug511449.html", "");
33 SimpleTest.waitForFocus(runNextTest, win);
36 function runNextTest() {
37 var didClose = false;
38 win.onunload = function() {
39 didClose = true;
41 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
42 var utils = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
43 getInterface(Components.interfaces.nsIDOMWindowUtils);
44 utils.sendNativeKeyEvent(0, 13 /* w */, 0x4000 /* cmd */, "w", "w");
46 setTimeout(function () {
47 ok(didClose, "Cmd+W should have closed the tab");
48 if (!didClose) {
49 win.close();
51 SimpleTest.finish();
52 }, 1000);
55 </script>
57 </body>
58 </html>