js/src/tests/js1_8_5/regress/regress-610026.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: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /*
     3  * Any copyright is dedicated to the Public Domain.
     4  * http://creativecommons.org/licenses/publicdomain/
     5  */
     7 var expect = "pass";
     8 var actual;
    10 /*
    11  * We hardcode here that GenerateBlockId limits a program to 2^20 blocks. Start
    12  * with 2^19 blocks, then test 2^20 - 1 blocks, finally test the limit.
    13  */
    14 var s = "{}";
    15 for (var i = 0; i < 21; i++)
    16     s += s;
    18 try {
    19     eval(s);
    20     actual = "pass";
    21 } catch (e) {
    22     actual = "fail: " + e;
    23 }
    25 assertEq(actual, expect);
    27 s += s.slice(0, -2);
    29 try {
    30     eval(s);
    31     actual = "pass";
    32 } catch (e) {
    33     actual = "fail: " + e;
    34 }
    36 assertEq(actual, expect);
    38 s += "{}";
    40 try {
    41     eval(s);
    42     actual = "fail: expected InternalError: program too large";
    43 } catch (e) {
    44     actual = (e.message == "program too large") ? "pass" : "fail: " + e;
    45 }
    47 assertEq(actual, expect);
    49 reportCompare(0, 0, "ok");

mercurial