toolkit/devtools/server/tests/unit/test_getyoungestframe.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 function run_test()
     2 {
     3   Components.utils.import("resource://gre/modules/jsdebugger.jsm");
     4   addDebuggerToGlobal(this);
     5   var xpcInspector = Cc["@mozilla.org/jsinspector;1"].getService(Ci.nsIJSInspector);
     6   var g = testGlobal("test1");
     8   var dbg = new Debugger();
     9   dbg.uncaughtExceptionHook = testExceptionHook;
    11   dbg.addDebuggee(g);
    12   dbg.onDebuggerStatement = function(aFrame) {
    13     do_check_true(aFrame === dbg.getNewestFrame());
    14     // Execute from the nested event loop, dbg.getNewestFrame() won't
    15     // be working anymore.
    17     do_execute_soon(function() {
    18       try {
    19         do_check_true(aFrame === dbg.getNewestFrame());
    20       } finally {
    21         xpcInspector.exitNestedEventLoop("test");
    22       }
    23     });
    24     xpcInspector.enterNestedEventLoop("test");
    25   };
    27   g.eval("function debuggerStatement() { debugger; }; debuggerStatement();");
    29   dbg.enabled = false;
    30 }

mercurial