xmlhttprequest-network-error-sync.htm (2378B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: members during network errors (sync)</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]/p[1]" /> 8 <link rel="help" href="https://xhr.spec.whatwg.org/#network-error" data-tested-assertations=".." /> 9 <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[5]" /> 10 <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]" /> 11 <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]" /> 12 <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]" /> 13 <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]" /> 14 <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]" /> 15 <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]" /> 16 </head> 17 <body> 18 <div id="log"></div> 19 <script> 20 test(function() { 21 var client = new XMLHttpRequest() 22 client.open("GET", "resources/infinite-redirects.py", false) 23 assert_throws_dom("NetworkError", function() { client.send(null) }, "send") 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 assert_equals(client.readyState, client.DONE, "readyState") 31 }) 32 </script> 33 </body> 34 </html>