|
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"> |
|
12 |
|
13 /** Test for Bug 936129 **/ |
|
14 SimpleTest.waitForExplicitFinish(); |
|
15 |
|
16 function test1Done() |
|
17 { |
|
18 ok(true, "Bareword setTimeout should work after calling document.open()."); |
|
19 |
|
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."); |
|
39 |
|
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> |