Sat, 03 Jan 2015 20:18:00 +0100
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 load(libdir + "parallelarray-helpers.js");
3 // Tests that reduce saves its intermediate state correctly by
4 // inducing a bailout in the middle of the reduction. This test may
5 // fail to test what it is intended to test if the wrong number of
6 // worker threads etc are present. It reproduced an existing bug when
7 // used with 8 worker threads.
9 function testReduce() {
10 var aCounter = 0;
11 function sum(a, b) {
12 var r = a + b;
13 if (r == 234) // occurs once per slice
14 aCounter++;
15 return r;
16 }
18 // We use a big array, to make sure that the test runs with 64 slices.
19 var array = build(8 * 4096, function() { return 1; });
20 var seqResult = array.reduce(sum);
21 var seqCounter = aCounter;
23 aCounter = 0;
24 var parResult = array.reducePar(sum);
25 var parCounter = aCounter;
27 assertEq(true, parCounter >= seqCounter);
28 assertStructuralEq(parResult, seqResult);
29 }
31 if (getBuildConfiguration().parallelJS)
32 testReduce();