|
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="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
10 <script type="application/javascript" src="/tests/SimpleTest/NativeKeyCodes.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"> |
|
22 |
|
23 /** Test for Bug 511449 **/ |
|
24 |
|
25 SimpleTest.waitForExplicitFinish(); |
|
26 window.addEventListener('load', runTest, false); |
|
27 |
|
28 var win = null; |
|
29 |
|
30 function runTest() { |
|
31 document.getElementById("input").focus(); |
|
32 win = window.open("file_bug511449.html", ""); |
|
33 SimpleTest.waitForFocus(runNextTest, win); |
|
34 } |
|
35 |
|
36 function runNextTest() { |
|
37 var didClose = false; |
|
38 win.onunload = function() { |
|
39 didClose = true; |
|
40 } |
|
41 synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_W, {metaKey:1}, "w", "w"); |
|
42 |
|
43 setTimeout(function () { |
|
44 ok(didClose, "Cmd+W should have closed the tab"); |
|
45 if (!didClose) { |
|
46 win.close(); |
|
47 } |
|
48 SimpleTest.finish(); |
|
49 }, 1000); |
|
50 } |
|
51 |
|
52 </script> |
|
53 |
|
54 </body> |
|
55 </html> |