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

Side by Side Diff: test/inspector/debugger/framework-precise-ranges.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 InspectorTest.log('Checks framework debugging with blackboxed ranges.'); 5 let {session, contextGroup, Protocol} = InspectorTest.start('Checks framework de bugging with blackboxed ranges.');
6 6
7 InspectorTest.addScript( 7 contextGroup.addScript(
8 ` 8 `
9 function foo() { 9 function foo() {
10 return boo(); 10 return boo();
11 } 11 }
12 function boo() { 12 function boo() {
13 return 42; 13 return 42;
14 } 14 }
15 function testFunction() { 15 function testFunction() {
16 foo(); 16 foo();
17 } 17 }
18 //# sourceURL=test.js`, 18 //# sourceURL=test.js`,
19 7, 26); 19 7, 26);
20 20
21 InspectorTest.setupScriptMap(); 21 session.setupScriptMap();
22 Protocol.Debugger.onPaused(message => { 22 Protocol.Debugger.onPaused(message => {
23 InspectorTest.logCallFrames(message.params.callFrames); 23 session.logCallFrames(message.params.callFrames);
24 InspectorTest.log(''); 24 InspectorTest.log('');
25 Protocol.Debugger.stepInto(); 25 Protocol.Debugger.stepInto();
26 }); 26 });
27 var scriptId; 27 var scriptId;
28 Protocol.Debugger.onScriptParsed(message => { 28 Protocol.Debugger.onScriptParsed(message => {
29 if (message.params.url === 'test.js') { 29 if (message.params.url === 'test.js') {
30 scriptId = message.params.scriptId; 30 scriptId = message.params.scriptId;
31 } 31 }
32 }); 32 });
33 33
(...skipping 23 matching lines...) Expand all
57 }, 57 },
58 function testBooPartiallyBlackboxed3(next) { 58 function testBooPartiallyBlackboxed3(next) {
59 // first line is blackboxed, second and third - not. 59 // first line is blackboxed, second and third - not.
60 testPositions([ 60 testPositions([
61 position(11, 0), position(12, 0), position(14, 0) 61 position(11, 0), position(12, 0), position(14, 0)
62 ]).then(next); 62 ]).then(next);
63 } 63 }
64 ]; 64 ];
65 65
66 function testPositions(positions) { 66 function testPositions(positions) {
67 InspectorTest.contextGroup.schedulePauseOnNextStatement('', ''); 67 contextGroup.schedulePauseOnNextStatement('', '');
68 return Protocol.Debugger 68 return Protocol.Debugger
69 .setBlackboxedRanges({scriptId: scriptId, positions: positions}) 69 .setBlackboxedRanges({scriptId: scriptId, positions: positions})
70 .then(InspectorTest.logMessage) 70 .then(InspectorTest.logMessage)
71 .then( 71 .then(
72 () => Protocol.Runtime.evaluate( 72 () => Protocol.Runtime.evaluate(
73 {expression: 'testFunction()//# sourceURL=expr.js'})); 73 {expression: 'testFunction()//# sourceURL=expr.js'}));
74 } 74 }
75 75
76 function position(line, column) { 76 function position(line, column) {
77 return {lineNumber: line, columnNumber: column}; 77 return {lineNumber: line, columnNumber: column};
78 } 78 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/framework-nested-scheduled-break.js ('k') | test/inspector/debugger/framework-stepping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698