OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 if (location.hash == '#1') { |
| 3 onconnect = function(e) { |
| 4 var port = e.ports[0]; |
| 5 var w2 = new Worker('#2'); |
| 6 w2.onmessage = function(e) { |
| 7 port.postMessage('1'+e.data); |
| 8 } |
| 9 } |
| 10 } else if (location.hash == '#2') { |
| 11 var w3 = new SharedWorker('#3'); |
| 12 w3.port.onmessage = function(e) { |
| 13 postMessage('2'+e.data); |
| 14 } |
| 15 } else { |
| 16 onconnect = function(e) { |
| 17 e.ports[0].postMessage('3'); |
| 18 } |
| 19 } |
| 20 |
| 21 /* |
| 22 --> |
| 23 <!doctype html> |
| 24 <title>shared worker in dedicated worker in shared worker</title> |
| 25 <script src="/resources/testharness.js"></script> |
| 26 <script src="/resources/testharnessreport.js"></script> |
| 27 <div id=log></div> |
| 28 <script> |
| 29 async_test(function() { |
| 30 var w1 = new SharedWorker('#1'); |
| 31 w1.port.onmessage = this.step_func(function(e) { |
| 32 assert_equals(e.data, '123'); |
| 33 this.done(); |
| 34 }); |
| 35 }); |
| 36 </script> |
| 37 <!-- |
| 38 */ |
| 39 //--> |
OLD | NEW |