js/src/tests/js1_5/Regress/regress-404755.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 -- unreliable - based on GC timing
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 //-----------------------------------------------------------------------------
     8 var BUGNUMBER = 404755;
     9 var summary = 'Do not consume heap when deleting property';
    10 var actual = 'No leak';
    11 var expect = 'No leak';
    14 //-----------------------------------------------------------------------------
    15 test();
    16 //-----------------------------------------------------------------------------
    18 function test()
    19 {
    20   enterFunc ('test');
    21   printBugNumber(BUGNUMBER);
    22   printStatus (summary);
    24   var n = 1 << 22;
    25   var o = {};
    26   do {
    27     o[0] = 0;
    28     delete o[0]; 
    29   } while (--n != 0);
    31   gc();
    32   var time = Date.now();
    33   gc();
    34   time = Date.now() - time;
    36   o = {};
    37   o[0] = 0;
    38   delete o[0]; 
    39   gc();
    40   var time2 = Date.now();
    41   gc();
    42   time2 = Date.now() - time2;
    43   print(time+" "+time2);
    44   if (time > 2 && time > time2 * 5)
    45     throw "A possible leak is observed";
    47   reportCompare(expect, actual, summary);
    49   exitFunc ('test');
    50 }

mercurial