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 * Check that we source map frame locations for the frame we are paused at.
6 */
8 var gDebuggee;
9 var gClient;
10 var gThreadClient;
12 Components.utils.import('resource:///modules/devtools/SourceMap.jsm');
14 function run_test() {
15 initTestDebuggerServer();
16 gDebuggee = addTestGlobal("test-source-map");
17 gClient = new DebuggerClient(DebuggerServer.connectPipe());
18 gClient.connect(function() {
19 attachTestTabAndResume(gClient, "test-source-map", function(aResponse, aTabClient, aThreadClient) {
20 gThreadClient = aThreadClient;
21 promise.resolve(define_code())
22 .then(run_code)
23 .then(test_frame_location)
24 .then(null, error => {
25 dump(error + "\n");
26 dump(error.stack);
27 do_check_true(false);
28 })
29 .then(() => {
30 finishClient(gClient);
31 });
32 });
33 });
34 do_test_pending();
35 }
37 function define_code() {
38 let { code, map } = (new SourceNode(null, null, null, [
39 new SourceNode(1, 0, "a.js", "function a() {\n"),
40 new SourceNode(2, 0, "a.js", " b();\n"),
41 new SourceNode(3, 0, "a.js", "}\n"),
42 new SourceNode(1, 0, "b.js", "function b() {\n"),
43 new SourceNode(2, 0, "b.js", " c();\n"),
44 new SourceNode(3, 0, "b.js", "}\n"),
45 new SourceNode(1, 0, "c.js", "function c() {\n"),
46 new SourceNode(2, 0, "c.js", " debugger;\n"),
47 new SourceNode(3, 0, "c.js", "}\n"),
48 ])).toStringWithSourceMap({
49 file: "abc.js",
50 sourceRoot: "http://example.com/www/js/"
51 });
53 code += "//# sourceMappingURL=data:text/json," + map.toString();
55 Components.utils.evalInSandbox(code, gDebuggee, "1.8",
56 "http://example.com/www/js/abc.js", 1);
57 }
59 function run_code() {
60 const d = promise.defer();
61 gClient.addOneTimeListener("paused", function (aEvent, aPacket) {
62 d.resolve(aPacket);
63 gThreadClient.resume();
64 });
65 gDebuggee.a();
66 return d.promise;
67 }
69 function test_frame_location({ frame: { where: { url, line, column } } }) {
70 do_check_eq(url, "http://example.com/www/js/c.js");
71 do_check_eq(line, 2);
72 do_check_eq(column, 0);
73 }