toolkit/content/tests/chrome/test_screenPersistence.xul

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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

mercurial