tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_messageChannel_selfTransferring.html (768B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=677638
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>MessagePort/Channel no self tranferring</title>
      9  <script 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=677638">Mozilla Bug 677638</a>
     14 <div id="content"></div>
     15 <pre id="test">
     16 </pre>
     17  <script type="application/javascript">
     18 
     19  var a = new MessageChannel();
     20 
     21  var messageStatus = false;
     22  try {
     23    a.port1.postMessage('foobar', [a.port1]);
     24  } catch(e) {
     25    messageStatus = true;
     26  }
     27 
     28  ok(messageStatus, "Transfering the same port should throw");
     29 
     30  </script>
     31 </body>
     32 </html>