test_bug92773.html 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=92773
  5. -->
  6. <head>
  7. <title>Test for Bug 92773</title>
  8. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  10. </head>
  11. <body>
  12. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=92773">Mozilla Bug 92773</a>
  13. <p id="display"></p>
  14. <div id="content" style="display: none">
  15. </div>
  16. <pre id="test">
  17. <script type="application/javascript">
  18. /** Test for Bug 92773 **/
  19. function go() {
  20. try {
  21. $('ifr').contentWindow.foo;
  22. ok(false, "able to access cross-origin getter");
  23. } catch (e) {
  24. ok(/Permission denied/.exec(e), "unable to access cross-origin getter");
  25. }
  26. SimpleTest.finish();
  27. }
  28. SimpleTest.waitForExplicitFinish();
  29. </script>
  30. </pre>
  31. <iframe id='ifr'
  32. src='http://example.com/tests/js/xpconnect/tests/mochitest/bug92773_helper.html'
  33. onload="go()">
  34. </iframe>
  35. </body>
  36. </html>