js/src/jit-test/tests/debug/Debugger-debuggees-25.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 // Turning debugger off global at a time.
michael@0 2
michael@0 3 var g1 = newGlobal();
michael@0 4 var g2 = newGlobal();
michael@0 5 var g3 = newGlobal();
michael@0 6
michael@0 7 g1.eval("" + function f() {
michael@0 8 var name = "f";
michael@0 9 g();
michael@0 10 return name;
michael@0 11 });
michael@0 12 g2.eval("" + function g() {
michael@0 13 var name = "g";
michael@0 14 h();
michael@0 15 return name;
michael@0 16 });
michael@0 17 g3.eval("" + function h() {
michael@0 18 var name = "h";
michael@0 19 toggle();
michael@0 20 return name;
michael@0 21 });
michael@0 22
michael@0 23 g1.g = g2.g;
michael@0 24 g2.h = g3.h;
michael@0 25
michael@0 26 function name(f) {
michael@0 27 return f.environment.getVariable("name");
michael@0 28 }
michael@0 29
michael@0 30 var dbg = new Debugger;
michael@0 31 g3.toggle = function () {
michael@0 32 var frame;
michael@0 33
michael@0 34 // Add all globals.
michael@0 35 dbg.addDebuggee(g1);
michael@0 36 dbg.addDebuggee(g3);
michael@0 37 dbg.addDebuggee(g2);
michael@0 38
michael@0 39 // Remove one at a time.
michael@0 40 dbg.removeDebuggee(g3);
michael@0 41 assertEq(name(dbg.getNewestFrame()), "g");
michael@0 42 dbg.removeDebuggee(g2);
michael@0 43 assertEq(name(dbg.getNewestFrame()), "f");
michael@0 44 dbg.removeDebuggee(g1);
michael@0 45 };
michael@0 46
michael@0 47 g1.eval("(" + function () { f(); } + ")();");
michael@0 48

mercurial