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-64-d51bd1645a2f-linux |
michael@0 | 2 | // Flags: -m -n -a |
michael@0 | 3 | // |
michael@0 | 4 | gczeal(4); |
michael@0 | 5 | var callStack = new Array(); |
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.name = n; |
michael@0 | 10 | this.description = d; |
michael@0 | 11 | this.expect = e; |
michael@0 | 12 | this.actual = a; |
michael@0 | 13 | this.passed = getTestCaseResult(e, a); |
michael@0 | 14 | this.reason = ''; |
michael@0 | 15 | this.bugnumber = ''; |
michael@0 | 16 | this.type = (typeof window == 'undefined' ? 'shell' : 'browser'); |
michael@0 | 17 | gTestcases[gTc++] = this; |
michael@0 | 18 | } |
michael@0 | 19 | function enterFunc (funcName) { |
michael@0 | 20 | try { throw foo; } catch(ex) {} |
michael@0 | 21 | } |
michael@0 | 22 | function getTestCaseResult(expected, actual) {} |
michael@0 | 23 | function writeHeaderToLog( string ) {} |
michael@0 | 24 | var lfcode = new Array(); |
michael@0 | 25 | lfcode.push("\ |
michael@0 | 26 | var code = ''; \ |
michael@0 | 27 | code+=createCode((gczeal(2))); \ |
michael@0 | 28 | function createCode(i) { \ |
michael@0 | 29 | jstop+= + delete + i + \" string.';\"; \ |
michael@0 | 30 | } \ |
michael@0 | 31 | "); |
michael@0 | 32 | lfcode.push("\ |
michael@0 | 33 | var SECTION = '9.9-1'; \ |
michael@0 | 34 | new TestCase( SECTION, '(Object(true)).__proto__', Boolean.prototype, (Object(true)).__proto__ ); \ |
michael@0 | 35 | new TestCase( SECTION, '(Object(1)).__proto__', Number.prototype, (Object(1)).__proto__ ); \ |
michael@0 | 36 | new TestCase( SECTION, '(Object(-1)).__proto__', Number.prototype, (Object(-1)).__proto__ ); \ |
michael@0 | 37 | new TestCase( SECTION, '(Object(Number.MAX_VALUE)).__proto__', Number.prototype, (Object(Number.MAX_VALUE)).__proto__ ); \ |
michael@0 | 38 | new TestCase( SECTION, '(Object(Number.MIN_VALUE)).__proto__', Number.prototype, (Object(Number.MIN_VALUE)).__proto__ ); \ |
michael@0 | 39 | new TestCase( SECTION, '(Object(Number.POSITIVE_INFINITY)).__proto__', Number.prototype, (Object(Number.POSITIVE_INFINITY)).__proto__ ); \ |
michael@0 | 40 | new TestCase( SECTION, '(Object(Number.NEGATIVE_INFINITY)).__proto__', Number.prototype, (Object(Number.NEGATIVE_INFINITY)).__proto__ ); \ |
michael@0 | 41 | new TestCase( SECTION, '(Object(Number.NaN)).__proto__', Number.prototype, (Object(Number.NaN)).__proto__ ); \ |
michael@0 | 42 | new TestCase( ) ; \ |
michael@0 | 43 | new TestCase( SECTION, '(Object(\"\")).__proto__', String.prototype, (Object('')).__proto__ ); \ |
michael@0 | 44 | new TestCase( SECTION, \"(Object('foo')).__proto__\", String.prototype, (Object('foo')).__proto__ ); \ |
michael@0 | 45 | new TestCase( SECTION, \"Object( '' ).__proto__\", String.prototype, (Object(\"\")).__proto__ ); \ |
michael@0 | 46 | new TestCase( SECTION, '(Object( new MyObject(true) )).toString()', '[object Object]', eval('(Object( new MyObject(true) )).toString()') ); \ |
michael@0 | 47 | "); |
michael@0 | 48 | lfcode.push("jsTestDriverEnd();"); |
michael@0 | 49 | lfcode.push(""); |
michael@0 | 50 | lfcode.push("\ |
michael@0 | 51 | enterFunc ('test'); \ |
michael@0 | 52 | Array.prototype[1] = 'bar'; \ |
michael@0 | 53 | var a = []; \ |
michael@0 | 54 | exitFunc ('test'); \ |
michael@0 | 55 | "); |
michael@0 | 56 | lfcode.push(""); |
michael@0 | 57 | lfcode.push("\ |
michael@0 | 58 | var VERSION = 'ECMA_1'; \ |
michael@0 | 59 | var TITLE = 'Value Properties of the Math Object'; \ |
michael@0 | 60 | writeHeaderToLog( SECTION + ' '+ TITLE); \ |
michael@0 | 61 | new TestCase( '15.8.1.1', 'Math.E', \ |
michael@0 | 62 | this . TITLE ); \ |
michael@0 | 63 | 'typeof Math.E', \ |
michael@0 | 64 | new TestCase( '15.8.1.2', \ |
michael@0 | 65 | 'Math.LN10', \ |
michael@0 | 66 | 'typeof Math.LN10', \ |
michael@0 | 67 | typeof Math.LN10 ); \ |
michael@0 | 68 | new TestCase( '15.8.1.3', \ |
michael@0 | 69 | 'Math.LN2', \ |
michael@0 | 70 | Math.LN2 ); \ |
michael@0 | 71 | new TestCase( '15.8.1.3', \ |
michael@0 | 72 | Math.LOG2E ); \ |
michael@0 | 73 | new TestCase( '15.8.1.4', \ |
michael@0 | 74 | Math.SQRT1_2); \ |
michael@0 | 75 | new TestCase( '15.8.1.7', \ |
michael@0 | 76 | typeof Math.SQRT2 ); \ |
michael@0 | 77 | new TestCase( SECTION, \ |
michael@0 | 78 | eval('var MATHPROPS=\"\";for( p in Math ){ MATHPROPS +=p; };MATHPROPS') ); \ |
michael@0 | 79 | "); |
michael@0 | 80 | while (true) { |
michael@0 | 81 | var file = lfcode.shift(); if (file == undefined) { break; } |
michael@0 | 82 | try { |
michael@0 | 83 | eval(file); |
michael@0 | 84 | } catch(exc1) { print(exc1); }; |
michael@0 | 85 | } |