OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
4 <script> | 4 <script> |
5 | 5 |
6 var worker1; | 6 var worker1; |
7 var worker2; | 7 var worker2; |
8 | 8 |
9 function startWorkers() | 9 function startWorkers() |
10 { | 10 { |
11 worker1 = new Worker("resources/worker-with-throw.js"); | 11 worker1 = new Worker("resources/worker-with-throw.js"); |
12 worker1.onerror = function(e) { | 12 worker1.onerror = function(e) { |
13 e.preventDefault(); | 13 e.preventDefault(); |
14 worker1.terminate(); | 14 worker1.terminate(); |
15 } | 15 } |
16 worker2 = new Worker("resources/worker-with-throw.js"); | 16 worker2 = new Worker("resources/worker-with-throw.js"); |
17 } | 17 } |
18 | 18 |
19 function test() | 19 function test() |
20 { | 20 { |
21 InspectorTest.sendCommandOrDie("Console.enable", {}); | |
22 InspectorTest.sendCommandOrDie("Worker.enable", {}, didEnableWorkerDebugging
); | 21 InspectorTest.sendCommandOrDie("Worker.enable", {}, didEnableWorkerDebugging
); |
23 | 22 |
24 function didEnableWorkerDebugging(event) | 23 function didEnableWorkerDebugging(event) |
25 { | 24 { |
26 InspectorTest.sendCommandOrDie("Runtime.evaluate", { expression: "startW
orkers()" }); | 25 InspectorTest.sendCommandOrDie("Runtime.evaluate", { expression: "startW
orkers()" }); |
27 } | 26 } |
28 | 27 |
29 var workerRequestId = 1; | 28 var workerRequestId = 1; |
30 function sendCommandToWorker(method, params, workerId) | 29 function sendCommandToWorker(method, params, workerId) |
31 { | 30 { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 InspectorTest.eventHandler["Worker.workerTerminated"] = undefined; | 66 InspectorTest.eventHandler["Worker.workerTerminated"] = undefined; |
68 workerTerminated = true; | 67 workerTerminated = true; |
69 if (messageReceived && workerTerminated) | 68 if (messageReceived && workerTerminated) |
70 InspectorTest.completeTest(); | 69 InspectorTest.completeTest(); |
71 } | 70 } |
72 } | 71 } |
73 </script> | 72 </script> |
74 </head> | 73 </head> |
75 <body onload="runTest()">Tests that console message from worker contains stack t
race.</body> | 74 <body onload="runTest()">Tests that console message from worker contains stack t
race.</body> |
76 </html> | 75 </html> |
OLD | NEW |