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 | <?xml version="1.0"?> |
michael@0 | 2 | <?xml-stylesheet type="text/css" href="chrome://global/skin"?> |
michael@0 | 3 | <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?> |
michael@0 | 4 | <!-- |
michael@0 | 5 | https://bugzilla.mozilla.org/show_bug.cgi?id=804630 |
michael@0 | 6 | --> |
michael@0 | 7 | <window title="Mozilla Bug 804630" |
michael@0 | 8 | xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> |
michael@0 | 9 | <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> |
michael@0 | 10 | |
michael@0 | 11 | <!-- test results are displayed in the html:body --> |
michael@0 | 12 | <body xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 13 | <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=804630" |
michael@0 | 14 | target="_blank">Mozilla Bug 804630</a> |
michael@0 | 15 | </body> |
michael@0 | 16 | |
michael@0 | 17 | <!-- test code goes here --> |
michael@0 | 18 | <script type="application/javascript"> |
michael@0 | 19 | <![CDATA[ |
michael@0 | 20 | /** Test to make sure that COWed objects can expose properties from their prototypes. **/ |
michael@0 | 21 | const Cu = Components.utils; |
michael@0 | 22 | |
michael@0 | 23 | // Set up the sandbox. |
michael@0 | 24 | var sb = new Cu.Sandbox('http://www.example.com'); |
michael@0 | 25 | sb.ok = ok; |
michael@0 | 26 | sb.is = is; |
michael@0 | 27 | |
michael@0 | 28 | // Make a chrome object that exposes objects off its prototype. |
michael@0 | 29 | sb.proto = { read: 42, readWrite: 32, __exposedProps__: {} }; |
michael@0 | 30 | sb.proto.__defineSetter__('setterProp', function(val) { this._setterProp = val; }); |
michael@0 | 31 | sb.obj = { __exposedProps__: { read: 'r', readWrite: 'rw', setterProp: 'w' } }; |
michael@0 | 32 | sb.obj.__proto__ = sb.proto; |
michael@0 | 33 | |
michael@0 | 34 | // Make sure we can't access any of the properties on the prototype directly. |
michael@0 | 35 | Cu.evalInSandbox('is(proto.read, undefined, "proto.read inaccessible");', sb); |
michael@0 | 36 | Cu.evalInSandbox('var wrote = false; ' + |
michael@0 | 37 | 'try { proto.readWrite = 12; wrote = true; } catch(e) {} ' + |
michael@0 | 38 | ' ok(!wrote, "Should not write proto property");', sb); |
michael@0 | 39 | Cu.evalInSandbox('var wrote = false; ' + |
michael@0 | 40 | 'try { proto.setterProp = 12; wrote = true; } catch(e) {} ' + |
michael@0 | 41 | ' ok(!wrote, "Should not write proto setter");', sb); |
michael@0 | 42 | |
michael@0 | 43 | // Make sure we can access the exposed properties via the derived object. |
michael@0 | 44 | Cu.evalInSandbox('is(obj.read, 42, "obj.read accessible");', sb); |
michael@0 | 45 | Cu.evalInSandbox('is(obj.readWrite, 32, "obj.readWrite is readable");', sb); |
michael@0 | 46 | Cu.evalInSandbox('obj.readWrite = 8; is(obj.readWrite, 8, "obj.readWrite is writable");', sb); |
michael@0 | 47 | Cu.evalInSandbox('obj.setterProp = 3;', sb); |
michael@0 | 48 | is(sb.obj._setterProp, 3, "obj.setterProp works"); |
michael@0 | 49 | |
michael@0 | 50 | ]]> |
michael@0 | 51 | </script> |
michael@0 | 52 | </window> |