tor-browser

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

test_bug376865.js (567B)


      1 "use strict";
      2 
      3 function run_test() {
      4  var stream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
      5    Ci.nsISupportsCString
      6  );
      7  stream.data = "foo bar baz";
      8 
      9  var pump = Cc["@mozilla.org/network/input-stream-pump;1"].createInstance(
     10    Ci.nsIInputStreamPump
     11  );
     12  pump.init(stream, 0, 0, false);
     13 
     14  // When we pass a null listener argument too asyncRead we expect it to throw
     15  // instead of crashing.
     16  try {
     17    pump.asyncRead(null);
     18  } catch (e) {
     19    return;
     20  }
     21 
     22  do_throw("asyncRead didn't throw when passed a null listener argument.");
     23 }