js/src/tests/ecma/String/15.5.3.2-2.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/. */
     7 /**
     8    File Name:          15.5.3.2-2.js
     9    ECMA Section:       15.5.3.2  String.fromCharCode( char0, char1, ... )
    10    Description:        Return a string value containing as many characters
    11    as the number of arguments.  Each argument specifies
    12    one character of the resulting string, with the first
    13    argument specifying the first character, and so on,
    14    from left to right.  An argument is converted to a
    15    character by applying the operation ToUint16_t and
    16    regarding the resulting 16bit integeras the Unicode
    17    encoding of a character.  If no arguments are supplied,
    18    the result is the empty string.
    20    This tests String.fromCharCode with multiple arguments.
    22    Author:             christine@netscape.com
    23    Date:               2 october 1997
    24 */
    26 var SECTION = "15.5.3.2-2";
    27 var VERSION = "ECMA_1";
    28 startTest();
    29 var TITLE   = "String.fromCharCode()";
    31 writeHeaderToLog( SECTION + " "+ TITLE);
    33 new TestCase( SECTION,
    34 	      "var MYSTRING = String.fromCharCode(eval(\"var args=''; for ( i = 0x0020; i < 0x007f; i++ ) { args += ( i == 0x007e ) ? i : i + ', '; } args;\")); MYSTRING",
    35 	      " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",
    36 	      eval( "var MYSTRING = String.fromCharCode(" + eval("var args=''; for ( i = 0x0020; i < 0x007f; i++ ) { args += ( i == 0x007e ) ? i : i + ', '; } args;") +"); MYSTRING" ));
    38 new TestCase( SECTION,
    39 	      "MYSTRING.length",
    40 	      0x007f - 0x0020,
    41 	      MYSTRING.length );
    43 test();

mercurial