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 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 /**
5 * Make sure that releasing a pause-lifetime actorin a releaseMany returns an
6 * error, but releases all the thread-lifetime actors.
7 */
9 var gDebuggee;
10 var gClient;
11 var gThreadClient;
12 var gPauseGrip;
14 function run_test()
15 {
16 initTestDebuggerServer();
17 gDebuggee = addTestGlobal("test-grips");
18 gClient = new DebuggerClient(DebuggerServer.connectPipe());
19 gClient.connect(function() {
20 attachTestTabAndResume(gClient, "test-grips", function(aResponse, aTabClient, aThreadClient) {
21 gThreadClient = aThreadClient;
22 test_thread_lifetime();
23 });
24 });
25 do_test_pending();
26 }
28 function arg_grips(aFrameArgs, aOnResponse) {
29 let grips = [];
30 let handler = function (aResponse) {
31 if (aResponse.error) {
32 grips.push(aResponse.error);
33 } else {
34 grips.push(aResponse.from);
35 }
36 if (grips.length == aFrameArgs.length) {
37 aOnResponse(grips);
38 }
39 };
40 for (let i = 0; i < aFrameArgs.length; i++) {
41 gClient.request({ to: aFrameArgs[i].actor, type: "threadGrip" },
42 handler);
43 }
44 }
46 function test_thread_lifetime()
47 {
48 // Get two thread-lifetime grips.
49 gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) {
51 let frameArgs = [ aPacket.frame.arguments[0], aPacket.frame.arguments[1] ];
52 gPauseGrip = aPacket.frame.arguments[2];
53 arg_grips(frameArgs, function (aGrips) {
54 release_grips(frameArgs, aGrips);
55 });
56 });
58 gDebuggee.eval("(" + function() {
59 function stopMe(arg1, arg2, arg3) {
60 debugger;
61 };
62 stopMe({obj: 1}, {obj: 2}, {obj: 3});
63 } + ")()");
64 }
67 function release_grips(aFrameArgs, aThreadGrips)
68 {
69 // Release all actors with releaseMany...
70 let release = [aThreadGrips[0], aThreadGrips[1], gPauseGrip.actor];
71 gThreadClient.releaseMany(release, function (aResponse) {
72 do_check_eq(aResponse.error, "notReleasable");
73 // Now ask for thread grips again, they should not exist.
74 arg_grips(aFrameArgs, function (aNewGrips) {
75 for (let i = 0; i < aNewGrips.length; i++) {
76 do_check_eq(aNewGrips[i], "noSuchActor");
77 }
78 gThreadClient.resume(function () {
79 finishClient(gClient);
80 });
81 });
82 });
83 }