js/src/tests/js1_5/Regress/regress-191633.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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /*
     7  *
     8  * Date:    03 February 2003
     9  * SUMMARY: Testing script with huge number of comments
    10  *
    11  * See http://bugzilla.mozilla.org/show_bug.cgi?id=191633
    12  *
    13  */
    14 //-----------------------------------------------------------------------------
    15 var UBound = 0;
    16 var BUGNUMBER = 191633;
    17 var summary = 'Testing script with huge number of comments';
    18 var status = '';
    19 var statusitems = [];
    20 var actual = '';
    21 var actualvalues = [];
    22 var expect= '';
    23 var expectedvalues = [];
    26 status = inSection(1);
    27 actual = false; // initialize to failure
    28 var s = repeat_str("//\n", 40000); // Build a string of 40000 lines of comments
    29 eval(s + "actual = true;");
    30 expect = true;
    31 addThis();
    35 //-----------------------------------------------------------------------------
    36 test();
    37 //-----------------------------------------------------------------------------
    41 function repeat_str(str, repeat_count)
    42 {
    43   var arr = new Array(repeat_count);
    45   while (repeat_count != 0)
    46     arr[--repeat_count] = str;
    48   return str.concat.apply(str, arr);
    49 }
    52 function addThis()
    53 {
    54   statusitems[UBound] = status;
    55   actualvalues[UBound] = actual;
    56   expectedvalues[UBound] = expect;
    57   UBound++;
    58 }
    61 function test()
    62 {
    63   enterFunc('test');
    64   printBugNumber(BUGNUMBER);
    65   printStatus(summary);
    67   for (var i=0; i<UBound; i++)
    68   {
    69     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
    70   }
    72   exitFunc ('test');
    73 }

mercurial