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()
24 if (req
.responseText
.length
) {
25 error("responseText is not empty");
26 if (window
.testRunner
)
27 testRunner
.notifyDone()
31 function stealResponse()
33 document
.body
.removeChild(document
.getElementById('preOnerror'));
35 req
.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/zero-length.xml");
37 req
.onreadystatechange
= checkResponse
;
38 setTimeout(function() {
42 if (window
.testRunner
)
43 testRunner
.notifyDone()
47 var req
= new XMLHttpRequest
;
48 req
.open("GET", "http://localhost:8000/xmlhttprequest/resources/reply.xml", false);
51 error("send did not raise an exception");