| 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/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
| 5 <script src="../tracing-test.js"></script> | 5 <script src="../tracing-test.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 // Save references to the worker objects to make sure they are not GC'ed. |
| 9 var worker1; |
| 10 var worker2; |
| 11 |
| 8 function startWorkerAndRunTest() | 12 function startWorkerAndRunTest() |
| 9 { | 13 { |
| 10 var worker1 = new Worker("resources/worker.js"); | 14 worker1 = new Worker("resources/worker.js"); |
| 11 worker1.postMessage(""); | 15 worker1.postMessage(""); |
| 12 | 16 |
| 13 if (window.testRunner) { | 17 if (window.testRunner) { |
| 14 testRunner.dumpAsText(); | 18 testRunner.dumpAsText(); |
| 15 testRunner.waitUntilDone(); | 19 testRunner.waitUntilDone(); |
| 16 } | 20 } |
| 17 | 21 |
| 18 worker1.onmessage = function(event) | 22 worker1.onmessage = function(event) |
| 19 { | 23 { |
| 20 worker1.onmessage = null; | 24 worker1.onmessage = null; |
| 21 runTest(); | 25 runTest(); |
| 22 } | 26 } |
| 23 } | 27 } |
| 24 | 28 |
| 25 function startSecondWorker(onActionComplete) | 29 function startSecondWorker(onActionComplete) |
| 26 { | 30 { |
| 27 var worker2 = new Worker("resources/worker.js"); | 31 worker2 = new Worker("resources/worker.js"); |
| 28 worker2.postMessage(""); | 32 worker2.postMessage(""); |
| 29 worker2.onmessage = function(event) | 33 worker2.onmessage = function(event) |
| 30 { | 34 { |
| 31 onActionComplete(); | 35 onActionComplete(); |
| 32 worker2.onmessage = null; | 36 worker2.onmessage = null; |
| 33 } | 37 } |
| 34 } | 38 } |
| 35 | 39 |
| 36 function test() | 40 function test() |
| 37 { | 41 { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 63 | 67 |
| 64 </script> | 68 </script> |
| 65 </head> | 69 </head> |
| 66 | 70 |
| 67 <body onload="startWorkerAndRunTest()"> | 71 <body onload="startWorkerAndRunTest()"> |
| 68 <p> | 72 <p> |
| 69 Tests that worker events are recorded with proper devtools metadata events. | 73 Tests that worker events are recorded with proper devtools metadata events. |
| 70 </p> | 74 </p> |
| 71 </body> | 75 </body> |
| 72 </html> | 76 </html> |
| OLD | NEW |