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

Side by Side Diff: test/inspector/debugger/step-out-async-await.js

Issue 2779143002: [inspector] added test for StepOut at return postion from async function (Closed)
Patch Set: better expectation Created 3 years, 8 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
« no previous file with comments | « no previous file | test/inspector/debugger/step-out-async-await-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // TODO(kozyatinskiy): on StepOut and probably StepNext at return position
6 // of async generator we should break at next instruction of resumed generator
7 // instead of next scheduled microtask.
8
9 InspectorTest.log('StepOut from return position of async function.');
10
11 InspectorTest.addScript(`
12 async function testFunction() {
13 async function foo() {
14 var p = Promise.resolve();
15 await p;
16 p.then(() => 1);
17 debugger;
18 return p;
19 }
20 await foo();
21 }
22 `);
23
24 InspectorTest.setupScriptMap();
25 Protocol.Debugger.enable();
26 InspectorTest.runAsyncTestSuite([
27 async function testStepInto() {
28 Protocol.Runtime.evaluate({expression: 'testFunction()'});
29 await logPauseLocation(await Protocol.Debugger.oncePaused());
30 Protocol.Debugger.stepInto();
31 await logPauseLocation(await Protocol.Debugger.oncePaused());
32 Protocol.Debugger.stepInto();
33 await logPauseLocation(await Protocol.Debugger.oncePaused());
34 Protocol.Debugger.stepInto();
35 await logPauseLocation(await Protocol.Debugger.oncePaused());
36 Protocol.Debugger.resume();
37 },
38
39 async function testStepOver() {
40 Protocol.Runtime.evaluate({expression: 'testFunction()'});
41 await logPauseLocation(await Protocol.Debugger.oncePaused());
42 Protocol.Debugger.stepInto();
43 await logPauseLocation(await Protocol.Debugger.oncePaused());
44 Protocol.Debugger.stepInto();
45 await logPauseLocation(await Protocol.Debugger.oncePaused());
46 Protocol.Debugger.stepOver();
47 await logPauseLocation(await Protocol.Debugger.oncePaused());
48 Protocol.Debugger.stepOver();
49 await logPauseLocation(await Protocol.Debugger.oncePaused());
50 Protocol.Debugger.stepOver();
51 await logPauseLocation(await Protocol.Debugger.oncePaused());
52 Protocol.Debugger.resume();
53 },
54
55 async function testStepOut() {
56 Protocol.Runtime.evaluate({expression: 'testFunction()'});
57 await logPauseLocation(await Protocol.Debugger.oncePaused());
58 Protocol.Debugger.stepInto();
59 await logPauseLocation(await Protocol.Debugger.oncePaused());
60 Protocol.Debugger.stepInto();
61 await logPauseLocation(await Protocol.Debugger.oncePaused());
62 Protocol.Debugger.stepOut();
63 await logPauseLocation(await Protocol.Debugger.oncePaused());
64 Protocol.Debugger.stepOut();
65 await logPauseLocation(await Protocol.Debugger.oncePaused());
66 Protocol.Debugger.resume();
67 },
68 ]);
69
70 function logPauseLocation(message) {
71 return InspectorTest.logSourceLocation(message.params.callFrames[0].location);
72 }
OLDNEW
« no previous file with comments | « no previous file | test/inspector/debugger/step-out-async-await-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698