Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
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 }