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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /*
7 * Date: 01 May 2001
8 *
9 * SUMMARY: Regression test for Bugzilla bug 76683 on Rhino:
10 * "RegExp regression (NullPointerException)"
11 *
12 * See http://bugzilla.mozilla.org/show_bug.cgi?id=76683
13 */
14 //-----------------------------------------------------------------------------
15 var i = 0;
16 var BUGNUMBER = 76683;
17 var summary = 'Regression test for Bugzilla bug 76683';
18 var status = '';
19 var statusmessages = new Array();
20 var pattern = '';
21 var patterns = new Array();
22 var string = '';
23 var strings = new Array();
24 var actualmatch = '';
25 var actualmatches = new Array();
26 var expectedmatch = '';
27 var expectedmatches = new Array();
30 /*
31 * Rhino (2001-04-19) crashed on the 3rd regular expression below.
32 * It didn't matter what the string was. No problem in SpiderMonkey -
33 */
34 string = 'abc';
35 status = inSection(1);
36 pattern = /(<!--([^-]|-[^-]|--[^>])*-->)|(<([\$\w:\.\-]+)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))/;
37 actualmatch = string.match(pattern);
38 expectedmatch = null;
39 addThis();
41 status = inSection(2);
42 pattern = /(<!--([^-]|-[^-]|--[^>])*-->)|(<(tagPattern)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))/;
43 actualmatch = string.match(pattern);
44 expectedmatch = null;
45 addThis();
47 // This was the one causing a Rhino crash -
48 status = inSection(3);
49 pattern = /(<!--([^-]|-[^-]|--[^>])*-->)|(<(tagPattern)((([ ][^\/>]*)?\/>)|(([ ][^>]*)?>)))|(<\/tagPattern[^>]*>)/;
50 actualmatch = string.match(pattern);
51 expectedmatch = null;
52 addThis();
56 //-------------------------------------------------------------------------------------------------
57 test();
58 //-------------------------------------------------------------------------------------------------
62 function addThis()
63 {
64 statusmessages[i] = status;
65 patterns[i] = pattern;
66 strings[i] = string;
67 actualmatches[i] = actualmatch;
68 expectedmatches[i] = expectedmatch;
69 i++;
70 }
73 function test()
74 {
75 enterFunc ('test');
76 printBugNumber(BUGNUMBER);
77 printStatus (summary);
78 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
79 exitFunc ('test');
80 }