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

Side by Side Diff: test/inspector/debugger/step-out-async-await.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 // TODO(kozyatinskiy): on StepOut and probably StepNext at return position 5 // TODO(kozyatinskiy): on StepOut and probably StepNext at return position
6 // of async generator we should break at next instruction of resumed generator 6 // of async generator we should break at next instruction of resumed generator
7 // instead of next scheduled microtask. 7 // instead of next scheduled microtask.
8 8
9 InspectorTest.log('StepOut from return position of async function.'); 9 let {session, contextGroup, Protocol} = InspectorTest.start('StepOut from return position of async function.');
10 10
11 InspectorTest.addScript(` 11 contextGroup.addScript(`
12 async function testFunction() { 12 async function testFunction() {
13 async function foo() { 13 async function foo() {
14 var p = Promise.resolve(); 14 var p = Promise.resolve();
15 await p; 15 await p;
16 p.then(() => 1); 16 p.then(() => 1);
17 debugger; 17 debugger;
18 return p; 18 return p;
19 } 19 }
20 await foo(); 20 await foo();
21 } 21 }
22 `); 22 `);
23 23
24 InspectorTest.setupScriptMap(); 24 session.setupScriptMap();
25 Protocol.Debugger.enable(); 25 Protocol.Debugger.enable();
26 InspectorTest.runAsyncTestSuite([ 26 InspectorTest.runAsyncTestSuite([
27 async function testStepInto() { 27 async function testStepInto() {
28 Protocol.Runtime.evaluate({expression: 'testFunction()'}); 28 Protocol.Runtime.evaluate({expression: 'testFunction()'});
29 await logPauseLocation(await Protocol.Debugger.oncePaused()); 29 await logPauseLocation(await Protocol.Debugger.oncePaused());
30 Protocol.Debugger.stepInto(); 30 Protocol.Debugger.stepInto();
31 await logPauseLocation(await Protocol.Debugger.oncePaused()); 31 await logPauseLocation(await Protocol.Debugger.oncePaused());
32 Protocol.Debugger.stepInto(); 32 Protocol.Debugger.stepInto();
33 await logPauseLocation(await Protocol.Debugger.oncePaused()); 33 await logPauseLocation(await Protocol.Debugger.oncePaused());
34 Protocol.Debugger.stepInto(); 34 Protocol.Debugger.stepInto();
(...skipping 26 matching lines...) Expand all
61 await logPauseLocation(await Protocol.Debugger.oncePaused()); 61 await logPauseLocation(await Protocol.Debugger.oncePaused());
62 Protocol.Debugger.stepOut(); 62 Protocol.Debugger.stepOut();
63 await logPauseLocation(await Protocol.Debugger.oncePaused()); 63 await logPauseLocation(await Protocol.Debugger.oncePaused());
64 Protocol.Debugger.stepOut(); 64 Protocol.Debugger.stepOut();
65 await logPauseLocation(await Protocol.Debugger.oncePaused()); 65 await logPauseLocation(await Protocol.Debugger.oncePaused());
66 Protocol.Debugger.resume(); 66 Protocol.Debugger.resume();
67 }, 67 },
68 ]); 68 ]);
69 69
70 function logPauseLocation(message) { 70 function logPauseLocation(message) {
71 return InspectorTest.logSourceLocation(message.params.callFrames[0].location); 71 return session.logSourceLocation(message.params.callFrames[0].location);
72 } 72 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/step-into-next-script.js ('k') | test/inspector/debugger/step-over-another-context-group.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698