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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | /* |
michael@0 | 7 | * Date: 16 May 2001 |
michael@0 | 8 | * |
michael@0 | 9 | * SUMMARY: Regression test for bug 76054 |
michael@0 | 10 | * |
michael@0 | 11 | * See http://bugzilla.mozilla.org/show_bug.cgi?id=76054 |
michael@0 | 12 | * See http://bugzilla.mozilla.org/show_bug.cgi?id=78706 |
michael@0 | 13 | * All String HTML methods should be LOWER case - |
michael@0 | 14 | */ |
michael@0 | 15 | //----------------------------------------------------------------------------- |
michael@0 | 16 | var UBound = 0; |
michael@0 | 17 | var BUGNUMBER = 76054; |
michael@0 | 18 | var summary = 'Testing that String HTML methods produce all lower-case'; |
michael@0 | 19 | var statprefix = 'Currently testing String.'; |
michael@0 | 20 | var status = ''; |
michael@0 | 21 | var statusitems = [ ]; |
michael@0 | 22 | var actual = ''; |
michael@0 | 23 | var actualvalues = [ ]; |
michael@0 | 24 | var expect= ''; |
michael@0 | 25 | var expectedvalues = [ ]; |
michael@0 | 26 | var s = 'xyz'; |
michael@0 | 27 | |
michael@0 | 28 | status = 'anchor()'; |
michael@0 | 29 | actual = s.anchor(); |
michael@0 | 30 | expect = actual.toLowerCase(); |
michael@0 | 31 | addThis(); |
michael@0 | 32 | |
michael@0 | 33 | status = 'big()'; |
michael@0 | 34 | actual = s.big(); |
michael@0 | 35 | expect = actual.toLowerCase(); |
michael@0 | 36 | addThis(); |
michael@0 | 37 | |
michael@0 | 38 | status = 'blink()'; |
michael@0 | 39 | actual = s.blink(); |
michael@0 | 40 | expect = actual.toLowerCase(); |
michael@0 | 41 | addThis(); |
michael@0 | 42 | |
michael@0 | 43 | status = 'bold()'; |
michael@0 | 44 | actual = s.bold(); |
michael@0 | 45 | expect = actual.toLowerCase(); |
michael@0 | 46 | addThis(); |
michael@0 | 47 | |
michael@0 | 48 | status = 'italics()'; |
michael@0 | 49 | actual = s.italics(); |
michael@0 | 50 | expect = actual.toLowerCase(); |
michael@0 | 51 | addThis(); |
michael@0 | 52 | |
michael@0 | 53 | status = 'fixed()'; |
michael@0 | 54 | actual = s.fixed(); |
michael@0 | 55 | expect = actual.toLowerCase(); |
michael@0 | 56 | addThis(); |
michael@0 | 57 | |
michael@0 | 58 | status = 'fontcolor()'; |
michael@0 | 59 | actual = s.fontcolor(); |
michael@0 | 60 | expect = actual.toLowerCase(); |
michael@0 | 61 | addThis(); |
michael@0 | 62 | |
michael@0 | 63 | status = 'fontsize()'; |
michael@0 | 64 | actual = s.fontsize(); |
michael@0 | 65 | expect = actual.toLowerCase(); |
michael@0 | 66 | addThis(); |
michael@0 | 67 | |
michael@0 | 68 | status = 'link()'; |
michael@0 | 69 | actual = s.link(); |
michael@0 | 70 | expect = actual.toLowerCase(); |
michael@0 | 71 | addThis(); |
michael@0 | 72 | |
michael@0 | 73 | status = 'small()'; |
michael@0 | 74 | actual = s.small(); |
michael@0 | 75 | expect = actual.toLowerCase(); |
michael@0 | 76 | addThis(); |
michael@0 | 77 | |
michael@0 | 78 | status = 'strike()'; |
michael@0 | 79 | actual = s.strike(); |
michael@0 | 80 | expect = actual.toLowerCase(); |
michael@0 | 81 | addThis(); |
michael@0 | 82 | |
michael@0 | 83 | status = 'sub()'; |
michael@0 | 84 | actual = s.sub(); |
michael@0 | 85 | expect = actual.toLowerCase(); |
michael@0 | 86 | addThis(); |
michael@0 | 87 | |
michael@0 | 88 | status = 'sup()'; |
michael@0 | 89 | actual = s.sup(); |
michael@0 | 90 | expect = actual.toLowerCase(); |
michael@0 | 91 | addThis(); |
michael@0 | 92 | |
michael@0 | 93 | |
michael@0 | 94 | //------------------------------------------------------------------------------------------------- |
michael@0 | 95 | test(); |
michael@0 | 96 | //------------------------------------------------------------------------------------------------- |
michael@0 | 97 | |
michael@0 | 98 | |
michael@0 | 99 | function addThis() |
michael@0 | 100 | { |
michael@0 | 101 | statusitems[UBound] = status; |
michael@0 | 102 | actualvalues[UBound] = actual; |
michael@0 | 103 | expectedvalues[UBound] = expect; |
michael@0 | 104 | UBound++; |
michael@0 | 105 | } |
michael@0 | 106 | |
michael@0 | 107 | |
michael@0 | 108 | function test() |
michael@0 | 109 | { |
michael@0 | 110 | enterFunc ('test'); |
michael@0 | 111 | printBugNumber(BUGNUMBER); |
michael@0 | 112 | printStatus (summary); |
michael@0 | 113 | |
michael@0 | 114 | for (var i = 0; i < UBound; i++) |
michael@0 | 115 | { |
michael@0 | 116 | reportCompare(expectedvalues[i], actualvalues[i], getStatus(i)); |
michael@0 | 117 | } |
michael@0 | 118 | |
michael@0 | 119 | exitFunc ('test'); |
michael@0 | 120 | } |
michael@0 | 121 | |
michael@0 | 122 | |
michael@0 | 123 | function getStatus(i) |
michael@0 | 124 | { |
michael@0 | 125 | return statprefix + statusitems[i]; |
michael@0 | 126 | } |