xmlhttprequest-network-error.htm (2273B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: members during network errors</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following::dl[1]/dt[2] following::dl[1]/dd[2]/ol/li[1] following::dl[1]/dd[2]/ol/li[2]" /> 8 <link rel="help" href="https://xhr.spec.whatwg.org/#the-status-attribute" data-tested-assertations="following::ol[1]/li[1] following::ol[1]/li[2]" /> 9 <link rel="help" href="https://xhr.spec.whatwg.org/#the-statustext-attribute" data-tested-assertations="following::ol[1]/li[1] following::ol[1]/li[2]" /> 10 <link rel="help" href="https://xhr.spec.whatwg.org/#the-getresponseheader()-method" data-tested-assertations="following::ol[1]/li[1] following::ol[1]/li[2]" /> 11 <link rel="help" href="https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method" data-tested-assertations="following::ol[1]/li[1] following::ol[1]/li[2]" /> 12 <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsetext-attribute" data-tested-assertations="following::ol[1]/li[2] following::ol[1]/li[3]" /> 13 <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsexml-attribute" data-tested-assertations="following::ol[1]/li[2] following::ol[1]/li[3]" /> 14 15 </head> 16 <body> 17 <div id="log"></div> 18 <script> 19 var test = async_test() 20 test.step(function() { 21 var client = new XMLHttpRequest() 22 client.onreadystatechange = function() { 23 test.step(function() { 24 assert_equals(client.status, 0, "status") 25 assert_equals(client.statusText, "", "statusText") 26 assert_equals(client.getAllResponseHeaders(), "", "getAllResponseHeaders") 27 assert_equals(client.getResponseHeader("content-type"), null, "getResponseHeader") 28 assert_equals(client.responseText, "", "responseText") 29 assert_equals(client.responseXML, null, "responseXML") 30 if(client.readyState == 4) 31 test.done() 32 }) 33 } 34 client.open("GET", "resources/infinite-redirects.py") 35 client.send(null) 36 }) 37 </script> 38 </body> 39 </html>