Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 }