1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/docshell/test/test_bug511449.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=511449 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 511449</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 1.13 + <script type="application/javascript" src="/tests/SimpleTest/NativeKeyCodes.js"></script> 1.14 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.15 +</head> 1.16 +<body> 1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=511449">Mozilla Bug 511449</a> 1.18 +<p id="display"></p> 1.19 +<div id="status"></div> 1.20 +<div id="content"> 1.21 +</div> 1.22 +<input type="text" id="input"> 1.23 +<pre id="test"> 1.24 +<script type="application/javascript;version=1.7"> 1.25 + 1.26 +/** Test for Bug 511449 **/ 1.27 + 1.28 +SimpleTest.waitForExplicitFinish(); 1.29 +window.addEventListener('load', runTest, false); 1.30 + 1.31 +var win = null; 1.32 + 1.33 +function runTest() { 1.34 + document.getElementById("input").focus(); 1.35 + win = window.open("file_bug511449.html", ""); 1.36 + SimpleTest.waitForFocus(runNextTest, win); 1.37 +} 1.38 + 1.39 +function runNextTest() { 1.40 + var didClose = false; 1.41 + win.onunload = function() { 1.42 + didClose = true; 1.43 + } 1.44 + synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_W, {metaKey:1}, "w", "w"); 1.45 + 1.46 + setTimeout(function () { 1.47 + ok(didClose, "Cmd+W should have closed the tab"); 1.48 + if (!didClose) { 1.49 + win.close(); 1.50 + } 1.51 + SimpleTest.finish(); 1.52 + }, 1000); 1.53 +} 1.54 + 1.55 +</script> 1.56 + 1.57 +</body> 1.58 +</html>