toolkit/devtools/server/tests/unit/test_frameclient-02.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 var gDebuggee;
     5 var gClient;
     6 var gThreadClient;
     8 function run_test()
     9 {
    10   initTestDebuggerServer();
    11   gDebuggee = addTestGlobal("test-stack");
    12   gClient = new DebuggerClient(DebuggerServer.connectPipe());
    13   gClient.connect(function() {
    14     attachTestTabAndResume(gClient, "test-stack", function(aResponse, aTabClient, aThreadClient) {
    15       gThreadClient = aThreadClient;
    16       test_pause_frame();
    17     });
    18   });
    19   do_test_pending();
    20 }
    22 function test_pause_frame()
    23 {
    24   gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) {
    25     // Ask for exactly the number of frames we expect.
    26     gThreadClient.addOneTimeListener("framesadded", function() {
    27       do_check_false(gThreadClient.moreFrames);
    28       gThreadClient.resume(function() {
    29         finishClient(gClient);
    30       });
    31     });
    32     do_check_true(gThreadClient.fillFrames(3));
    33   });
    35   gDebuggee.eval("(" + function() {
    36     var recurseLeft = 1;
    37     function recurse() {
    38       if (--recurseLeft == 0) {
    39         debugger;
    40         return;
    41       }
    42       recurse();
    43     };
    44     recurse();
    45   } + ")()");
    46 }

mercurial