js/src/tests/js1_8_5/extensions/sps-generators.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)
     3 // Any copyright is dedicated to the Public Domain.
     4 // http://creativecommons.org/licenses/publicdomain/
     6 //-----------------------------------------------------------------------------
     7 var BUGNUMBER = 822041;
     8 var summary = "Live generators should not cache SPS state";
    10 print(BUGNUMBER + ": " + summary);
    12 function gen() {
    13   var x = yield turnoff();
    14   yield x;
    15   yield 'bye';
    16 }
    18 function turnoff() {
    19   print("Turning off profiler\n");
    20   disableSPSProfiling();
    21   return 'hi';
    22 }
    24 for (var slowAsserts of [ true, false ]) {
    25   // The slowAssertions setting is not expected to matter
    26   enableSPSProfilingAssertions(slowAsserts);
    28   g = gen();
    29   assertEq(g.next(), 'hi');
    30   assertEq(g.send('gurgitating...'), 'gurgitating...');
    31   for (var x in g)
    32     assertEq(x, 'bye');
    33 }
    35 // This is really a crashtest
    36 reportCompare(0, 0, 'ok');

mercurial