1 const Cc
= Components
.classes
;
2 const Ci
= Components
.interfaces
;
5 var stream
= Cc
["@mozilla.org/io/string-input-stream;1"].
6 createInstance(Ci
.nsISupportsCString
);
7 stream
.data
= "foo bar baz";
9 var pump
= Cc
["@mozilla.org/network/input-stream-pump;1"].
10 createInstance(Ci
.nsIInputStreamPump
);
11 pump
.init(stream
, -1, -1, 0, 0, false);
13 // When we pass a null listener argument too asyncRead we expect it to throw
14 // instead of crashing.
16 pump
.asyncRead(null, null);
22 do_throw("asyncRead didn't throw when passed a null listener argument.");