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.
1 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
2 <?xml-stylesheet
3 href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
5 <window title="View Source Test (bug 428653)"
6 xmlns:html="http://www.w3.org/1999/xhtml"
7 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <html:body/>
14 <browser id="content" type="content-primary" name="content" src="about:blank" flex="1"
15 disablehistory="true" context="viewSourceContextMenu"/>
17 <script type="application/javascript">
18 <![CDATA[
19 /*
20 Test that we can't call the content browser's document.open() either via
21 wrappedJSObject (SafeJSObjectWrapper) or not.
22 */
23 SimpleTest.waitForExplicitFinish();
25 addLoadEvent(function testDocumentOpen() {
26 var browser = document.getElementById("content");
27 ok(browser, "got browser");
28 var doc = browser.contentDocument;
29 ok(doc, "got content document");
31 var opened = false;
32 try {
33 doc.open("text/html", "replace");
34 opened = true;
35 } catch (e) {
36 is(e.name, "SecurityError", "Unxpected exception")
37 }
38 is(opened, false, "Shouldn't have opened document");
40 try {
41 doc.wrappedJSObject.open("text/html", "replace");
42 opened = true;
43 } catch (e) {
44 is(e.name, "SecurityError",
45 "Unxpected exception via wrappedJSObject")
46 }
47 is(opened, false, "Shouldn't have opened document via wrappedJSObject");
49 SimpleTest.finish();
50 });
51 ]]>
52 </script>
53 </window>