| <!DOCTYPE html> |
| <html> |
| <head> |
| <script> |
| window.isOnErrorTest = true; |
| </script> |
| <script src="../../resources/js-test.js"></script> |
| <script src="resources/onerror-test.js"></script> |
| </head> |
| <body> |
| <!-- This script's body will be used to build a Blob URL to use as a Worker. --> |
| <script id="workerCode" type="text/plain"> |
| onerror = function(message, filename, lineno, colno, error) { |
| postMessage({ |
| message: message, |
| filename: filename, |
| lineno: lineno, |
| colno: colno |
| }); |
| return false; |
| } |
| |
| foo.bar = 0; |
| </script> |
| <script> |
| description("This tests that exceptions trigger a worker's onerror in addition to the page-level 'worker.onerror'."); |
| |
| checkPostMessage({ |
| message: "Uncaught ReferenceError: foo is not defined", |
| filename: "[blob: URL]", |
| lineno: 12, |
| colno: 9, |
| }); |
| |
| checkErrorEventInHandler({ |
| message: "Uncaught ReferenceError: foo is not defined", |
| filename: "[blob: URL]", |
| lineno: 12, |
| colno: 9, |
| }); |
| </script> |
| </body> |
| </html> |