dom/base/test/test_settimeout_inner.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=936129
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 936129</title>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11   <script type="application/javascript">
    13     /** Test for Bug 936129 **/
    14     SimpleTest.waitForExplicitFinish();
    16     function test1Done()
    17     {
    18       ok(true, "Bareword setTimeout should work after calling document.open().");
    20       var iframe = document.getElementById("testFrame");
    21       iframe.onload = function () {
    22         window.runTest2 = iframe.contentWindow.runTest2;
    23         iframe.onload = function () {
    24           window.runTest2();
    25           setTimeout(allDone);
    26         }
    27         iframe.src = "about:blank";
    28       }
    29       iframe.src = "data:text/html,<script>function runTest2() { setTimeout('parent.test2Done()'); };<" + "/script>";
    30     }
    31     window.test2DoneCalled = false;
    32     function test2Done()
    33     {
    34       window.test2DoneCalled = true;
    35     }
    36     function allDone()
    37     {
    38       ok(!window.test2DoneCalled, "Bareword setTimeout should be a noop after the document for the window context that it's called on isn't active anymore.");
    40       SimpleTest.finish();
    41     }
    42   </script>
    43 </head>
    44 <body>
    45 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=936129">Mozilla Bug 936129</a>
    46 <p id="display"></p>
    47 <div id="content" style="display: none">
    48 <iframe id="testFrame" src="data:text/html,<script>window.onload = function runTest1() { document.open(); setTimeout('parent.test1Done();'); document.close(); }</script>"></iframe>
    49 </div>
    50 <pre id="test">
    51 </pre>
    52 </body>
    53 </html>

mercurial