OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
5 <script> | 5 <script> |
6 var worker1; | 6 var worker1; |
7 var worker2; | 7 var worker2; |
8 | 8 |
9 function startWorker1() | 9 function startWorker1() |
10 { | 10 { |
11 worker1 = new Worker("resources/worker-with-throw.js"); | 11 worker1 = new Worker("resources/worker-with-throw.js"); |
12 } | 12 } |
13 | 13 |
14 function startWorker2() | 14 function startWorker2() |
15 { | 15 { |
16 worker2 = new Worker("resources/worker-with-throw.js"); | 16 worker2 = new Worker("resources/worker-with-throw.js"); |
17 worker2.onerror = function(e) { | 17 worker2.onerror = function(e) { |
18 console.log(e.message); | 18 console.log(e.message); |
19 e.preventDefault(); | 19 e.preventDefault(); |
20 } | 20 } |
21 } | 21 } |
22 | 22 |
23 function postMessageToWorker(worker) | 23 function postMessageToWorker(worker) |
24 { | 24 { |
25 worker.postMessage(); | 25 worker.postMessage("ping"); |
26 } | 26 } |
27 | 27 |
28 function test() | 28 function test() |
29 { | 29 { |
30 var isContextCreated = false; | 30 var isContextCreated = false; |
31 var isAgentEnabled = false; | 31 var isAgentEnabled = false; |
32 | 32 |
33 startWorkerAndPostMessage(step2, "worker1", "startWorker1"); | 33 startWorkerAndPostMessage(step2, "worker1", "startWorker1"); |
34 | 34 |
35 function step2() | 35 function step2() |
(...skipping 24 matching lines...) Expand all Loading... |
60 InspectorTest.addSniffer(WebInspector.RuntimeModel.prototype, "_executio
nContextCreated", contextCreated.bind(this, next, workerName)); | 60 InspectorTest.addSniffer(WebInspector.RuntimeModel.prototype, "_executio
nContextCreated", contextCreated.bind(this, next, workerName)); |
61 InspectorTest.evaluateInPage(workerStartFunction + "()"); | 61 InspectorTest.evaluateInPage(workerStartFunction + "()"); |
62 } | 62 } |
63 }; | 63 }; |
64 </script> | 64 </script> |
65 </head> | 65 </head> |
66 <body onload="runTest()"> | 66 <body onload="runTest()"> |
67 <p>Tests exception message from worker contains stack trace.</p> | 67 <p>Tests exception message from worker contains stack trace.</p> |
68 </body> | 68 </body> |
69 </html> | 69 </html> |
OLD | NEW |