tor-browser

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

security-consideration.sub.html (1541B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>ProgressEvent: security consideration</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/#security-considerations" data-tested-assertations="/following-sibling::p" />
      8    <link rel="help" href="https://fetch.spec.whatwg.org/#http-fetch" data-tested-assertations="/following-sibling::ol[1]/li[3]/ol[1]/li[6]" />
      9  </head>
     10  <body>
     11    <div id="log"></div>
     12    <script>
     13      async_test(function() {
     14        var xhr = new XMLHttpRequest();
     15 
     16        xhr.onprogress = this.unreached_func("MUST NOT dispatch progress event.");
     17        xhr.onload = this.unreached_func("MUST NOT dispatch load event.");
     18        xhr.onerror = this.step_func(function(pe) {
     19          assert_equals(pe.type, "error");
     20          assert_equals(pe.loaded, 0, "loaded is zero.");
     21          assert_false(pe.lengthComputable, "lengthComputable is false.");
     22          assert_equals(pe.total, 0, "total is zero.");
     23        });
     24        xhr.onloadend = this.step_func(function(pe) {
     25          assert_equals(pe.type, "loadend");
     26          assert_equals(pe.loaded, 0, "loaded is zero.");
     27          assert_false(pe.lengthComputable, "lengthComputable is false.");
     28          assert_equals(pe.total, 0, "total is zero.");
     29          this.done();
     30        });
     31        xhr.open("GET", "http://{{host}}:{{ports[http][1]}}/xhr/resources/img.jpg", true);
     32        xhr.send(null);
     33      })
     34    </script>
     35  </body>
     36 </html>