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 | var gDebuggee; |
michael@0 | 5 | var gClient; |
michael@0 | 6 | var gThreadClient; |
michael@0 | 7 | |
michael@0 | 8 | // Test that the EnvironmentClient's getBindings() method works as expected. |
michael@0 | 9 | function run_test() |
michael@0 | 10 | { |
michael@0 | 11 | initTestDebuggerServer(); |
michael@0 | 12 | gDebuggee = addTestGlobal("test-bindings"); |
michael@0 | 13 | |
michael@0 | 14 | gClient = new DebuggerClient(DebuggerServer.connectPipe()); |
michael@0 | 15 | gClient.connect(function() { |
michael@0 | 16 | attachTestTabAndResume(gClient, "test-bindings", function(aResponse, aTabClient, aThreadClient) { |
michael@0 | 17 | gThreadClient = aThreadClient; |
michael@0 | 18 | test_banana_environment(); |
michael@0 | 19 | }); |
michael@0 | 20 | }); |
michael@0 | 21 | do_test_pending(); |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | function test_banana_environment() |
michael@0 | 25 | { |
michael@0 | 26 | |
michael@0 | 27 | gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) { |
michael@0 | 28 | let environment = aPacket.frame.environment; |
michael@0 | 29 | do_check_eq(environment.type, "function"); |
michael@0 | 30 | |
michael@0 | 31 | let parent = environment.parent; |
michael@0 | 32 | do_check_eq(parent.type, "block"); |
michael@0 | 33 | |
michael@0 | 34 | let grandpa = parent.parent; |
michael@0 | 35 | do_check_eq(grandpa.type, "function"); |
michael@0 | 36 | |
michael@0 | 37 | let envClient = gThreadClient.environment(environment); |
michael@0 | 38 | envClient.getBindings(aResponse => { |
michael@0 | 39 | do_check_eq(aResponse.bindings.arguments[0].z.value, "z"); |
michael@0 | 40 | |
michael@0 | 41 | let parentClient = gThreadClient.environment(parent); |
michael@0 | 42 | parentClient.getBindings(aResponse => { |
michael@0 | 43 | do_check_eq(aResponse.bindings.variables.banana3.value.class, "Function"); |
michael@0 | 44 | |
michael@0 | 45 | let grandpaClient = gThreadClient.environment(grandpa); |
michael@0 | 46 | grandpaClient.getBindings(aResponse => { |
michael@0 | 47 | do_check_eq(aResponse.bindings.arguments[0].y.value, "y"); |
michael@0 | 48 | gThreadClient.resume(() => finishClient(gClient)); |
michael@0 | 49 | }); |
michael@0 | 50 | }); |
michael@0 | 51 | }); |
michael@0 | 52 | }); |
michael@0 | 53 | |
michael@0 | 54 | gDebuggee.eval("\ |
michael@0 | 55 | function banana(x) { \n\ |
michael@0 | 56 | return function banana2(y) { \n\ |
michael@0 | 57 | return function banana3(z) { \n\ |
michael@0 | 58 | debugger; \n\ |
michael@0 | 59 | }; \n\ |
michael@0 | 60 | }; \n\ |
michael@0 | 61 | } \n\ |
michael@0 | 62 | banana('x')('y')('z'); \n\ |
michael@0 | 63 | "); |
michael@0 | 64 | } |