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.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | "use strict"; |
michael@0 | 5 | |
michael@0 | 6 | const Profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler); |
michael@0 | 7 | |
michael@0 | 8 | function check_actors(expect) { |
michael@0 | 9 | do_check_eq(expect, DebuggerServer.tabActorFactories.hasOwnProperty("registeredActor1")); |
michael@0 | 10 | do_check_eq(expect, DebuggerServer.tabActorFactories.hasOwnProperty("registeredActor2")); |
michael@0 | 11 | |
michael@0 | 12 | do_check_eq(expect, DebuggerServer.globalActorFactories.hasOwnProperty("registeredActor2")); |
michael@0 | 13 | do_check_eq(expect, DebuggerServer.globalActorFactories.hasOwnProperty("registeredActor1")); |
michael@0 | 14 | } |
michael@0 | 15 | |
michael@0 | 16 | function run_test() |
michael@0 | 17 | { |
michael@0 | 18 | DebuggerServer.init(function () { return true; }); |
michael@0 | 19 | // The xpcshell-test/ path maps to resource://test/ |
michael@0 | 20 | DebuggerServer.registerModule("xpcshell-test/registertestactors-01"); |
michael@0 | 21 | DebuggerServer.registerModule("xpcshell-test/registertestactors-02"); |
michael@0 | 22 | |
michael@0 | 23 | check_actors(true); |
michael@0 | 24 | |
michael@0 | 25 | check_except(() => { |
michael@0 | 26 | DebuggerServer.registerModule("xpcshell-test/registertestactors-01"); |
michael@0 | 27 | }); |
michael@0 | 28 | check_except(() => { |
michael@0 | 29 | DebuggerServer.registerModule("xpcshell-test/registertestactors-02"); |
michael@0 | 30 | }); |
michael@0 | 31 | |
michael@0 | 32 | DebuggerServer.unregisterModule("xpcshell-test/registertestactors-01"); |
michael@0 | 33 | DebuggerServer.unregisterModule("xpcshell-test/registertestactors-02"); |
michael@0 | 34 | check_actors(false); |
michael@0 | 35 | |
michael@0 | 36 | DebuggerServer.registerModule("xpcshell-test/registertestactors-01"); |
michael@0 | 37 | DebuggerServer.registerModule("xpcshell-test/registertestactors-02"); |
michael@0 | 38 | check_actors(true); |
michael@0 | 39 | |
michael@0 | 40 | DebuggerServer.destroy(); |
michael@0 | 41 | check_actors(false); |
michael@0 | 42 | } |
michael@0 | 43 |