tor-browser

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

event-load.any.js (689B)


      1 // META: title=XMLHttpRequest: The send() method: Fire an event named load (synchronous flag is unset)
      2 
      3 var test = async_test();
      4 test.step(function () {
      5  var client = new XMLHttpRequest();
      6  client.onload = test.step_func(function (e) {
      7    assert_true(e instanceof ProgressEvent);
      8    assert_equals(e.type, "load");
      9    assert_equals(client.readyState, 4);
     10    test.done();
     11  });
     12  client.onreadystatechange = test.step_func(function () {
     13    if (client.readyState !== 4) return;
     14 
     15    test.step_timeout(() => {
     16      assert_unreached("Didn't get load event within 4ms of readystatechange==4");
     17    }, 4);
     18  });
     19  client.open("GET", "resources/well-formed.xml");
     20  client.send(null);
     21 });