tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

xmlhttprequest-unsent.htm (2261B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>XMLHttpRequest: members during UNSENT</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/#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]" />
     16 
     17  </head>
     18  <body>
     19    <div id="log"></div>
     20    <script>
     21      test(function() {
     22        var client = new XMLHttpRequest()
     23        assert_throws_dom("InvalidStateError", function() { client.setRequestHeader("x-test", "test") }, "setRequestHeader")
     24        assert_throws_dom("InvalidStateError", function() { client.send(null) }, "send")
     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>