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

Side by Side Diff: test/inspector/debugger/stepping-after-get-possible-breakpoints.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 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 InspectorTest.addScript(` 5 let {session, contextGroup, Protocol} = InspectorTest.start('Tests that stepping works after calling getPossibleBreakpoints');
6
7 contextGroup.addScript(`
6 function boo() {} 8 function boo() {}
7 boo(); 9 boo();
8 function foo() {} 10 function foo() {}
9 //# sourceURL=foo.js`); 11 //# sourceURL=foo.js`);
10 12
11 Protocol.Debugger.onPaused((message) => { 13 Protocol.Debugger.onPaused((message) => {
12 InspectorTest.logMessage(message.params.callFrames[0].functionName || "(top)") ; 14 InspectorTest.logMessage(message.params.callFrames[0].functionName || "(top)") ;
13 Protocol.Debugger.stepInto(); 15 Protocol.Debugger.stepInto();
14 }); 16 });
15 var scriptId; 17 var scriptId;
16 Protocol.Debugger.onScriptParsed(message => { 18 Protocol.Debugger.onScriptParsed(message => {
17 if (message.params.url === 'foo.js') 19 if (message.params.url === 'foo.js')
18 scriptId = message.params.scriptId; 20 scriptId = message.params.scriptId;
19 }); 21 });
20 Protocol.Debugger.enable() 22 Protocol.Debugger.enable()
21 .then(() => Protocol.Debugger.getPossibleBreakpoints({start: {scriptId, lineNu mber:0,columnNumber:0}})) 23 .then(() => Protocol.Debugger.getPossibleBreakpoints({start: {scriptId, lineNu mber:0,columnNumber:0}}))
22 .then(() => InspectorTest.log('-- call boo:')) 24 .then(() => InspectorTest.log('-- call boo:'))
23 .then(() => Protocol.Runtime.evaluate({ expression: 'debugger; boo();'})) 25 .then(() => Protocol.Runtime.evaluate({ expression: 'debugger; boo();'}))
24 .then(() => InspectorTest.log('-- call foo:')) 26 .then(() => InspectorTest.log('-- call foo:'))
25 .then(() => Protocol.Runtime.evaluate({ expression: 'debugger; foo();'})) 27 .then(() => Protocol.Runtime.evaluate({ expression: 'debugger; foo();'}))
26 .then(InspectorTest.completeTest); 28 .then(InspectorTest.completeTest);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698