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

Side by Side Diff: test/inspector/debugger/return-break-locations.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('Return break locations within function'); 5 let {session, contextGroup, Protocol} = InspectorTest.start('Return break locati ons within function');
6 6
7 InspectorTest.addScript(` 7 contextGroup.addScript(`
8 function fib(x) { 8 function fib(x) {
9 if (x < 0) return; 9 if (x < 0) return;
10 if (x === 0) return 1; 10 if (x === 0) return 1;
11 if (x === 1) return fib(0); 11 if (x === 1) return fib(0);
12 return x > 2 ? fib(x - 1) + fib(x - 2) : fib(1) + fib(0); 12 return x > 2 ? fib(x - 1) + fib(x - 2) : fib(1) + fib(0);
13 } 13 }
14 `); 14 `);
15 15
16 InspectorTest.runAsyncTestSuite([ 16 InspectorTest.runAsyncTestSuite([
17 async function testTailCall() { 17 async function testTailCall() {
18 var scriptPromise = Protocol.Debugger.onceScriptParsed(); 18 var scriptPromise = Protocol.Debugger.onceScriptParsed();
19 Protocol.Debugger.enable(); 19 Protocol.Debugger.enable();
20 var scriptId = (await scriptPromise).params.scriptId; 20 var scriptId = (await scriptPromise).params.scriptId;
21 var locations = (await Protocol.Debugger.getPossibleBreakpoints({ 21 var locations = (await Protocol.Debugger.getPossibleBreakpoints({
22 start: { lineNumber: 0, columnNumber: 0, scriptId } 22 start: { lineNumber: 0, columnNumber: 0, scriptId }
23 })).result.locations; 23 })).result.locations;
24 InspectorTest.logMessage(locations.filter(location => location.type === 'ret urn')); 24 InspectorTest.logMessage(locations.filter(location => location.type === 'ret urn'));
25 } 25 }
26 ]); 26 ]);
OLDNEW
« no previous file with comments | « test/inspector/debugger/restore-breakpoint.js ('k') | test/inspector/debugger/schedule-step-into-async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698