js/src/tests/js1_8/extensions/regress-479381.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 // |reftest| skip
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /*
     4  * Any copyright is dedicated to the Public Domain.
     5  * http://creativecommons.org/licenses/publicdomain/
     6  * Contributor: Jason Orendorff
     7  */
     9 //-----------------------------------------------------------------------------
    10 var BUGNUMBER = 479381;
    11 var summary = 'Do not crash @ js_FinalizeStringRT with multi-threads.';
    12 var actual = '';
    13 var expect = '';
    16 //-----------------------------------------------------------------------------
    17 test();
    18 //-----------------------------------------------------------------------------
    20 function test()
    21 {
    22   enterFunc ('test');
    23   printBugNumber(BUGNUMBER);
    24   printStatus (summary);
    26   if (typeof gczeal != 'function' || typeof scatter != 'function')
    27   {
    28     print(expect = actual = 'Test skipped: requires mulithreads');
    29   }
    30   else
    31   {
    32     expect = actual = 'No Crash';
    34     gczeal(2);
    36     function f() {
    37       var s;
    38       for (var i = 0; i < 9999; i++)
    39         s = 'a' + String(i)[3] + 'b';
    40       return s;
    41     }
    43     print(scatter([f, f, f, f]));
    45     gczeal(0);
    46   }
    48   reportCompare(expect, actual, summary);
    50   exitFunc ('test');
    51 }

mercurial