js/src/tests/js1_5/extensions/regress-336409-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.

michael@0 1 // |reftest| skip-if(!xulRuntime.shell&&((Android||(isDebugBuild&&xulRuntime.OS=="Linux")||xulRuntime.XPCOMABI.match(/x86_64/)))) slow -- can fail silently due to out of memory, bug 615011 - timeouts on slow debug Linux
michael@0 2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 //-----------------------------------------------------------------------------
michael@0 8 var BUGNUMBER = 336409;
michael@0 9 var summary = 'Integer overflow in js_obj_toSource';
michael@0 10 var actual = 'No Crash';
michael@0 11 var expect = /(No Crash|InternalError: allocation size overflow|out of memory)/;
michael@0 12
michael@0 13 printBugNumber(BUGNUMBER);
michael@0 14 printStatus (summary);
michael@0 15
michael@0 16 expectExitCode(0);
michael@0 17 expectExitCode(5);
michael@0 18
michael@0 19 function createString(n)
michael@0 20 {
michael@0 21 var l = n*1024*1024;
michael@0 22 var r = 'r';
michael@0 23
michael@0 24 while (r.length < l)
michael@0 25 {
michael@0 26 r = r + r;
michael@0 27 }
michael@0 28 return r;
michael@0 29 }
michael@0 30
michael@0 31 try
michael@0 32 {
michael@0 33 var n = 128;
michael@0 34 printStatus('Creating ' + n + 'MB string');
michael@0 35 var r = createString(n);
michael@0 36 printStatus('Done. length = ' + r.length);
michael@0 37 printStatus('Creating object');
michael@0 38 var o = {f1: r, f2: r, f3: r,f4: r,f5: r, f6: r, f7: r, f8: r,f9: r};
michael@0 39 printStatus('object.toSource()');
michael@0 40 var rr = o.toSource();
michael@0 41 printStatus('Done.');
michael@0 42 }
michael@0 43 catch(ex)
michael@0 44 {
michael@0 45 actual = ex + '';
michael@0 46 print(actual);
michael@0 47 }
michael@0 48
michael@0 49 reportMatch(expect, actual, summary);

mercurial