tor-browser

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

test_messageChannel.html (1171B)


      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>Test for Bug 677638 - basic support</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 <p id="display"></p>
     15 <div id="content" style="display: none">
     16  <iframe name="x" id="x"></iframe>
     17  <iframe name="y" id="y"></iframe>
     18 </div>
     19 <pre id="test">
     20 </pre>
     21  <script type="application/javascript">
     22 
     23  /** Test for Bug 677638 */
     24  var a = new MessageChannel();
     25  ok(a, "MessageChannel created");
     26 
     27  var port1 = a.port1;
     28  ok(port1, "MessageChannel.port1 exists");
     29  is(port1, a.port1, "MessageChannel.port1 is port1");
     30 
     31  var port2 = a.port2;
     32  ok(port2, "MessageChannel.port1 exists");
     33  is(port2, a.port2, "MessageChannel.port2 is port2");
     34 
     35  [ 'postMessage', 'start', 'close' ].forEach(function(e) {
     36    ok(e in port1, "MessagePort1." + e + " exists");
     37    ok(e in port2, "MessagePort2." + e + " exists");
     38  });
     39 
     40  </script>
     41 </body>
     42 </html>