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 | Cu.import("resource://gre/modules/devtools/dbg-server.jsm"); |
michael@0 | 5 | Cu.import("resource://gre/modules/devtools/dbg-client.jsm"); |
michael@0 | 6 | |
michael@0 | 7 | function run_test() |
michael@0 | 8 | { |
michael@0 | 9 | // Should get an exception if we try to interact with DebuggerServer |
michael@0 | 10 | // before we initialize it... |
michael@0 | 11 | check_except(function() { |
michael@0 | 12 | DebuggerServer.openListener(-1); |
michael@0 | 13 | }); |
michael@0 | 14 | check_except(DebuggerServer.closeListener); |
michael@0 | 15 | check_except(DebuggerServer.connectPipe); |
michael@0 | 16 | |
michael@0 | 17 | // Allow incoming connections. |
michael@0 | 18 | DebuggerServer.init(function () { return true; }); |
michael@0 | 19 | |
michael@0 | 20 | // These should still fail because we haven't added a createRootActor |
michael@0 | 21 | // implementation yet. |
michael@0 | 22 | check_except(function() { |
michael@0 | 23 | DebuggerServer.openListener(-1); |
michael@0 | 24 | }); |
michael@0 | 25 | check_except(DebuggerServer.closeListener); |
michael@0 | 26 | check_except(DebuggerServer.connectPipe); |
michael@0 | 27 | |
michael@0 | 28 | DebuggerServer.addActors("resource://test/testactors.js"); |
michael@0 | 29 | |
michael@0 | 30 | // Now they should work. |
michael@0 | 31 | DebuggerServer.openListener(-1); |
michael@0 | 32 | DebuggerServer.closeListener(); |
michael@0 | 33 | |
michael@0 | 34 | // Make sure we got the test's root actor all set up. |
michael@0 | 35 | let client1 = DebuggerServer.connectPipe(); |
michael@0 | 36 | client1.hooks = { |
michael@0 | 37 | onPacket: function(aPacket1) { |
michael@0 | 38 | do_check_eq(aPacket1.from, "root"); |
michael@0 | 39 | do_check_eq(aPacket1.applicationType, "xpcshell-tests"); |
michael@0 | 40 | |
michael@0 | 41 | // Spin up a second connection, make sure it has its own root |
michael@0 | 42 | // actor. |
michael@0 | 43 | let client2 = DebuggerServer.connectPipe(); |
michael@0 | 44 | client2.hooks = { |
michael@0 | 45 | onPacket: function(aPacket2) { |
michael@0 | 46 | do_check_eq(aPacket2.from, "root"); |
michael@0 | 47 | do_check_neq(aPacket1.testConnectionPrefix, |
michael@0 | 48 | aPacket2.testConnectionPrefix); |
michael@0 | 49 | client2.close(); |
michael@0 | 50 | }, |
michael@0 | 51 | onClosed: function(aResult) { |
michael@0 | 52 | client1.close(); |
michael@0 | 53 | }, |
michael@0 | 54 | }; |
michael@0 | 55 | client2.ready(); |
michael@0 | 56 | }, |
michael@0 | 57 | |
michael@0 | 58 | onClosed: function(aResult) { |
michael@0 | 59 | do_test_finished(); |
michael@0 | 60 | }, |
michael@0 | 61 | }; |
michael@0 | 62 | |
michael@0 | 63 | client1.ready(); |
michael@0 | 64 | do_test_pending(); |
michael@0 | 65 | } |