OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> |
| 6 var worker; |
| 7 |
| 8 function startWorker() |
| 9 { |
| 10 worker = new Worker("resources/worker-with-throw.js"); |
| 11 } |
| 12 |
| 13 function postMessageToWorker() |
| 14 { |
| 15 worker.postMessage(); |
| 16 } |
| 17 |
| 18 function setupErrorHandler() |
| 19 { |
| 20 worker.onerror = function(e) { |
| 21 console.log(e.message); |
| 22 e.preventDefault(); |
| 23 } |
| 24 } |
| 25 |
| 26 function test() |
| 27 { |
| 28 InspectorTest.addSniffer(WebInspector.RuntimeModel.prototype, "_executionCon
textCreated", contextCreated); |
| 29 InspectorTest.evaluateInPage("startWorker()"); |
| 30 |
| 31 function contextCreated() |
| 32 { |
| 33 InspectorTest.evaluateInPage("postMessageToWorker()", step2); |
| 34 } |
| 35 |
| 36 function step2() |
| 37 { |
| 38 InspectorTest.evaluateInPage("setupErrorHandler()", step3); |
| 39 } |
| 40 |
| 41 function step3() |
| 42 { |
| 43 InspectorTest.evaluateInPage("postMessageToWorker()", step4); |
| 44 } |
| 45 |
| 46 function step4() |
| 47 { |
| 48 InspectorTest.expandConsoleMessages(step5); |
| 49 } |
| 50 |
| 51 function step5() |
| 52 { |
| 53 InspectorTest.dumpConsoleMessages(); |
| 54 InspectorTest.completeTest(); |
| 55 } |
| 56 }; |
| 57 </script> |
| 58 </head> |
| 59 <body onload="runTest()"> |
| 60 <p>Tests exception message from worker contains stack trace.</p> |
| 61 </body> |
| 62 </html> |
OLD | NEW |