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 g = { 'global noneval': 1 };
3 eval("g['global eval'] = 1");
5 // Function to step through and set breakpoints on
6 function f1() {
7 g['function noneval'] = 1;
8 eval("g['function eval'] = 1");
10 x = 1;
11 for (y = 0; y < 10; y++) {
12 x++;
13 }
14 for (y = 0; y < 3; y++) {
15 x++;
16 }
17 z = 3;
18 }
20 var f2 = new Function("g['function noneval'] = 2; eval(\"g['function eval'] = 2\")");
22 function testJSD(jsd) {
23 ok(jsd.isOn, "JSD needs to be running for this test.");
25 var numBreakpoints = 0;
27 f1();
28 f2();
29 jsd.topLevelHook = null;
30 jsd.functionHook = null;
31 dump("numGlobalNonevals="+numGlobalNonevals+"\n");
32 dump("numFunctionNonevals="+numFunctionNonevals+"\n");
33 dump("numGlobalEvals="+numGlobalEvals+"\n");
34 dump("numFunctionEvals="+numFunctionEvals+"\n");
36 ok(numFunctionNonevals == 3, "(fn) Should have hit f1(), testJSD(), and f2(); hit " + hits.fn);
37 ok(numGlobalNonevals == 1, "(gn) Overall script, hit " + hits.gn);
38 ok(numGlobalEvals == 1, "(ge) Eval in global area, hit " + hits.ge);
39 ok(numFunctionEvals == 2, "(fe) Evals within f1() and f2(), hit " + hits.fe);
41 if (!jsdOnAtStart) {
42 // turn JSD off if it wasn't on when this test started
43 jsd.off();
44 ok(!jsd.isOn, "JSD shouldn't be running at the end of this test.");
45 }
47 SimpleTest.finish();
48 }
50 testJSD(jsd);