2 <pre id=preOnerror
>FAIL: onerror was not called.
</pre>
5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
7 testRunner
.waitUntilDone();
12 document
.getElementById('console').appendChild(document
.createTextNode(message
+ '\n'));
16 function error(message
)
19 log("FAIL: " + message
);
22 function checkResponse()
25 document
.body
.removeChild(document
.getElementById('preOnerror'));
27 if (req
.responseText
.length
)
28 error("responseText is not empty");
30 error("responseXML is not null");
33 error("status is not zero: " + req
.status
);
38 error("statusText is not empty: " + req
.statusText
);
42 if (req
.getAllResponseHeaders().length
)
43 error("getAllResponseHeaders() result is not empty: " + req
.getAllResponseHeaders());
52 if (window
.testRunner
)
53 testRunner
.notifyDone();
56 var req
= new XMLHttpRequest
;
57 req
.open("GET", "http://localhost:8000/xmlhttprequest/resources/reply.xml")
58 req
.onerror = function() { setTimeout(checkResponse
, 100); } // Giving the time for load to continue.