3 function stateChange() {
4 document.write(this.foo + '<br>');
5 if (this.readyState == 4) {
6 if (window.layoutTestController)
7 layoutTestController.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.layoutTestController) {
24 layoutTestController.dumpAsText();
25 layoutTestController.waitUntilDone();
28 var xhr = new XMLHttpRequest();
30 xhr.onreadystatechange = stateChange;
31 xhr.open("GET", "xmlhttprequest-gc.html", true);
39 <body onload='runTest()'>