|
1 |
|
2 <!DOCTYPE HTML> |
|
3 <html> |
|
4 <!-- |
|
5 https://bugzilla.mozilla.org/show_bug.cgi?id=677638 |
|
6 --> |
|
7 <head> |
|
8 <meta charset="utf-8"> |
|
9 <title>Test for Bug 677638 - basic support</title> |
|
10 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
12 </head> |
|
13 <body> |
|
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=677638">Mozilla Bug 677638</a> |
|
15 <p id="display"></p> |
|
16 <div id="content" style="display: none"> |
|
17 <iframe name="x" id="x"></iframe> |
|
18 <iframe name="y" id="y"></iframe> |
|
19 </div> |
|
20 <pre id="test"> |
|
21 </pre> |
|
22 <script type="application/javascript"> |
|
23 |
|
24 function runTest() { |
|
25 /** Test for Bug 677638 **/ |
|
26 var a = new MessageChannel(); |
|
27 ok(a, "MessageChannel created"); |
|
28 |
|
29 var port1 = a.port1; |
|
30 ok(port1, "MessageChannel.port1 exists"); |
|
31 is(port1, a.port1, "MessageChannel.port1 is port1"); |
|
32 |
|
33 var port2 = a.port2; |
|
34 ok(port2, "MessageChannel.port1 exists"); |
|
35 is(port2, a.port2, "MessageChannel.port2 is port2"); |
|
36 |
|
37 [ 'postMessage', 'start', 'close' ].forEach(function(e) { |
|
38 ok(e in port1, "MessagePort1." + e + " exists"); |
|
39 ok(e in port2, "MessagePort2." + e + " exists"); |
|
40 }); |
|
41 |
|
42 SimpleTest.finish(); |
|
43 } |
|
44 |
|
45 SimpleTest.waitForExplicitFinish(); |
|
46 SpecialPowers.pushPrefEnv({"set": [["dom.messageChannel.enabled", true]]}, runTest); |
|
47 </script> |
|
48 </body> |
|
49 </html> |