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

Side by Side Diff: test/inspector/debugger/stepping-and-break-program-api.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 that stepping is cleared after breakProgram.'); 5 let {session, contextGroup, Protocol} = InspectorTest.start('Checks that steppin g is cleared after breakProgram.');
6 6
7 InspectorTest.addScript(` 7 contextGroup.addScript(`
8 function callBreakProgram() { 8 function callBreakProgram() {
9 debugger; 9 debugger;
10 inspector.breakProgram('reason', ''); 10 inspector.breakProgram('reason', '');
11 }`); 11 }`);
12 12
13 InspectorTest.setupScriptMap(); 13 session.setupScriptMap();
14 (async function test() { 14 (async function test() {
15 Protocol.Debugger.enable(); 15 Protocol.Debugger.enable();
16 Protocol.Runtime.evaluate({expression: 'callBreakProgram();'}); 16 Protocol.Runtime.evaluate({expression: 'callBreakProgram();'});
17 // Should break at this debugger statement, not at end of callBreakProgram. 17 // Should break at this debugger statement, not at end of callBreakProgram.
18 Protocol.Runtime.evaluate({expression: 'setTimeout(\'debugger;\', 0);'}); 18 Protocol.Runtime.evaluate({expression: 'setTimeout(\'debugger;\', 0);'});
19 await waitPauseAndDumpLocation(); 19 await waitPauseAndDumpLocation();
20 Protocol.Debugger.stepOver(); 20 Protocol.Debugger.stepOver();
21 await waitPauseAndDumpLocation(); 21 await waitPauseAndDumpLocation();
22 Protocol.Debugger.stepOver(); 22 Protocol.Debugger.stepOver();
23 await waitPauseAndDumpLocation(); 23 await waitPauseAndDumpLocation();
24 Protocol.Debugger.resume(); 24 Protocol.Debugger.resume();
25 await waitPauseAndDumpLocation(); 25 await waitPauseAndDumpLocation();
26 InspectorTest.completeTest(); 26 InspectorTest.completeTest();
27 })(); 27 })();
28 28
29 async function waitPauseAndDumpLocation() { 29 async function waitPauseAndDumpLocation() {
30 var message = await Protocol.Debugger.oncePaused(); 30 var message = await Protocol.Debugger.oncePaused();
31 InspectorTest.log('paused at:'); 31 InspectorTest.log('paused at:');
32 InspectorTest.logSourceLocation(message.params.callFrames[0].location); 32 session.logSourceLocation(message.params.callFrames[0].location);
33 return message; 33 return message;
34 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698