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

Side by Side Diff: test/inspector/debugger/stepping-tail-call.js

Issue 2758483002: [debugger] tuned StepNext and StepOut at return position (Closed)
Patch Set: addressed comments Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 InspectorTest.log('Checks stepping over tail calls.');
6
7 InspectorTest.setupScriptMap();
8 InspectorTest.dumpProtocolCommand('Debugger.pause');
9 InspectorTest.dumpProtocolCommand('Debugger.stepInto');
10 InspectorTest.dumpProtocolCommand('Debugger.stepOver');
11 InspectorTest.dumpProtocolCommand('Debugger.stepOut');
12 InspectorTest.dumpProtocolCommand('Debugger.resume');
13
14 let source = `
15 function f(x) {
16 if (x == 2) debugger;
17 if (x-- > 0) return f(x);
18 }
19 f(5);
20 `;
21
22 Protocol.Debugger.enable();
23 Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']});
24 InspectorTest.runAsyncTestSuite([
25 async function testStepOver() {
26 Protocol.Runtime.evaluate({expression: source});
27 await logPauseLocation(await Protocol.Debugger.oncePaused());
28 Protocol.Debugger.stepOver();
29 await logPauseLocation(await Protocol.Debugger.oncePaused());
30 Protocol.Debugger.stepOver();
31 await logPauseLocation(await Protocol.Debugger.oncePaused());
32 Protocol.Debugger.stepOver();
33 await logPauseLocation(await Protocol.Debugger.oncePaused());
34 Protocol.Debugger.stepOver();
35 await logPauseLocation(await Protocol.Debugger.oncePaused());
36 Protocol.Debugger.stepOver();
37 await logPauseLocation(await Protocol.Debugger.oncePaused());
38 Protocol.Debugger.stepOver();
39 await logPauseLocation(await Protocol.Debugger.oncePaused());
40 Protocol.Debugger.stepOver();
41 await logPauseLocation(await Protocol.Debugger.oncePaused());
42 await Protocol.Debugger.resume();
43 },
44
45 async function testStepOut() {
46 Protocol.Runtime.evaluate({expression: source});
47 await logPauseLocation(await Protocol.Debugger.oncePaused());
48 Protocol.Debugger.stepOut();
49 await logPauseLocation(await Protocol.Debugger.oncePaused());
50 Protocol.Debugger.stepOut();
51 await logPauseLocation(await Protocol.Debugger.oncePaused());
52 Protocol.Debugger.stepOut();
53 await logPauseLocation(await Protocol.Debugger.oncePaused());
54 Protocol.Debugger.stepOut();
55 await logPauseLocation(await Protocol.Debugger.oncePaused());
56 await Protocol.Debugger.resume();
57 },
58
59 async function testStepOutFromReturn() {
60 Protocol.Runtime.evaluate({expression: source});
61 await logPauseLocation(await Protocol.Debugger.oncePaused());
62 Protocol.Debugger.stepOver();
63 await logPauseLocation(await Protocol.Debugger.oncePaused());
64 Protocol.Debugger.stepOver();
65 await logPauseLocation(await Protocol.Debugger.oncePaused());
66 Protocol.Debugger.stepOut();
67 await logPauseLocation(await Protocol.Debugger.oncePaused());
68 Protocol.Debugger.stepOut();
69 await logPauseLocation(await Protocol.Debugger.oncePaused());
70 Protocol.Debugger.stepOut();
71 await logPauseLocation(await Protocol.Debugger.oncePaused());
72 Protocol.Debugger.stepOut();
73 await logPauseLocation(await Protocol.Debugger.oncePaused());
74 await Protocol.Debugger.resume();
75 }
76 ]);
77
78 function logPauseLocation(message) {
79 InspectorTest.logCallFrames(message.params.callFrames);
80 return InspectorTest.logSourceLocation(message.params.callFrames[0].location);
81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698