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

Side by Side Diff: test/inspector/debugger/max-async-call-chain-depth.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 // TODO(kozyatinskiy): fix or remove it later. 5 // TODO(kozyatinskiy): fix or remove it later.
5 InspectorTest.log('Checks that we trim async call chains correctly.'); 6 let {session, contextGroup, Protocol} = InspectorTest.start('Checks that we trim async call chains correctly.');
6 7
7 Protocol.Debugger.enable(); 8 Protocol.Debugger.enable();
8 InspectorTest.log('set async chain depth to 8'); 9 InspectorTest.log('set async chain depth to 8');
9 Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 8}); 10 Protocol.Debugger.setAsyncCallStackDepth({maxDepth: 8});
10 InspectorTest.runAsyncTestSuite([ 11 InspectorTest.runAsyncTestSuite([
11 async function testDebuggerPaused() { 12 async function testDebuggerPaused() {
12 runWithAsyncChain(4, 'debugger;'); 13 runWithAsyncChain(4, 'debugger;');
13 dumpAsyncChainLength(await Protocol.Debugger.oncePaused()); 14 dumpAsyncChainLength(await Protocol.Debugger.oncePaused());
14 await Protocol.Debugger.resume(); 15 await Protocol.Debugger.resume();
15 16
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 153
153 function dumpAsyncChainLength(message) { 154 function dumpAsyncChainLength(message) {
154 let stackTrace = message.params.asyncStackTrace || message.params.stackTrace.p arent; 155 let stackTrace = message.params.asyncStackTrace || message.params.stackTrace.p arent;
155 let asyncChainCount = 0; 156 let asyncChainCount = 0;
156 while (stackTrace) { 157 while (stackTrace) {
157 ++asyncChainCount; 158 ++asyncChainCount;
158 stackTrace = stackTrace.parent; 159 stackTrace = stackTrace.parent;
159 } 160 }
160 InspectorTest.log(`actual async chain len: ${asyncChainCount}`); 161 InspectorTest.log(`actual async chain len: ${asyncChainCount}`);
161 } 162 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/inspector-break-api.js ('k') | test/inspector/debugger/object-preview-internal-properties.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698