OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 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 | 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 InspectorTest.log('Debugger breaks in next script after stepOut from previous on
e.'); | 5 let {session, contextGroup, Protocol} = InspectorTest.start('Debugger breaks in
next script after stepOut from previous one.'); |
6 | 6 |
7 InspectorTest.addScript(` | 7 contextGroup.addScript(` |
8 function test() { | 8 function test() { |
9 setTimeout('var a = 1;//# sourceURL=timeout1.js', 0); | 9 setTimeout('var a = 1;//# sourceURL=timeout1.js', 0); |
10 setTimeout(foo, 0); | 10 setTimeout(foo, 0); |
11 setTimeout('var a = 3;//# sourceURL=timeout3.js', 0); | 11 setTimeout('var a = 3;//# sourceURL=timeout3.js', 0); |
12 debugger; | 12 debugger; |
13 } | 13 } |
14 //# sourceURL=foo.js`, 7, 26); | 14 //# sourceURL=foo.js`, 7, 26); |
15 | 15 |
16 InspectorTest.addScript(` | 16 contextGroup.addScript(` |
17 function foo() { | 17 function foo() { |
18 return 42; | 18 return 42; |
19 } | 19 } |
20 //# sourceURL=timeout2.js`) | 20 //# sourceURL=timeout2.js`) |
21 | 21 |
22 InspectorTest.setupScriptMap(); | 22 session.setupScriptMap(); |
23 var stepAction; | 23 var stepAction; |
24 Protocol.Debugger.onPaused(message => { | 24 Protocol.Debugger.onPaused(message => { |
25 InspectorTest.logCallFrames(message.params.callFrames); | 25 session.logCallFrames(message.params.callFrames); |
26 InspectorTest.log(''); | 26 InspectorTest.log(''); |
27 Protocol.Debugger[stepAction](); | 27 Protocol.Debugger[stepAction](); |
28 }); | 28 }); |
29 Protocol.Debugger.enable() | 29 Protocol.Debugger.enable() |
30 InspectorTest.runTestSuite([ | 30 InspectorTest.runTestSuite([ |
31 function testStepOut(next) { | 31 function testStepOut(next) { |
32 stepAction = 'stepOut'; | 32 stepAction = 'stepOut'; |
33 Protocol.Runtime.evaluate({ expression: 'test()' }) | 33 Protocol.Runtime.evaluate({ expression: 'test()' }) |
34 .then(() => InspectorTest.waitPendingTasks()) | 34 .then(() => InspectorTest.waitForPendingTasks()) |
35 .then(next); | 35 .then(next); |
36 }, | 36 }, |
37 | 37 |
38 function testStepOver(next) { | 38 function testStepOver(next) { |
39 stepAction = 'stepOver'; | 39 stepAction = 'stepOver'; |
40 Protocol.Runtime.evaluate({ expression: 'test()' }) | 40 Protocol.Runtime.evaluate({ expression: 'test()' }) |
41 .then(() => InspectorTest.waitPendingTasks()) | 41 .then(() => InspectorTest.waitForPendingTasks()) |
42 .then(next); | 42 .then(next); |
43 }, | 43 }, |
44 | 44 |
45 function testStepInto(next) { | 45 function testStepInto(next) { |
46 stepAction = 'stepInto'; | 46 stepAction = 'stepInto'; |
47 Protocol.Runtime.evaluate({ expression: 'test()' }) | 47 Protocol.Runtime.evaluate({ expression: 'test()' }) |
48 .then(() => InspectorTest.waitPendingTasks()) | 48 .then(() => InspectorTest.waitForPendingTasks()) |
49 .then(next); | 49 .then(next); |
50 } | 50 } |
51 ]); | 51 ]); |
OLD | NEW |