OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title> postMessage(): read-only ports array </title> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <div id=log></div> |
| 6 <script> |
| 7 async_test(function(t) { |
| 8 var channel = new MessageChannel(); |
| 9 var targetPort = channel.port2; |
| 10 targetPort.start(); |
| 11 targetPort.addEventListener("message", t.step_func_done(function(e) { |
| 12 var channel3 = new MessageChannel(); |
| 13 e.ports.push(channel3.port1); |
| 14 e.ports.push(channel3.port1); |
| 15 assert_equals(e.ports.length, 1, "ports is a read only array with length ==
1."); |
| 16 }), true); |
| 17 var channel2 = new MessageChannel(); |
| 18 channel.port1.postMessage("ports", [channel2.port1]); |
| 19 }); |
| 20 </script> |
OLD | NEW |