Chromium Code Reviews

Unified Diff: test/inspector/debugger/stepping-with-natives-and-frameworks.js

Issue 2758483002: [debugger] tuned StepNext and StepOut at return position (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: test/inspector/debugger/stepping-with-natives-and-frameworks.js
diff --git a/test/inspector/debugger/stepping-with-natives-and-frameworks.js b/test/inspector/debugger/stepping-with-natives-and-frameworks.js
new file mode 100644
index 0000000000000000000000000000000000000000..a5dbbd0527ed159016d2a30354afba48db05f28a
--- /dev/null
+++ b/test/inspector/debugger/stepping-with-natives-and-frameworks.js
@@ -0,0 +1,221 @@
+// Copyright 2017 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.
+
+InspectorTest.log('Stepping with natives and frameworks.');
+
+InspectorTest.addScript(`
+function callAll() {
+ for (var f of arguments)
+ f();
+}
+//# sourceURL=framework.js`);
+
+InspectorTest.setupScriptMap();
+InspectorTest.dumpProtocolCommand('Debugger.pause');
+InspectorTest.dumpProtocolCommand('Debugger.stepInto');
+InspectorTest.dumpProtocolCommand('Debugger.stepOver');
+InspectorTest.dumpProtocolCommand('Debugger.stepOut');
+InspectorTest.dumpProtocolCommand('Debugger.resume');
+
+Protocol.Debugger.enable();
+Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']});
+InspectorTest.runAsyncTestSuite([
+ async function testNativeCodeStepOut() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testNativeCodeStepOver() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testNativeCodeStepInto() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkCodeStepInto() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkCodeStepOver() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkCodeStepOut() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkNextCallDeeperStepOut() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({
+ expression: 'callAll(() => 1, callAll.bind(null, () => 2));'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkNextCallDeeperStepInto() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({
+ expression: 'callAll(() => 1, callAll.bind(null, () => 2));'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkNextCallDeeperStepOver() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({
+ expression: 'callAll(() => 1, callAll.bind(null, () => 2));'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkCurrentCallDeeperStepOut() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({
+ expression: 'callAll(callAll.bind(null, () => 1), () => 2);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOut();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkCurrentCallDeeperStepOver() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({
+ expression: 'callAll(callAll.bind(null, () => 1), () => 2);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepOver();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ },
+
+ async function testFrameworkCurrentCallDeeperStepInto() {
+ Protocol.Debugger.pause();
+ Protocol.Runtime.evaluate({
+ expression: 'callAll(callAll.bind(null, () => 1), () => 2);'});
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ Protocol.Debugger.stepInto();
+ await logPauseLocation(await Protocol.Debugger.oncePaused());
+ await Protocol.Debugger.resume();
+ }
+]);
+
+function logPauseLocation(message) {
+ return InspectorTest.logSourceLocation(message.params.callFrames[0].location);
+}

Powered by Google App Engine