test_messageChannel_forceClose.html 785 B

12345678910111213141516171819202122232425262728293031
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=1176034
  5. -->
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Test for Bug 1176034 - start/close</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=1176034">Mozilla Bug 1176034</a>
  14. <div id="content"></div>
  15. <pre id="test">
  16. </pre>
  17. <script type="application/javascript">
  18. var mc = new MessageChannel();
  19. try {
  20. postMessage(42, "*", [ mc.port1, window ]);
  21. ok(false, "Something went wrong.");
  22. } catch(e) {
  23. ok(true, "PostMessage should fail and we should not leak.");
  24. }
  25. </script>
  26. </body>
  27. </html>