tor-browser

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

abort-during-upload.any.js (752B)


      1 // META: title=XMLHttpRequest: abort() while sending data
      2 // META: script=resources/xmlhttprequest-event-order.js
      3 
      4      var test = async_test()
      5      test.step(function() {
      6        var client = new XMLHttpRequest()
      7        prepare_xhr_for_event_order_test(client);
      8        client.open("POST", "resources/delay.py?ms=1000")
      9        client.addEventListener("loadend", function(e) {
     10          test.step(function() {
     11            assert_xhr_event_order_matches([1, "loadstart(0,0,false)", "upload.loadstart(0,9999,true)", 4, "upload.abort(0,0,false)", "upload.loadend(0,0,false)", "abort(0,0,false)", "loadend(0,0,false)"]);
     12            test.done()
     13          })
     14        });
     15        client.send((new Array(10000)).join('a'))
     16        client.abort()
     17      })