| 156 | }); |
| 157 | |
| 158 | const runCrossThreadTest = async (r: TestRoot, p: TestP) => { |
| 159 | p.cdp.Runtime.evaluate({ |
| 160 | expression: |
| 161 | `debugger;\nwindow.w = new Worker('workerSourceMap.js');\n//# sourceURL=test.js`, |
| 162 | }); |
| 163 | const { threadId } = p.log(await p.dap.once('stopped')); |
| 164 | await p.logger.logStackTrace(threadId); |
| 165 | |
| 166 | p.log('\nstep over'); |
| 167 | p.dap.next({ threadId }); |
| 168 | p.log(await Promise.all([p.dap.once('continued'), p.dap.once('stopped')])); |
| 169 | await p.logger.logStackTrace(threadId); |
| 170 | |
| 171 | p.log('\nstep in'); |
| 172 | p.dap.stepIn({ threadId }); |
| 173 | p.log(await p.dap.once('continued')); |
| 174 | const worker = await r.worker(); |
| 175 | const { threadId: secondThreadId } = p.log(await worker.dap.once('stopped')); |
| 176 | await worker.logger.logStackTrace(secondThreadId); |
| 177 | |
| 178 | p.log('\nresume'); |
| 179 | worker.dap.continue({ threadId: secondThreadId }); |
| 180 | p.log(await worker.dap.once('continued')); |
| 181 | p.assertLog(); |
| 182 | }; |
| 183 | |
| 184 | itIntegrates('cross thread constructor source map', async ({ r }) => { |
| 185 | const p = await r.launchUrlAndLoad('index.html'); |