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 | // Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | // http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 3 | |
michael@0 | 4 | testJSON('[', true); |
michael@0 | 5 | testJSON('[1', true); |
michael@0 | 6 | testJSON('[1,]', true); |
michael@0 | 7 | testJSON('[1,{', true); |
michael@0 | 8 | testJSON('[1,}', true); |
michael@0 | 9 | testJSON('[1,{]', true); |
michael@0 | 10 | testJSON('[1,}]', true); |
michael@0 | 11 | testJSON('[1,{"', true); |
michael@0 | 12 | testJSON('[1,}"', true); |
michael@0 | 13 | testJSON('[1,{"\\', true); |
michael@0 | 14 | testJSON('[1,}"\\', true); |
michael@0 | 15 | testJSON('[1,"', true); |
michael@0 | 16 | testJSON('[1,"\\', true); |
michael@0 | 17 | |
michael@0 | 18 | testJSON('{', true); |
michael@0 | 19 | testJSON('{1', true); |
michael@0 | 20 | testJSON('{,', true); |
michael@0 | 21 | testJSON('{"', true); |
michael@0 | 22 | testJSON('{"\\', true); |
michael@0 | 23 | testJSON('{"\\u', true); |
michael@0 | 24 | testJSON('{"\\uG', true); |
michael@0 | 25 | testJSON('{"\\u0', true); |
michael@0 | 26 | testJSON('{"\\u01', true); |
michael@0 | 27 | testJSON('{"\\u012', true); |
michael@0 | 28 | testJSON('{"\\u0123', true); |
michael@0 | 29 | testJSON('{"\\u0123"', true); |
michael@0 | 30 | testJSON('{"a"', true); |
michael@0 | 31 | testJSON('{"a"}', true); |
michael@0 | 32 | testJSON('{"a":', true); |
michael@0 | 33 | testJSON('{"a",}', true); |
michael@0 | 34 | testJSON('{"a":}', true); |
michael@0 | 35 | testJSON('{"a":,}', true); |
michael@0 | 36 | testJSON('{"a":5,}', true); |
michael@0 | 37 | testJSON('{"a":5,[', true); |
michael@0 | 38 | testJSON('{"a":5,"', true); |
michael@0 | 39 | testJSON('{"a":5,"', true); |
michael@0 | 40 | testJSON('{"a":5,"\\', true); |
michael@0 | 41 | testJSON("a[false ]".substring(1, 7) /* "[false" */, true); |
michael@0 | 42 | |
michael@0 | 43 | testJSON('this', true); |
michael@0 | 44 | |
michael@0 | 45 | testJSON('[1,{}]', false); |
michael@0 | 46 | testJSON('{}', false); |
michael@0 | 47 | testJSON('{"a":5}', false); |
michael@0 | 48 | testJSON('{"\\u0123":5}', false); |
michael@0 | 49 | |
michael@0 | 50 | /******************************************************************************/ |
michael@0 | 51 | |
michael@0 | 52 | if (typeof reportCompare === "function") |
michael@0 | 53 | reportCompare(true, true); |
michael@0 | 54 | |
michael@0 | 55 | print("Tests complete"); |