| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 var i = 0; | |
| 3 onconnect = function (e) { | |
| 4 i++; | |
| 5 setTimeout(function() { e.ports[0].postMessage(i); }, 250); | |
| 6 y(); // will "report the error" | |
| 7 } | |
| 8 | |
| 9 /* | |
| 10 --> | |
| 11 <!doctype html> | |
| 12 <title>shared worker in two documents and window.onerror</title> | |
| 13 <script src="/resources/testharness.js"></script> | |
| 14 <script src="/resources/testharnessreport.js"></script> | |
| 15 <div id=log></div> | |
| 16 <script> | |
| 17 setup({allow_uncaught_exception:true}); | |
| 18 var t = async_test(function() { | |
| 19 window.onerror = this.step_func(function(a) { | |
| 20 assert_unreached('(outer) window.onerror invoked: ' + a); | |
| 21 }); | |
| 22 var worker = new SharedWorker('#', ''); | |
| 23 worker.addEventListener('error', this.step_func(function(e) { | |
| 24 assert_unreached('(outer) error on worker'); | |
| 25 }), false); | |
| 26 worker.port.addEventListener('error', this.step_func(function(e) { | |
| 27 assert_unreached('(outer) error on port'); | |
| 28 }), false); | |
| 29 worker.port.onmessage = this.step_func(function(e) { | |
| 30 assert_equals(e.data, 1); | |
| 31 var iframe = document.createElement('iframe'); | |
| 32 iframe.src = '004-1.html'; | |
| 33 document.body.appendChild(iframe); | |
| 34 }); | |
| 35 }); | |
| 36 </script> | |
| 37 <!-- | |
| 38 */ | |
| 39 //--> | |
| OLD | NEW |