toolkit/devtools/server/tests/unit/test_objectgrips-07.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 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 /**
     5  * This test checks that objects which are not extensible report themselves as
     6  * such.
     7  */
     9 var gDebuggee;
    10 var gClient;
    11 var gThreadClient;
    13 function run_test()
    14 {
    15   initTestDebuggerServer();
    16   gDebuggee = addTestGlobal("test-grips");
    17   gDebuggee.eval(function stopMe(arg1, arg2, arg3, arg4) {
    18     debugger;
    19   }.toString());
    21   gClient = new DebuggerClient(DebuggerServer.connectPipe());
    22   gClient.connect(function() {
    23     attachTestTabAndResume(gClient, "test-grips", function(aResponse, aTabClient, aThreadClient) {
    24       gThreadClient = aThreadClient;
    25       test_object_grip();
    26     });
    27   });
    28   do_test_pending();
    29 }
    31 function test_object_grip()
    32 {
    33   gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) {
    34     let [f, s, ne, e] = aPacket.frame.arguments;
    35     let [fClient, sClient, neClient, eClient] = aPacket.frame.arguments.map(
    36       a => gThreadClient.pauseGrip(a));
    38     do_check_false(f.extensible);
    39     do_check_false(fClient.isExtensible);
    41     do_check_false(s.extensible);
    42     do_check_false(sClient.isExtensible);
    44     do_check_false(ne.extensible);
    45     do_check_false(neClient.isExtensible);
    47     do_check_true(e.extensible);
    48     do_check_true(eClient.isExtensible);
    50     gThreadClient.resume(_ => {
    51       finishClient(gClient);
    52     });
    53   });
    55   gDebuggee.eval("(" + function () {
    56     let f = {};
    57     Object.freeze(f);
    58     let s = {};
    59     Object.seal(s);
    60     let ne = {};
    61     Object.preventExtensions(ne);
    62     stopMe(f, s, ne, {});
    63   } + "())");
    64 }

mercurial