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

Side by Side Diff: test/inspector/debugger/step-snapshot.js

Issue 2891213002: [inspector] Refactor protocol-test.js (Closed)
Patch Set: comments addressed 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 unified diff | Download patch
OLDNEW
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 // Embed a user function in the snapshot and step through it. 5 // Embed a user function in the snapshot and step through it.
6 6
7 // Flags: --embed 'function c(f, ...args) { return f(...args); }' 7 // Flags: --embed 'function c(f, ...args) { return f(...args); }'
8 8
9 InspectorTest.setupScriptMap(); 9 let {session, contextGroup, Protocol} = InspectorTest.start('Tests that stepping works on snapshotted function');
10 session.setupScriptMap();
10 11
11 InspectorTest.addScript(` 12 contextGroup.addScript(`
12 function test() { 13 function test() {
13 function f(x) { 14 function f(x) {
14 return x * 2; 15 return x * 2;
15 } 16 }
16 debugger; 17 debugger;
17 c(f, 2); 18 c(f, 2);
18 } 19 }
19 //# sourceURL=test.js`); 20 //# sourceURL=test.js`);
20 21
21 Protocol.Debugger.onPaused(message => { 22 Protocol.Debugger.onPaused(message => {
22 InspectorTest.log("paused"); 23 InspectorTest.log("paused");
23 var frames = message.params.callFrames; 24 var frames = message.params.callFrames;
24 InspectorTest.logSourceLocation(frames[0].location); 25 session.logSourceLocation(frames[0].location);
25 Protocol.Debugger.stepInto(); 26 Protocol.Debugger.stepInto();
26 }) 27 })
27 28
28 Protocol.Debugger.enable() 29 Protocol.Debugger.enable()
29 .then(() => Protocol.Runtime.evaluate({ expression: 'test()' })) 30 .then(() => Protocol.Runtime.evaluate({ expression: 'test()' }))
30 .then(InspectorTest.completeTest); 31 .then(InspectorTest.completeTest);
OLDNEW
« no previous file with comments | « test/inspector/debugger/step-over-caught-exception-expected.txt ('k') | test/inspector/debugger/step-snapshot-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698