js/src/tests/js1_8/extensions/regress-415721.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 = 415721;
    11 var summary = 'jsatom.c double hashing re-validation logic is unsound';
    13 printStatus (summary);
    15 var VARS = 10000;
    16 var TRIES = 100;
    18 function atomizeStressTest() {
    19   var fn = "function f() {var ";
    20   for (var i = 0; i < VARS; i++)
    21     fn += '_f' + i + ', ';
    22   fn += 'q;}';
    24   function e() { eval(fn); }
    26   for (var i = 0; i < TRIES; i++) {
    27     scatter([e,e]);
    28     gc();
    29   }
    30 }
    32 var expect;
    33 var actual;
    35 expect = actual = 'No crash';
    36 if (typeof scatter == 'undefined' || typeof gc == 'undefined') {
    37   print('Test skipped. scatter or gc not defined.');
    38   expect = actual = 'Test skipped.';
    39 } else {
    40   atomizeStressTest();
    41 }
    43 reportCompare(expect, actual, summary);

mercurial