Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: test/inspector/debugger/continue-to-location-target-call-frames.js

Issue 2884613004: [inspector] added in-deeper-frame continue-to-location strategy
Patch Set: rebased Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/inspector/debugger/continue-to-location-target-call-frames.js
diff --git a/test/inspector/debugger/continue-to-location-target-call-frames.js b/test/inspector/debugger/continue-to-location-target-call-frames.js
index 6f5d8b5f00ed0b464357e09f34d68b9339694ec7..300aaaa8f992d8677197a8ba57aa5e42cf2513c3 100644
--- a/test/inspector/debugger/continue-to-location-target-call-frames.js
+++ b/test/inspector/debugger/continue-to-location-target-call-frames.js
@@ -30,6 +30,32 @@ function topLevel() {
//# sourceURL=test.js`, 7, 26);
+InspectorTest.addScript(`
+function foo() {
+ return 42;
+}
+
+function testInDeeperFrame() {
+ debugger;
+ setTimeout(foo, 0);
+ callFunction(false, foo);
+ callFunction(true, foo);
+ [1].map(x => x * 2).map(foo);
+ callFunction(true, () => {
+ var a = 1;
+ console.log(a);
+ });
+}
+
+async function callFunction(usePromise, cb) {
+ if (usePromise) {
+ Promise.resolve().then(cb);
+ } else {
+ setTimeout(cb, 0);
+ }
+}
+//# sourceURL=test-deeper-frame.js`)
+
InspectorTest.setupScriptMap();
InspectorTest.runAsyncTestSuite([
async function testAwaitAny() {
@@ -127,6 +153,19 @@ InspectorTest.runAsyncTestSuite([
await pausedAndDumpStack();
await Protocol.Debugger.resume();
Protocol.Debugger.disable();
+ },
+
+ async function testRunAllDeeper() {
+ Protocol.Debugger.enable();
+ Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 });
+ const toFoo = {lineNumber: 2, columnNumber: 2};
+ await testInDeeperFrame({lineNumber: 7, columnNumber: 2}, toFoo);
+ await testInDeeperFrame({lineNumber: 8, columnNumber: 2}, toFoo);
+ await testInDeeperFrame({lineNumber: 9, columnNumber: 2}, toFoo);
+ await testInDeeperFrame({lineNumber: 10, columnNumber: 22}, toFoo);
+ await testInDeeperFrame({lineNumber: 11, columnNumber: 2}, {lineNumber: 12, columnNumber: 4});
+ await Protocol.Debugger.resume();
+ Protocol.Debugger.disable();
}
]);
@@ -137,3 +176,20 @@ async function pausedAndDumpStack() {
InspectorTest.log('');
return message;
}
+
+async function testInDeeperFrame(from, to) {
+ Protocol.Runtime.evaluate({expression: 'testInDeeperFrame()//# sourceURL=expr.js'});
+ let message = await Protocol.Debugger.oncePaused();
+ let location = message.params.callFrames[0].location;
+ location.lineNumber = from.lineNumber;
+ location.columnNumber = from.columnNumber;
+ InspectorTest.log('Run test from: ' + JSON.stringify(from));
+ await InspectorTest.logSourceLocation(location);
+ Protocol.Debugger.continueToLocation({location, targetCallFrames: 'any'});
+ await pausedAndDumpStack();
+ location.lineNumber = to.lineNumber;
+ location.columnNumber = to.columnNumber;
+ Protocol.Debugger.continueToLocation({location, targetCallFrames: 'deeper'});
+ await pausedAndDumpStack();
+ await Protocol.Debugger.resume();
+}
« no previous file with comments | « src/inspector/v8-stack-trace-impl.cc ('k') | test/inspector/debugger/continue-to-location-target-call-frames-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698