本文整理汇总了TypeScript中vscode-debugadapter-testsupport.DebugClient.continueRequest方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DebugClient.continueRequest方法的具体用法?TypeScript DebugClient.continueRequest怎么用?TypeScript DebugClient.continueRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vscode-debugadapter-testsupport.DebugClient
的用法示例。
在下文中一共展示了DebugClient.continueRequest方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should support stopping on everything', async () => {
await client.setExceptionBreakpointsRequest({filters: ['*']});
// Notice
const [, {threadId}] = await Promise.all([
client.configurationDoneRequest(),
assertStoppedLocation('exception', program, 6)
]);
// Warning
await Promise.all([
client.continueRequest({threadId}),
assertStoppedLocation('exception', program, 9)
]);
// Exception
await Promise.all([
client.continueRequest({threadId}),
assertStoppedLocation('exception', program, 12)
]);
// Fatal error: uncaught exception
await Promise.all([
client.continueRequest({threadId}),
assertStoppedLocation('exception', program, 12)
]);
await Promise.all([
client.continueRequest({threadId}),
client.waitForEvent('terminated')
]);
});
示例2: it
it('should support removing a breakpoint', async () => {
await Promise.all([client.launch({program}), client.waitForEvent('initialized')]);
// set two breakpoints
let breakpoints = (await client.setBreakpointsRequest({breakpoints: [{line: 3}, {line: 5}], source: {path: program}})).body.breakpoints;
assert.lengthOf(breakpoints, 2);
assert.isTrue(breakpoints[0].verified, 'breakpoint verification mismatch: verified');
assert.equal(breakpoints[0].line, 3, 'breakpoint verification mismatch: line');
assert.isTrue(breakpoints[1].verified, 'breakpoint verification mismatch: verified');
assert.equal(breakpoints[1].line, 5, 'breakpoint verification mismatch: line');
// stop at first
const [{threadId}] = await Promise.all([
assertStoppedLocation('breakpoint', program, 3),
client.configurationDoneRequest()
]);
// remove second
breakpoints = (await client.setBreakpointsRequest({breakpoints: [{line: 3}], source: {path: program}})).body.breakpoints;
assert.lengthOf(breakpoints, 1);
assert.isTrue(breakpoints[0].verified, 'breakpoint verification mismatch: verified');
assert.equal(breakpoints[0].line, 3, 'breakpoint verification mismatch: line');
// should run to end
await Promise.all([
client.waitForEvent('terminated'),
client.continueRequest({threadId})
]);
});
示例3: it
it('should add a condition to an already set breakpoint', async function() {
await util.receivePageLoadedEvent(dc);
let sourcePath = path.join(TESTDATA_PATH, 'web/main.js');
await util.setBreakpoints(dc, sourcePath, [ { line: 24 } ]);
let stoppedEvent = await util.runCommandAndReceiveStoppedEvent(dc,
() => util.evaluate(dc, 'factorial(5)')
);
let threadId = stoppedEvent.body.threadId!;
let stackTrace = await dc.stackTraceRequest({ threadId });
let scopes = await dc.scopesRequest({ frameId: stackTrace.body.stackFrames[0].id });
let variablesResponse = await dc.variablesRequest({ variablesReference: scopes.body.scopes[0].variablesReference });
let variables = variablesResponse.body.variables;
assert.equal(util.findVariable(variables, 'n').value, '5');
await util.setBreakpoints(dc, sourcePath, [ { line: 24, condition: 'n === 2' } ]);
await dc.continueRequest({ threadId });
await util.runCommandAndReceiveStoppedEvent(dc,
() => util.evaluate(dc, 'factorial(5)')
);
stackTrace = await dc.stackTraceRequest({ threadId });
scopes = await dc.scopesRequest({ frameId: stackTrace.body.stackFrames[0].id });
variablesResponse = await dc.variablesRequest({ variablesReference: scopes.body.scopes[0].variablesReference });
variables = variablesResponse.body.variables;
assert.equal(util.findVariable(variables, 'n').value, '2');
});
示例4: it
it('should break on a debugger statement', async function() {
let stoppedEvent = await util.runCommandAndReceiveStoppedEvent(dc,
() => util.evaluate(dc, 'loadScript("debuggerStatement.js")'));
assert.equal(stoppedEvent.body.allThreadsStopped, false);
assert.equal(stoppedEvent.body.reason, 'debuggerStatement');
await dc.continueRequest({ threadId: stoppedEvent.body.threadId });
stoppedEvent = await util.runCommandAndReceiveStoppedEvent(dc,
() => util.evaluate(dc, 'debuggerStatement()'));
assert.equal(stoppedEvent.body.allThreadsStopped, false);
assert.equal(stoppedEvent.body.reason, 'debuggerStatement');
});
示例5: it
it('should inspect console evaluation results after resuming', async function() {
let sourcePath = path.join(TESTDATA_PATH, 'web/main.js');
await util.setBreakpoints(dc, sourcePath, [ 25 ]);
util.evaluate(dc, 'factorial(3)');
let stoppedEvent = await util.receiveStoppedEvent(dc);
let stackTrace = await dc.stackTraceRequest({ threadId: stoppedEvent.body.threadId! });
let evalResult = await dc.evaluateRequest({ expression: 'obj', context: 'repl',
frameId: stackTrace.body.stackFrames[0].id });
await dc.continueRequest({ threadId: stoppedEvent.body.threadId! });
let inspectResult = await dc.variablesRequest({
variablesReference: evalResult.body.variablesReference
});
assert.equal(util.findVariable(inspectResult.body.variables, 'x').value, '17');
});
示例6: it
it('should debug a WebWorker', async function() {
let mainSourcePath = path.join(TESTDATA_PATH, 'web/main.js');
await util.setBreakpoints(dc, mainSourcePath, [ 55 ]);
let workerSourcePath = path.join(TESTDATA_PATH, 'web/worker.js');
let workerBreakpointsResponse = await util.setBreakpoints(dc, workerSourcePath, [ 2 ], false);
let workerBreakpoint = workerBreakpointsResponse.body.breakpoints[0];
assert.equal(workerBreakpoint.verified, false);
util.evaluateDelayed(dc, 'startWorker()', 0);
let breakpointEvent = await util.receiveBreakpointEvent(dc);
assert.equal(breakpointEvent.body.breakpoint.id, workerBreakpoint.id);
assert.equal(breakpointEvent.body.breakpoint.verified, true);
assert.equal(breakpointEvent.body.breakpoint.line, 2);
util.evaluateDelayed(dc, 'callWorker()', 0);
let stoppedEvent = await util.receiveStoppedEvent(dc);
let workerThreadId = stoppedEvent.body.threadId!;
let stackTrace = await dc.stackTraceRequest({ threadId: workerThreadId });
assert.equal(stackTrace.body.stackFrames[0].source!.path, workerSourcePath);
dc.continueRequest({ threadId: workerThreadId });
stoppedEvent = await util.receiveStoppedEvent(dc);
let mainThreadId = stoppedEvent.body.threadId!;
stackTrace = await dc.stackTraceRequest({ threadId: mainThreadId });
let scopes = await dc.scopesRequest({ frameId: stackTrace.body.stackFrames[0].id });
let variables = await dc.variablesRequest({ variablesReference: scopes.body.scopes[0].variablesReference });
assert.notEqual(mainThreadId, workerThreadId);
assert.equal(stackTrace.body.stackFrames[0].source!.path, mainSourcePath);
assert.equal(util.findVariable(variables.body.variables, 'received').value, '"bar"');
});
示例7:
await util.runCommandAndReceiveStoppedEvent(dc, () => dc.continueRequest({ threadId }));