tor-browser

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

abort-upload-event-abort.any.js (964B)


      1         var test = async_test("XMLHttpRequest: The abort() method: Fire a progress event named abort on the XMLHttpRequestUpload object");
      2 
      3        test.step(function()
      4        {
      5            var xhr = new XMLHttpRequest();
      6 
      7            xhr.onloadstart = function()
      8            {
      9                test.step(function()
     10                {
     11                    if (xhr.readyState == 1)
     12                    {
     13                        xhr.abort();
     14                    }
     15                });
     16            };
     17 
     18            xhr.upload.onabort = function(e)
     19            {
     20                test.step(function()
     21                {
     22                    assert_true(e instanceof ProgressEvent);
     23                    assert_equals(e.type, "abort");
     24                    assert_equals(e.target, xhr.upload);
     25                    test.done();
     26                });
     27            };
     28 
     29            xhr.open("POST", "./resources/content.py", true);
     30            xhr.send("Test Message");
     31        });