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 | // Binary: cache/js-dbg-32-17af008937e3-linux |
michael@0 | 2 | // Flags: -m -n -a |
michael@0 | 3 | // |
michael@0 | 4 | var lfcode = new Array(); |
michael@0 | 5 | lfcode.push("\ |
michael@0 | 6 | var gTestcases = new Array();\ |
michael@0 | 7 | var gTc = gTestcases.length;\ |
michael@0 | 8 | function TestCase(n, d, e, a) {\ |
michael@0 | 9 | this.passed = getTestCaseResult(e, a);\ |
michael@0 | 10 | this.bugnumber = typeof(BUGNUMER) != 'undefined' ? BUGNUMBER : '';\ |
michael@0 | 11 | gTestcases[gTc++] = this;\ |
michael@0 | 12 | }\ |
michael@0 | 13 | for (var i=0; i<len; i++) {}\ |
michael@0 | 14 | function reportCompare (expected, actual, description) {\ |
michael@0 | 15 | var testcase = new TestCase(\"unknown-test-name\", description, expected, actual);\ |
michael@0 | 16 | if (testcase.passed)\ |
michael@0 | 17 | printStatus (\"Expected match to '\" + toPrinted(expectedRegExp) + \"' matched actual value '\" + toPrinted(actual) + \"'\");\ |
michael@0 | 18 | }\ |
michael@0 | 19 | function getTestCaseResult(expected, actual)\ |
michael@0 | 20 | function stopTest() {}\ |
michael@0 | 21 | "); |
michael@0 | 22 | lfcode.push("\ |
michael@0 | 23 | var UBound = 0;\ |
michael@0 | 24 | var TEST_PASSED = 'SyntaxError';\ |
michael@0 | 25 | var TEST_FAILED = 'Generated an error, but NOT a SyntaxError!';\ |
michael@0 | 26 | var statusitems = [];\ |
michael@0 | 27 | var actualvalues = [];\ |
michael@0 | 28 | var expectedvalues = [];\ |
michael@0 | 29 | testThis(' /a**/ ');\ |
michael@0 | 30 | testThis(' /a***/ ');\ |
michael@0 | 31 | testThis(' /a++/ ');\ |
michael@0 | 32 | testThis(' /a+++/ ');\ |
michael@0 | 33 | testThis(' /a???/ ');\ |
michael@0 | 34 | testThis(' /a????/ ');\ |
michael@0 | 35 | testThis(' /+a/ ');\ |
michael@0 | 36 | testThis(' /++a/ ');\ |
michael@0 | 37 | testThis(' /?a/ ');\ |
michael@0 | 38 | testThis(' /??a/ ');\ |
michael@0 | 39 | testThis(' /x{1}{1}/ ');\ |
michael@0 | 40 | testThis(' /x{1,}{1}/ ');\ |
michael@0 | 41 | testThis(' /x{1,2}{1}/ ');\ |
michael@0 | 42 | testThis(' /x{1}{1,}/ ');\ |
michael@0 | 43 | testThis(' /x{1,}{1,}/ ');\ |
michael@0 | 44 | testThis(' /x{1,2}{1,}/ ');\ |
michael@0 | 45 | testThis(' /x{1}{1,2}/ ');\ |
michael@0 | 46 | testThis(' /x{1,}{1,2}/ ');\ |
michael@0 | 47 | function testThis(sInvalidSyntax) {\ |
michael@0 | 48 | try {\ |
michael@0 | 49 | eval(sInvalidSyntax);\ |
michael@0 | 50 | } catch(e) {\ |
michael@0 | 51 | actual = TEST_PASSED;\ |
michael@0 | 52 | }\ |
michael@0 | 53 | }\ |
michael@0 | 54 | function checkThis(sAllowedSyntax) {}\ |
michael@0 | 55 | reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);\ |
michael@0 | 56 | exitFunc ('test');\ |
michael@0 | 57 | "); |
michael@0 | 58 | lfcode.push("gczeal(4);"); |
michael@0 | 59 | lfcode.push("\ |
michael@0 | 60 | var MSG_PATTERN = '\\nregexp = ';\ |
michael@0 | 61 | var MSG_STRING = '\\nstring = ';\ |
michael@0 | 62 | var MSG_EXPECT = '\\nExpect: ';\ |
michael@0 | 63 | var MSG_ACTUAL = '\\nActual: ';\ |
michael@0 | 64 | var TYPE_STRING = typeof 'abc';\ |
michael@0 | 65 | function testRegExp(statuses, patterns, strings, actualmatches, expectedmatches)\ |
michael@0 | 66 | lExpect = expectedmatch.length;\ |
michael@0 | 67 | lActual = actualmatch.length;\ |
michael@0 | 68 | var expected = formatArray(expectedmatch);\ |
michael@0 | 69 | reportCompare(expected, actual, state + ERR_MATCH + CHAR_NL );\ |
michael@0 | 70 | function getState(status, pattern, string) {\ |
michael@0 | 71 | var delim = CHAR_COMMA + CHAR_SPACE;\ |
michael@0 | 72 | "); |
michael@0 | 73 | lfcode.push("\ |
michael@0 | 74 | var gTestcases = new Array;\ |
michael@0 | 75 | function TestCase(n, d, e, a) {}\ |
michael@0 | 76 | function toPrinted(value) value=value.replace(/\\\\n/g, 'NL').replace(/[^\\x20-\\x7E]+/g, escapeString);\ |
michael@0 | 77 | "); |
michael@0 | 78 | lfcode.push("\ |
michael@0 | 79 | var summary = 'Regression test for bug 385393';\ |
michael@0 | 80 | var expect = 'No Crash';\ |
michael@0 | 81 | reportCompare(expect, actual, summary);\ |
michael@0 | 82 | "); |
michael@0 | 83 | while (true) { |
michael@0 | 84 | var file = lfcode.shift(); if (file == undefined) { break; } |
michael@0 | 85 | loadFile(file); |
michael@0 | 86 | } |
michael@0 | 87 | function loadFile(lfVarx) { |
michael@0 | 88 | try { |
michael@0 | 89 | if (lfVarx.substr(-3) == ".js") { |
michael@0 | 90 | switch (lfRunTypeId) { } |
michael@0 | 91 | } else { |
michael@0 | 92 | evaluate(lfVarx); |
michael@0 | 93 | } |
michael@0 | 94 | } catch (lfVare) { } |
michael@0 | 95 | } |