dom/base/test/test_openDialogChromeOnly.html

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 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=931768
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 931768</title>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11   <script type="application/javascript">
    13   /** Test for Bug 931768 **/
    15   try {
    16     openDialog("chrome://browser/content/browser.xul");
    17     ok(false, "Calling openDialog from unprivileged script should throw.");
    18   } catch (e) {
    19     // FIXME e should be a ReferenceError once we switch Window to new WebIDL bindings
    20     ok(e.name == "SecurityError",
    21        "openDialog shouldn't be callable to unprivileged script.");
    22     todo(e instanceof ReferenceError,
    23          "openDialog shouldn't be available to unprivileged script.");
    24   }
    25 </script>
    26 </body>
    29   </script>
    30 </head>
    31 <body>
    32 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=931768">Mozilla Bug 931768</a>
    33 <p id="display">
    34 </p>
    35 <div id="content" style="display: none">
    37 </div>
    38 <pre id="test">
    39 </pre>
    40 </body>
    41 </html>

mercurial