js/xpconnect/tests/chrome/test_bug793433.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.

     1 <?xml version="1.0"?>
     2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
     3 <?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
     4 <!--
     5 https://bugzilla.mozilla.org/show_bug.cgi?id=793433
     6 -->
     7 <window title="Mozilla Bug 793433"
     8         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     9   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    11   <!-- test results are displayed in the html:body -->
    12   <body xmlns="http://www.w3.org/1999/xhtml">
    13   <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=793433"
    14      target="_blank">Mozilla Bug 793433</a>
    15   <p id="display"></p>
    16   <div id="content" style="display: none"/>
    17   </body>
    19   <!-- test code goes here -->
    20   <script type="application/javascript"><![CDATA[
    22 const Cc = Components.classes;
    23 const Ci = Components.interfaces;
    25 function shouldThrow(fun, args, msg) {
    26   try {
    27     fun.apply(this, args);
    28     ok(false, msg);
    29   } catch (e) {
    30     ok(true, msg+" -- "+e);
    31   }
    32 }
    34 function do_registerTopLevelWindow(win) {
    35   Cc['@mozilla.org/appshell/appShellService;1'].
    36     getService(Ci.nsIAppShellService).registerTopLevelWindow(win);
    37 }
    39 shouldThrow(
    40   do_registerTopLevelWindow, [null],
    41   "registering null as a top-level window should throw");
    43 shouldThrow(
    44   do_registerTopLevelWindow, [{}],
    45   "registering a void object as a top-level window should throw");
    47   ]]></script>
    48 </window>

mercurial