v8/test/inspector/debugger/pause-inside-blackboxed-optimized.js
Benedikt Meurer b345204579 [inspector] Make inspector tests independent of Debugger.CallFrame.url.
This is the second step towards moving away from sending `url` with
every call frame when emitting the `Debugger.paused` event.

Bug: chromium:1270316, chromium:1271078
Change-Id: Ib4f996024b5200cded155bd8a564d01d36856400
Doc: https://bit.ly/devtools-debugger-callframe-url
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3431485
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78906}
2022-02-02 14:34:08 +00:00

41 lines
1.0 KiB
JavaScript

// Copyright 2018 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.
// Flags: --allow-natives-syntax
let {session, contextGroup, Protocol} = InspectorTest.start(
'Checks pause inside blackboxed optimized function call.');
contextGroup.addScript(`
function foo() {
return 1 + bar();
}
//# sourceURL=framework.js
`);
contextGroup.addScript(`
function bar() {
return 2;
}
%PrepareFunctionForOptimization(foo);
foo();
foo();
%OptimizeFunctionOnNextCall(foo);
foo();
//# sourceURL=test.js
`);
session.setupScriptMap();
InspectorTest.runAsyncTestSuite([async function test() {
Protocol.Debugger.enable();
Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']});
Protocol.Runtime.evaluate({expression: `
inspector.callWithScheduledBreak(foo, 'break', '');
//# sourceURL=expr.js
`});
const {params:{callFrames}} = await Protocol.Debugger.oncePaused();
session.logCallFrames(callFrames);
}]);