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

Side by Side Diff: test/inspector/debugger/step-into.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 // Flags: --turbo 5 // Flags: --turbo
6 6
7 InspectorTest.log('Checks possible break locations.'); 7 let {session, contextGroup, Protocol} = InspectorTest.start('Checks possible bre ak locations.');
8 8
9 InspectorTest.setupScriptMap(); 9 session.setupScriptMap();
10 Protocol.Debugger.onPaused(message => { 10 Protocol.Debugger.onPaused(message => {
11 var frames = message.params.callFrames; 11 var frames = message.params.callFrames;
12 if (frames.length === 1) { 12 if (frames.length === 1) {
13 Protocol.Debugger.stepInto(); 13 Protocol.Debugger.stepInto();
14 return; 14 return;
15 } 15 }
16 var scriptId = frames[0].location.scriptId; 16 var scriptId = frames[0].location.scriptId;
17 InspectorTest.log('break at:'); 17 InspectorTest.log('break at:');
18 InspectorTest.logSourceLocation(frames[0].location) 18 session.logSourceLocation(frames[0].location)
19 .then(() => Protocol.Debugger.stepInto()); 19 .then(() => Protocol.Debugger.stepInto());
20 }); 20 });
21 21
22 InspectorTest.loadScript('test/inspector/debugger/resources/break-locations.js') ; 22 contextGroup.loadScript('test/inspector/debugger/resources/break-locations.js');
23 23
24 Protocol.Debugger.enable(); 24 Protocol.Debugger.enable();
25 Protocol.Runtime.evaluate({ expression: 'Object.keys(this).filter(name => name.i ndexOf(\'test\') === 0)', returnByValue: true }) 25 Protocol.Runtime.evaluate({ expression: 'Object.keys(this).filter(name => name.i ndexOf(\'test\') === 0)', returnByValue: true })
26 .then(runTests); 26 .then(runTests);
27 27
28 function runTests(message) { 28 function runTests(message) {
29 var tests = message.result.result.value; 29 var tests = message.result.result.value;
30 InspectorTest.runTestSuite(tests.map(test => eval(`(function ${test}(next) { 30 InspectorTest.runTestSuite(tests.map(test => eval(`(function ${test}(next) {
31 Protocol.Runtime.evaluate({ expression: 'debugger; ${test}()', awaitPromise: ${test.indexOf('testPromise') === 0}}) 31 Protocol.Runtime.evaluate({ expression: 'debugger; ${test}()', awaitPromise: ${test.indexOf('testPromise') === 0}})
32 .then(next); 32 .then(next);
33 })`))); 33 })`)));
34 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698