file_iframe_sandbox_d_if22.html 778 B

1234567891011121314151617181920212223242526
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Test for Bug 838692</title>
  6. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  7. </head>
  8. <script type="application/javascript">
  9. var testContext = "Test 21: navigate parent by name with window.open(): ";
  10. function doTest() {
  11. try {
  12. window.open("file_iframe_sandbox_navigation_fail.html?" + escape(testContext), "if_parent2");
  13. window.parent.parent.postMessage({type: "attempted"}, "*");
  14. } catch(error) {
  15. window.parent.parent.postMessage({ok: true, desc: testContext + "as expected, error thrown during window.open(..., \"if_parent2\")"}, "*");
  16. }
  17. }
  18. </script>
  19. <body onload="doTest()">
  20. I am sandboxed with 'allow-same-origin allow-scripts'
  21. </body>
  22. </html>