node/deps/v8/test/inspector/debugger/regress-crbug-1319828.js
Michaël Zasso 6bd756d7c6
deps: update V8 to 10.7.193.13
PR-URL: https://github.com/nodejs/node/pull/44741
Fixes: https://github.com/nodejs/node/issues/44650
Fixes: https://github.com/nodejs/node/issues/37472
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-11 07:24:33 +02:00

66 lines
1.9 KiB
JavaScript

// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} =
InspectorTest.start('Regression test for crbug.com/1319828');
const source = `
function foo() {
console.log('Hello World!');
}
//# sourceURL=foo.js`;
contextGroup.addScript(source, 42, 3);
session.setupScriptMap();
InspectorTest.runAsyncTestSuite([
async function testDebuggerGetPossibleBreakpoints() {
const [{params: {scriptId}}] = await Promise.all([
Protocol.Debugger.onceScriptParsed(),
Protocol.Runtime.enable(),
Protocol.Debugger.enable(),
]);
const {result: {locations}} =
await Protocol.Debugger.getPossibleBreakpoints({
start: {lineNumber: 1, columnNumber: 0, scriptId},
end: {lineNumber: 3, columnNumber: 1, scriptId},
});
await session.logBreakLocations(locations);
await Promise.all([
Protocol.Debugger.disable(),
Protocol.Runtime.disable(),
]);
},
async function testDebuggerSetBreakpointByUrl() {
await Promise.all([
Protocol.Runtime.enable(),
Protocol.Debugger.enable(),
]);
let {result: {breakpointId, locations}} =
await Protocol.Debugger.setBreakpointByUrl({
url: 'foo.js',
lineNumber: 2,
columnNumber: 0,
});
await Promise.all([
session.logSourceLocations(locations),
Protocol.Debugger.removeBreakpoint({breakpointId}),
]);
({result: {breakpointId, locations}} =
await Protocol.Debugger.setBreakpointByUrl({
url: 'foo.js',
lineNumber: 2,
columnNumber: 9,
}));
await Promise.all([
session.logSourceLocations(locations),
Protocol.Debugger.removeBreakpoint({breakpointId}),
]);
await Promise.all([
Protocol.Debugger.disable(),
Protocol.Runtime.disable(),
]);
},
]);