js/src/jit-test/tests/debug/Debugger-findScripts-02.js

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 // In a debuggee with functions, findScripts finds those functions' scripts.
     3 var g = newGlobal();
     4 g.eval('function f(){}');
     5 g.eval('function g(){}');
     6 g.eval('function h(){}');
     8 var dbg = new Debugger();
     9 var gw = dbg.addDebuggee(g);
    10 var fw = gw.makeDebuggeeValue(g.f);
    11 var gw = gw.makeDebuggeeValue(g.g);
    12 var hw = gw.makeDebuggeeValue(g.h);
    14 assertEq(dbg.findScripts().indexOf(fw.script) != -1, true);
    15 assertEq(dbg.findScripts().indexOf(gw.script) != -1, true);
    16 assertEq(dbg.findScripts().indexOf(hw.script) != -1, true);

mercurial