js/src/tests/js1_7/iterable/regress-341815.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-if(!xulRuntime.shell) -- bug xxx - fails to dismiss alert
     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 = 341815;
     9 var summary = 'Close hook crash';
    10 var actual = 'No Crash';
    11 var expect = 'No Crash';
    13 var ialert = 0;
    14 //-----------------------------------------------------------------------------
    15 //test();
    16 //-----------------------------------------------------------------------------
    18 function test()
    19 {
    20   enterFunc ('test');
    21   printBugNumber(BUGNUMBER);
    22   printStatus (summary);
    24   var globalToPokeGC = {};
    26   function make_iterator()
    27   {
    28     function generator() {
    29       try {
    30         yield 0;
    31       } finally {
    32         make_iterator();
    33       }
    34     }
    35     generator().next();
    36     globalToPokeGC = {};
    37     if (typeof alert != 'undefined')
    38     {
    39       alert(++ialert);
    40     }
    41   }
    43   make_iterator();
    45   for (var i = 0; i != 50000; ++i) {
    46     var x = {};
    47   }
    49   print('done');
    51   setTimeout('checkTest()', 10000);
    53   exitFunc ('test');
    54 }
    56 function init()
    57 {
    58   // give the dialog closer time to register
    59   setTimeout('test()', 5000);
    60 }
    62 var lastialert = 0;
    64 function checkTest()
    65 {
    66   // this function is used to check if there
    67   // additional alerts are still being fired 
    68   // in order to prevent the test from completing
    69   // until all alerts have finished.
    71   if (ialert != lastialert)
    72   {
    73     lastialert = ialert;
    74     setTimeout('checkTest()', 10000);
    75     return;
    76   }
    78   reportCompare(expect, actual, summary);
    79   gDelayTestDriverEnd = false;
    80   jsTestDriverEnd();
    81 }
    83 if (typeof window != 'undefined')
    84 {
    85   // delay test driver end
    86   gDelayTestDriverEnd = true;
    88   window.addEventListener("load", init, false);
    89 }
    90 else
    91 {
    92   reportCompare(expect, actual, summary);
    93 }

mercurial