js/src/tests/js1_5/Array/regress-310351.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 var BUGNUMBER = 310351;
     8 var summary = 'Convert host "list" objects to arrays';
     9 var actual = '';
    10 var expect = '';
    12 printBugNumber(BUGNUMBER);
    13 printStatus (summary);
    15 var nodeList = [];
    16 if (typeof document != 'undefined')
    17 {
    18   nodeList = document.getElementsByTagName('*');
    19 }
    20 else
    21 {
    22   printStatus('test using dummy array since no document available');
    23 }
    25 var array = Array.prototype.slice.call(nodeList, 0);
    27 expect = 'Array';
    28 actual = array.constructor.name;
    30 // nodeList is live and may change
    31 var saveLength = nodeList.length;
    33 reportCompare(expect, actual, summary + ': constructor test');
    35 expect = saveLength;
    36 actual = array.length;
    38 reportCompare(expect, actual, summary + ': length test');
    39 expect = true;
    40 actual = true;
    42 for (var i = 0; i < saveLength; i++)
    43 {
    44   if (array[i] != nodeList[i])
    45   {
    46     actual = false;
    47     summary += ' Comparison failed: array[' + i + ']=' + array[i] +
    48       ', nodeList[' + i + ']=' + nodeList[i];
    49     break;
    50   }
    51 }
    53 reportCompare(expect, actual, summary + ': identical elements test');

mercurial