OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 print("Check that stepInto at then end of the script go to next user script inst
ead InjectedScriptSource.js."); | 5 InspectorTest.log("Check that stepInto at then end of the script go to next user
script instead InjectedScriptSource.js."); |
6 | 6 |
7 InspectorTest.addScript( | 7 InspectorTest.addScript( |
8 `function foo() | 8 `function foo() |
9 { | 9 { |
10 return 239; | 10 return 239; |
11 }`); | 11 }`); |
12 | 12 |
13 Protocol.Debugger.enable(); | 13 Protocol.Debugger.enable(); |
14 Protocol.Debugger.onPaused(debuggerPaused); | 14 Protocol.Debugger.onPaused(debuggerPaused); |
15 Protocol.Runtime.evaluate({ "expression": "(function boo() { setTimeout(foo, 0);
debugger; })()" }); | 15 Protocol.Runtime.evaluate({ "expression": "(function boo() { setTimeout(foo, 0);
debugger; })()" }); |
16 | 16 |
17 var actions = [ "stepInto", "stepInto", "stepInto" ]; | 17 var actions = [ "stepInto", "stepInto", "stepInto" ]; |
18 function debuggerPaused(result) | 18 function debuggerPaused(result) |
19 { | 19 { |
20 InspectorTest.log("Stack trace:"); | 20 InspectorTest.log("Stack trace:"); |
21 for (var callFrame of result.params.callFrames) | 21 for (var callFrame of result.params.callFrames) |
22 InspectorTest.log(callFrame.functionName + ":" + callFrame.location.lineNumb
er + ":" + callFrame.location.columnNumber); | 22 InspectorTest.log(callFrame.functionName + ":" + callFrame.location.lineNumb
er + ":" + callFrame.location.columnNumber); |
23 InspectorTest.log(""); | 23 InspectorTest.log(""); |
24 | 24 |
25 var action = actions.shift(); | 25 var action = actions.shift(); |
26 if (!action) { | 26 if (!action) { |
27 Protocol.Debugger.resume().then(InspectorTest.completeTest); | 27 Protocol.Debugger.resume().then(InspectorTest.completeTest); |
28 return; | 28 return; |
29 } | 29 } |
30 InspectorTest.log("Perform " + action); | 30 InspectorTest.log("Perform " + action); |
31 Protocol.Debugger[action](); | 31 Protocol.Debugger[action](); |
32 } | 32 } |
OLD | NEW |