OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script> | 4 <script> |
5 window.isOnErrorTest = true; | 5 window.isOnErrorTest = true; |
6 </script> | 6 </script> |
7 <script src="../../resources/js-test.js"></script> | 7 <script src="../../resources/js-test.js"></script> |
8 <script src="resources/onerror-test.js"></script> | 8 <script src="resources/onerror-test.js"></script> |
9 </head> | 9 </head> |
10 <body> | 10 <body> |
11 <!-- This script's body will be used to build a Blob URL to use as a Worker.
--> | 11 <!-- This script's body will be used to build a Blob URL to use as a Worker.
--> |
12 <script id="workerCode" type="text/plain"> | 12 <script id="workerCode" type="text/plain"> |
13 onerror = function(message, filename, lineno, colno, error) { | 13 onerror = function(message, filename, lineno, colno, error) { |
14 postMessage({ | 14 postMessage({ |
15 message: message, | 15 message: message, |
16 filename: filename, | 16 filename: filename, |
17 lineno: lineno, | 17 lineno: lineno, |
18 colno: colno, | 18 colno: colno, |
19 error: error | 19 error: error |
20 }); | 20 }); |
21 return false; | 21 return false; |
22 } | 22 } |
23 | 23 |
24 foo.bar = 0; | 24 foo.bar = 0; |
25 </script> | 25 </script> |
26 <script> | 26 <script> |
27 description("This tests that exceptions trigger a worker's onerror in ad
dition to the page-level 'worker.onerror'."); | 27 description("This tests that exceptions don't trigger a worker's onerror
in addition to the page-level 'worker.onerror'."); |
28 | 28 |
29 checkPostMessage({ | 29 checkErrorEventInHandler([{ |
30 message: "Uncaught ReferenceError: foo is not defined", | 30 message: "Uncaught ReferenceError: foo is not defined", |
31 filename: "[blob: URL]", | 31 filename: "[blob: URL]", |
32 lineno: 13, | 32 lineno: 13, |
33 colno: 9, | 33 colno: 9, |
34 }); | 34 }, |
35 | 35 { |
36 checkErrorEventInHandler({ | |
37 message: "Uncaught ReferenceError: foo is not defined", | 36 message: "Uncaught ReferenceError: foo is not defined", |
38 filename: "[blob: URL]", | 37 filename: "[blob: URL]", |
39 lineno: 13, | 38 lineno: 13, |
40 colno: 9, | 39 colno: 9, |
41 }); | 40 }]); |
42 </script> | 41 </script> |
43 </body> | 42 </body> |
44 </html> | 43 </html> |
45 | 44 |
OLD | NEW |