2 <p>Test that messaging an inactive frameless document works as expected.
</p>
7 if (window
.GCController
)
8 return GCController
.collect();
10 for (var i
= 0; i
< 10000; i
++) { // > force garbage collection (FF requires about 9K allocations before a collect)
11 var s
= new String("abc");
17 document
.getElementById("log").innerHTML
+= message
+ "<br>";
20 if (window
.testRunner
) {
21 testRunner
.dumpAsText();
22 testRunner
.waitUntilDone();
30 otherDocument
= window
.frames
[0].document
;
31 var channel
= new MessageChannel
;
32 window
.frames
[0].postMessage("msg", [channel
.port2
], "*");
33 mainPort
= channel
.port1
;
36 mainPort
.postMessage("ping");
37 mainPort
.onmessage
= test2
;
42 var frameElement
= document
.getElementsByTagName("iframe")[0];
43 frameElement
.src
= "resources/window-opened.html";
44 frameElement
.onload
= test3
;
51 mainPort
.postMessage("alert FAIL: the document is inactive.");
52 mainPort
.postMessage("freeze");
53 mainPort
.postMessage("ping");
54 mainPort
.onmessage = function(evt
) {
55 log("Unexpected response: FAIL");
57 setTimeout(test4
, 10);
64 log("Didn't crash, freeze or respond: SUCCESS");
66 if (window
.testRunner
)
67 testRunner
.notifyDone();
71 <iframe src=
"resources/message-port-iframe.html" onload=
"test()" width=
0 height=
0 frameborder=
0></iframe>