|
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"> |
|
12 |
|
13 /** Test for Bug 931768 **/ |
|
14 |
|
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> |
|
27 |
|
28 |
|
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"> |
|
36 |
|
37 </div> |
|
38 <pre id="test"> |
|
39 </pre> |
|
40 </body> |
|
41 </html> |