| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 |
| 3 <head> |
| 4 <title>Incognito Worker Test</title> |
| 5 |
| 6 <script src="worker_utils.js"></script> |
| 7 |
| 8 <script> |
| 9 var worker = new SharedWorker("incognito_worker.js"); |
| 10 // Worker should only get a single connect event. |
| 11 worker.port.onmessage = function(evt) { |
| 12 if (evt.data != 1) { |
| 13 // This instance should not be shared with other pre-existing instances, |
| 14 // so the connect count should be 1. |
| 15 onFailure(); |
| 16 return; |
| 17 } |
| 18 // Make a second worker, make sure it shares this instance |
| 19 var worker = new SharedWorker("incognito_worker.js"); |
| 20 worker.port.onmessage = function(evt) { |
| 21 if (evt.data == 2) |
| 22 onSuccess(); |
| 23 else |
| 24 onFailure(); |
| 25 }; |
| 26 }; |
| 27 |
| 28 </script> |
| 29 </head> |
| 30 |
| 31 <body> |
| 32 <div id=statusPanel></div> |
| 33 </body> |
| 34 </html> |
| OLD | NEW |