blob: a343b76e64988f0346c166237e4a91a93c62e0aa [file] [log] [blame]
Anne van Kesteren66b54172010-08-11 18:02:171<!doctype html>
2<html>
3 <head>
4 <title>XMLHttpRequest: members during UNSENT</title>
5 <script src="/resources/testharness.js"></script>
Ms2ger6f083e72012-08-05 08:38:146 <script src="/resources/testharnessreport.js"></script>
Ms2ger91fef142014-11-01 09:24:377 <link rel="help" href="https://xhr.spec.whatwg.org/#dom-xmlhttprequest-unsent" data-tested-assertations=".. following::dd" />
8 <link rel="help" href="https://xhr.spec.whatwg.org/#dom-xmlhttprequest-setrequestheader" data-tested-assertations="following::ol/li[1]" />
9 <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::ol/li[1]" />
10 <link rel="help" href="https://xhr.spec.whatwg.org/#the-status-attribute" data-tested-assertations="following::ol/li[1]" />
11 <link rel="help" href="https://xhr.spec.whatwg.org/#the-statustext-attribute" data-tested-assertations="following::ol/li[1]" />
12 <link rel="help" href="https://xhr.spec.whatwg.org/#the-getresponseheader()-method" data-tested-assertations="following::ol/li[1]" />
13 <link rel="help" href="https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method" data-tested-assertations="following::ol/li[1]" />
14 <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsetext-attribute" data-tested-assertations="following::ol/li[2]" />
15 <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsexml-attribute" data-tested-assertations="following::ol/li[2]" />
Hallvord R. M. Steen6bb53052012-11-09 10:47:4916
Anne van Kesteren66b54172010-08-11 18:02:1717 </head>
18 <body>
19 <div id="log"></div>
20 <script>
21 test(function() {
22 var client = new XMLHttpRequest()
Hallvord Reiar M. Steen64dacb72013-07-01 08:31:5423 assert_throws("InvalidStateError", function() { client.setRequestHeader("x-test", "test") }, "setRequestHeader")
24 assert_throws("InvalidStateError", function() { client.send(null) }, "send")
Anne van Kesteren66b54172010-08-11 18:02:1725 assert_equals(client.status, 0, "status")
26 assert_equals(client.statusText, "", "statusText")
27 assert_equals(client.getAllResponseHeaders(), "", "getAllResponseHeaders")
28 assert_equals(client.getResponseHeader("x-test"), null, "getResponseHeader")
29 assert_equals(client.responseText, "", "responseText")
30 assert_equals(client.responseXML, null, "responseXML")
31
32 assert_equals(client.readyState, client.UNSENT, "readyState")
33 })
34 </script>
35 </body>
36</html>