tor-browser

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

send-response-upload-event-loadstart.htm (1387B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4    <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onloadstart" data-tested-assertations="../.." />
      5    <link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-loadstart" data-tested-assertations="../.." />
      6    <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::ol[1]/li[8] following-sibling::ol/li[9]/ol/li[3]" />
      7 
      8    <script src="/resources/testharness.js"></script>
      9    <script src="/resources/testharnessreport.js"></script>
     10    <title>XMLHttpRequest: The send() method: Fire a progress event named loadstart on the XMLHttpRequestUpload (synchronous flag is unset)</title>
     11 </head>
     12 
     13 <body>
     14    <div id="log"></div>
     15 
     16    <script type="text/javascript">
     17        var test = async_test();
     18 
     19        test.step(function()
     20        {
     21            var xhr = new XMLHttpRequest();
     22 
     23            xhr.upload.onloadstart = function(e)
     24            {
     25                test.step(function()
     26                {
     27                    assert_true(e instanceof ProgressEvent);
     28                    assert_equals(e.type, "loadstart");
     29                    assert_equals(e.target, xhr.upload);
     30                    test.done();
     31                });
     32            };
     33 
     34            xhr.open("POST", "./resources/content.py", true);
     35            xhr.send("Test Message");
     36        });
     37    </script>
     38 </body>
     39 </html>