MCPcopy
hub / github.com/microsoft/vscode-js-debug / runCrossThreadTest

Function runCrossThreadTest

src/test/threads/threadsTest.ts:158–182  ·  view source on GitHub ↗
(r: TestRoot, p: TestP)

Source from the content-addressed store, hash-verified

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');

Callers 1

threadsTest.tsFile · 0.85

Calls 10

logStackTraceMethod · 0.80
allMethod · 0.80
stepInMethod · 0.80
workerMethod · 0.80
continueMethod · 0.80
assertLogMethod · 0.80
evaluateMethod · 0.65
logMethod · 0.65
onceMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected