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 version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
5 <window title="Window Open Test"
6 onload="runTest()"
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"/>
11 <script type="application/javascript"
12 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
14 <script class="testbody" type="application/javascript"><![CDATA[
15 SimpleTest.waitForExplicitFinish();
16 let win;
17 var left = 60 + screen.availLeft;
18 var upper = 60 + screen.availTop;
20 function runTest() {
21 win = window.openDialog("window_screenPosSize.xul",
22 null,
23 "chrome,dialog=no,all,screenX=" + left + ",screenY=" + upper + ",outerHeight=200,outerWidth=200");
24 SimpleTest.waitForFocus(checkTest, win);
25 }
26 function checkTest() {
27 is(win.screenX, left, "The window should be placed now at x=" + left + "px");
28 is(win.screenY, upper, "The window should be placed now at y=" + upper + "px");
29 is(win.outerHeight, 200, "The window size should be height=200px");
30 is(win.outerWidth, 200, "The window size should be width=200px");
31 runTest2();
32 }
33 function runTest2() {
34 win.close();
35 win = window.openDialog("window_screenPosSize.xul",
36 null,
37 "chrome,dialog=no,all");
38 SimpleTest.waitForFocus(checkTest2, win);
39 }
40 function checkTest2() {
41 let runTime = Components.classes["@mozilla.org/xre/app-info;1"]
42 .getService(Components.interfaces.nsIXULRuntime);
43 if (runTime.OS != "Linux") {
44 is(win.screenX, 80, "The window should be placed now at x=80px");
45 is(win.screenY, 80, "The window should be placed now at y=80px");
46 }
47 is(win.outerHeight, 300, "The window size should be height=300px");
48 is(win.outerWidth, 300, "The window size should be width=300px");
49 win.close();
50 SimpleTest.finish();
51 }
52 ]]></script>
54 <body xmlns="http://www.w3.org/1999/xhtml">
55 <p id="display">
56 </p>
57 <div id="content" style="display: none">
58 </div>
59 <pre id="test">
60 </pre>
61 </body>
63 </window>