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 // findScripts can filter scripts by global.
2 var g1 = newGlobal();
3 var g2 = newGlobal();
4 var g3 = newGlobal();
6 var dbg = new Debugger();
7 var g1w = dbg.addDebuggee(g1);
8 var g2w = dbg.addDebuggee(g2);
10 g1.eval('function f() {}');
11 g2.eval('function g() {}');
12 g2.eval('function h() {}');
13 var g1fw = g1w.makeDebuggeeValue(g1.f);
14 var g2gw = g2w.makeDebuggeeValue(g2.g);
16 var scripts;
18 scripts = dbg.findScripts({});
19 assertEq(scripts.indexOf(g1fw.script) != -1, true);
20 assertEq(scripts.indexOf(g2gw.script) != -1, true);
22 scripts = dbg.findScripts({global: g1});
23 assertEq(scripts.indexOf(g1fw.script) != -1, true);
24 assertEq(scripts.indexOf(g2gw.script) != -1, false);
26 scripts = dbg.findScripts({global: g2});
27 assertEq(scripts.indexOf(g1fw.script) != -1, false);
28 assertEq(scripts.indexOf(g2gw.script) != -1, true);
30 scripts = dbg.findScripts({global: g3});
31 // findScripts should only return debuggee scripts, and g3 isn't a
32 // debuggee, so this should be completely empty.
33 assertEq(scripts.length, 0);