js/src/jit-test/tests/debug/Debugger-debuggees-04.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 // hasDebuggee tests.
     3 var g1 = newGlobal(), g1w;
     4 g1.eval("var g2 = newGlobal('same-compartment')");
     5 var g2 = g1.g2;
     6 var g1w, g2w;
     8 var dbg = new Debugger;
     9 function checkHas(hasg1, hasg2) {
    10     assertEq(dbg.hasDebuggee(g1), hasg1);
    11     if (typeof g1w === 'object')
    12         assertEq(dbg.hasDebuggee(g1w), hasg1);
    13     assertEq(dbg.hasDebuggee(g2), hasg2);
    14     if (typeof g2w === 'object')
    15         assertEq(dbg.hasDebuggee(g2w), hasg2);
    16 }
    18 checkHas(false, false);
    19 g1w = dbg.addDebuggee(g1);
    20 checkHas(true, false);
    21 g2w = dbg.addDebuggee(g2);
    22 checkHas(true, true);
    23 dbg.removeDebuggee(g1w);
    24 checkHas(false, true);
    25 dbg.removeDebuggee(g2);
    26 checkHas(false, false);

mercurial