dom/base/test/test_openDialogChromeOnly.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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