js/src/jit-test/tests/debug/Debugger-debuggees-20.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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 // addAllGlobalsAsDebuggees adds all the globals as debuggees.
michael@0 2
michael@0 3 var g1 = newGlobal(); // Created before the Debugger; debuggee.
michael@0 4 var g2 = newGlobal(); // Created before the Debugger; not debuggee.
michael@0 5
michael@0 6 var dbg = new Debugger;
michael@0 7
michael@0 8 var g3 = newGlobal(); // Created after the Debugger; debuggee.
michael@0 9 var g4 = newGlobal(); // Created after the Debugger; not debuggee.
michael@0 10
michael@0 11 var g1w = dbg.addDebuggee(g1);
michael@0 12 assertEq(dbg.addAllGlobalsAsDebuggees(), undefined);
michael@0 13
michael@0 14 // Get Debugger.Objects viewing the globals from their own compartments;
michael@0 15 // this is the sort that findAllGlobals and addDebuggee return.
michael@0 16 var g1w = g1w.makeDebuggeeValue(g1).unwrap();
michael@0 17 var g2w = g1w.makeDebuggeeValue(g2).unwrap();
michael@0 18 var g3w = g1w.makeDebuggeeValue(g3).unwrap();
michael@0 19 var g4w = g1w.makeDebuggeeValue(g4).unwrap();
michael@0 20 var thisw = g1w.makeDebuggeeValue(this).unwrap();
michael@0 21
michael@0 22 // Check that they're all there.
michael@0 23 assertEq(dbg.hasDebuggee(g1w), true);
michael@0 24 assertEq(dbg.hasDebuggee(g2w), true);
michael@0 25 assertEq(dbg.hasDebuggee(g3w), true);
michael@0 26 assertEq(dbg.hasDebuggee(g4w), true);
michael@0 27 // The debugger's global is not a debuggee.
michael@0 28 assertEq(dbg.hasDebuggee(thisw), false);

mercurial