docshell/test/test_bug511449.html

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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">
    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);
    34 }
    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");
    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 }
    52 </script>
    54 </body>
    55 </html>

mercurial