3 function stateChange() {
4 document
.write(this.foo
+ '<br>');
5 if (this.readyState
== 4) {
7 testRunner
.notifyDone();
11 function collectGarbage() {
12 if (window
.GCController
) {
13 window
.GCController
.collect();
15 for (var i
= 0; i
< 50000; i
++)
21 document
.write("Tests that garbage collection doesn't drop the XMLHttpRequest JS wrapper until the send command is done. You should see 'bar' four times below.<br>");
23 if (window
.testRunner
) {
24 testRunner
.dumpAsText();
25 testRunner
.waitUntilDone();
28 var xhr
= new XMLHttpRequest();
30 xhr
.onreadystatechange
= stateChange
;
31 xhr
.open("GET", "xmlhttprequest-gc.html", true);
39 <body onload='runTest()'
>