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

Side by Side Diff: test/inspector/debugger/async-set-timeout.js

Issue 2574803002: [inspector] add async instrumentation for setTimeout in tests (Closed)
Patch Set: addressed comments Created 4 years 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
(Empty)
1 // Copyright 2016 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 print('Checks that async stack contains setTimeout');
6
7 InspectorTest.addScript(`
8 var resolveCallback;
9 function foo1() {
10 function inner1() {
11 debugger;
12 resolveCallback();
13 }
14 inner1();
15 }
16 function foo2() {
17 function inner2() {
18 setTimeout(foo1, 0);
19 }
20 inner2();
21 }
22 function foo3() {
23 var promise = new Promise(resolve => resolveCallback = resolve);
24 function inner3() {
25 setTimeout(foo2, 0);
26 }
27 inner3();
28 return promise;
29 }
30 //# sourceURL=test.js`, 7, 26);
31
32 var urlByScriptId = new Map();
dgozman 2016/12/13 18:33:24 Unused.
kozy 2016/12/13 19:15:27 Done.
33 InspectorTest.setupScriptMap();
34 Protocol.Debugger.onPaused(message => {
35 InspectorTest.logCallFrames(message.params.callFrames, urlByScriptId);
dgozman 2016/12/13 18:33:24 Remove second parameter.
kozy 2016/12/13 19:15:27 Done.
36 var asyncStackTrace = message.params.asyncStackTrace;
37 while (asyncStackTrace) {
38 InspectorTest.log(`-- ${asyncStackTrace.description} --`);
39 InspectorTest.logCallFrames(asyncStackTrace.callFrames);
40 asyncStackTrace = asyncStackTrace.parent;
41 }
42 InspectorTest.log('');
43 Protocol.Debugger.resume();
44 });
45
46 Protocol.Debugger.enable();
47 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 });
48 Protocol.Runtime.evaluate({ expression: "foo3()//# sourceURL=expr.js", awaitProm ise: true })
49 .then(InspectorTest.completeTest);
OLDNEW
« no previous file with comments | « no previous file | test/inspector/debugger/async-set-timeout-expected.txt » ('j') | test/inspector/task-runner.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698