js/src/jit-test/tests/debug/onEnterFrame-01.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 // Basic enterFrame hook tests.
     3 var g = newGlobal();
     4 var dbg = Debugger(g);
     5 var type;
     6 dbg.onEnterFrame = function (frame) {
     7     try {
     8         assertEq(frame instanceof Debugger.Frame, true);
     9         assertEq(frame.live, true);
    10         type = frame.type;
    11     } catch (exc) {
    12         type = "Exception thrown: " + exc;
    13     }
    14 };
    16 function test(f, expected) {
    17     type = undefined;
    18     f();
    19     assertEq(type, expected);
    20 }
    22 // eval triggers the hook
    23 test(function () { g.eval("function h() { return 1; }"); }, "eval");
    25 // function calls trigger it
    26 test(function () { assertEq(g.h(), 1); }, "call");
    28 // global scripts trigger it
    29 test(function () { g.evaluate("var x = 5;"); assertEq(g.x, 5); }, "global");

mercurial