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 *
8 * Date: 31 August 2002
9 * SUMMARY: RegExp conformance test
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=169497
11 *
12 */
13 //-----------------------------------------------------------------------------
14 var i = 0;
15 var BUGNUMBER = 169497;
16 var summary = 'RegExp conformance test';
17 var status = '';
18 var statusmessages = new Array();
19 var pattern = '';
20 var patterns = new Array();
21 var sBody = '';
22 var sHTML = '';
23 var string = '';
24 var strings = new Array();
25 var actualmatch = '';
26 var actualmatches = new Array();
27 var expectedmatch = '';
28 var expectedmatches = new Array();
30 sBody += '<body onXXX="alert(event.type);">\n';
31 sBody += '<p>Kibology for all<\/p>\n';
32 sBody += '<p>All for Kibology<\/p>\n';
33 sBody += '<\/body>';
35 sHTML += '<html>\n';
36 sHTML += sBody;
37 sHTML += '\n<\/html>';
39 status = inSection(1);
40 string = sHTML;
41 pattern = /<body.*>((.*\n?)*?)<\/body>/i;
42 actualmatch = string.match(pattern);
43 expectedmatch = Array(sBody, '\n<p>Kibology for all</p>\n<p>All for Kibology</p>\n', '<p>All for Kibology</p>\n');
44 addThis();
48 //-------------------------------------------------------------------------------------------------
49 test();
50 //-------------------------------------------------------------------------------------------------
53 function addThis()
54 {
55 statusmessages[i] = status;
56 patterns[i] = pattern;
57 strings[i] = string;
58 actualmatches[i] = actualmatch;
59 expectedmatches[i] = expectedmatch;
60 i++;
61 }
64 function test()
65 {
66 enterFunc ('test');
67 printBugNumber(BUGNUMBER);
68 printStatus (summary);
69 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
70 exitFunc ('test');
71 }