js/src/jit-test/tests/debug/Debugger-debuggees-19.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.

     1 // removeAllDebuggees removes all the debuggees.
     3 var dbg = new Debugger;
     5 // If we eval in a debuggee, log which debuggee it was.
     6 var log;
     7 dbg.onEnterFrame = function (frame) {
     8   log += 'e';
     9   log += frame.environment.object.label;
    10 };
    12 var g1 = newGlobal();
    13 log = '';
    14 g1.eval('Math');
    15 assertEq(log, '');              // not yet a debuggee
    17 var g1w = dbg.addDebuggee(g1);
    18 assertEq(g1w instanceof Debugger.Object, true);
    19 g1w.label = 'g1';
    20 log = '';
    21 g1.eval('Math');                // now a debuggee
    22 assertEq(log, 'eg1');
    24 var g2 = newGlobal();
    25 log = '';
    26 g1.eval('Math');                // debuggee
    27 g2.eval('Math');                // not a debuggee
    28 assertEq(log, 'eg1');
    30 var g2w = dbg.addDebuggee(g2);
    31 assertEq(g2w instanceof Debugger.Object, true);
    32 g2w.label = 'g2';
    33 log = '';
    34 g1.eval('Math');                // debuggee
    35 g2.eval('this');                // debuggee
    36 assertEq(log, 'eg1eg2');
    38 var a1 = dbg.getDebuggees();
    39 assertEq(a1.length, 2);
    41 assertEq(dbg.removeAllDebuggees(), undefined);
    42 var a2 = dbg.getDebuggees();
    43 assertEq(a2.length, 0);
    45 log = '';
    46 g1.eval('Math');                // no longer a debuggee
    47 g2.eval('this');                // no longer a debuggee
    48 assertEq(log, '');

mercurial