test_openDialogChromeOnly.html (876B)
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 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(AppConstants.BROWSER_CHROME_URL); 17 ok(false, "Calling openDialog from unprivileged script should throw."); 18 } catch (e) { 19 ok(e instanceof ReferenceError, 20 "openDialog shouldn't be available to unprivileged script."); 21 } 22 </script> 23 </body> 24 25 26 </script> 27 </head> 28 <body> 29 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=931768">Mozilla Bug 931768</a> 30 <p id="display"> 31 </p> 32 <div id="content" style="display: none"> 33 34 </div> 35 <pre id="test"> 36 </pre> 37 </body> 38 </html>