Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 function run_test() {
2 var stream = Cc["@mozilla.org/io/string-input-stream;1"].
3 createInstance(Ci.nsISupportsCString);
4 stream.data = "foo bar baz";
6 var pump = Cc["@mozilla.org/network/input-stream-pump;1"].
7 createInstance(Ci.nsIInputStreamPump);
8 pump.init(stream, -1, -1, 0, 0, false);
10 // When we pass a null listener argument too asyncRead we expect it to throw
11 // instead of crashing.
12 try {
13 pump.asyncRead(null, null);
14 }
15 catch (e) {
16 return;
17 }
19 do_throw("asyncRead didn't throw when passed a null listener argument.");
20 }