Bumping manifests a=b2g-bump
[gecko.git] / dom / base / test / test_settimeout_inner.html
blobb0e6a9d4e080ddcd9c40cb4a91fb491726cf3368
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()
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);
27 iframe.src = "about:blank";
29 iframe.src = "data:text/html,<script>function runTest2() { setTimeout('parent.test2Done()'); };<" + "/script>";
31 window.test2DoneCalled = false;
32 function test2Done()
34 window.test2DoneCalled = true;
36 function allDone()
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();
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>