test_browser.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=815105
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 815105 </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. </head>
  12. <body>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=815105">Mozilla Bug 815105 </a>
  14. <p id="display"></p>
  15. <div id="content" style="display: none"></div>
  16. <pre id="test">
  17. <script type="application/javascript;version=1.8" src="file_framework.js"></script>
  18. <script type="application/javascript;version=1.8">
  19. function verifier(success, failure) {
  20. var iframe = document.createElement('iframe');
  21. iframe.setAttribute('mozbrowser', 'true');
  22. iframe.src = "http://example.org/";
  23. iframe.addEventListener('load', function() {
  24. iframe.removeEventListener('load', arguments.callee);
  25. if (iframe.getScreenshot && typeof iframe.getScreenshot == "function") {
  26. success("Got mozbrowser");
  27. } else {
  28. failure("Didn't get mozbrowser") ;
  29. }
  30. });
  31. document.getElementById('content').appendChild(iframe);
  32. }
  33. var gData = [
  34. {
  35. perm: ["browser"],
  36. needParentPerm: true,
  37. settings: [["dom.mozBrowserFramesEnabled", true],
  38. ["network.disable.ipc.security", true]],
  39. verifier: verifier.toSource(),
  40. }
  41. ]
  42. </script>
  43. </pre>
  44. </body>
  45. </html>