| Anne van Kesteren | 66b5417 | 2010-08-11 18:02:17 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>XMLHttpRequest: members during UNSENT</title> |
| 5 | <script src="/resources/testharness.js"></script> |
| Ms2ger | 6f083e7 | 2012-08-05 08:38:14 | [diff] [blame] | 6 | <script src="/resources/testharnessreport.js"></script> |
| Ms2ger | 91fef14 | 2014-11-01 09:24:37 | [diff] [blame] | 7 | <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. Steen | 6bb5305 | 2012-11-09 10:47:49 | [diff] [blame] | 16 | |
| Anne van Kesteren | 66b5417 | 2010-08-11 18:02:17 | [diff] [blame] | 17 | </head> |
| 18 | <body> |
| 19 | <div id="log"></div> |
| 20 | <script> |
| 21 | test(function() { |
| 22 | var client = new XMLHttpRequest() |
| Hallvord Reiar M. Steen | 64dacb7 | 2013-07-01 08:31:54 | [diff] [blame] | 23 | assert_throws("InvalidStateError", function() { client.setRequestHeader("x-test", "test") }, "setRequestHeader") |
| 24 | assert_throws("InvalidStateError", function() { client.send(null) }, "send") |
| Anne van Kesteren | 66b5417 | 2010-08-11 18:02:17 | [diff] [blame] | 25 | 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> |