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

Side by Side Diff: test/inspector/debugger/async-for-await-of-promise-stack.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 2016 the V8 project authors. All rights reserved. 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 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 // Flags: --harmony-async-iteration 5 // Flags: --harmony-async-iteration
6 6
7 InspectorTest.log('Checks that async chains for for-await-of are correct.'); 7 let {session, contextGroup, Protocol} = InspectorTest.start('Checks that async c hains for for-await-of are correct.');
8 8
9 InspectorTest.addScript(` 9 contextGroup.addScript(`
10 10
11 function Debugger(value) { 11 function Debugger(value) {
12 debugger; 12 debugger;
13 } 13 }
14 14
15 function Reject(reason) { 15 function Reject(reason) {
16 var reject; 16 var reject;
17 var promise = new Promise(function(resolvefn, rejectfn) { 17 var promise = new Promise(function(resolvefn, rejectfn) {
18 reject = rejectfn; 18 reject = rejectfn;
19 }); 19 });
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 try { 121 try {
122 for await (let x of ThrowOnReturn(["0", "1"])) { 122 for await (let x of ThrowOnReturn(["0", "1"])) {
123 break; 123 break;
124 } 124 }
125 } catch (e) { 125 } catch (e) {
126 Debugger(e); 126 Debugger(e);
127 } 127 }
128 } 128 }
129 //# sourceURL=test.js`, 9, 26); 129 //# sourceURL=test.js`, 9, 26);
130 130
131 InspectorTest.setupScriptMap(); 131 session.setupScriptMap();
132 Protocol.Debugger.onPaused(message => { 132 Protocol.Debugger.onPaused(message => {
133 InspectorTest.logCallFrames(message.params.callFrames); 133 session.logCallFrames(message.params.callFrames);
134 InspectorTest.logAsyncStackTrace(message.params.asyncStackTrace); 134 session.logAsyncStackTrace(message.params.asyncStackTrace);
135 InspectorTest.log(''); 135 InspectorTest.log('');
136 Protocol.Debugger.resume(); 136 Protocol.Debugger.resume();
137 }); 137 });
138 138
139 Protocol.Debugger.enable(); 139 Protocol.Debugger.enable();
140 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 }); 140 Protocol.Debugger.setAsyncCallStackDepth({ maxDepth: 128 });
141 var testList = [ 141 var testList = [
142 'Basic', 142 'Basic',
143 'UncaughtReject', 143 'UncaughtReject',
144 'UncaughtThrow', 144 'UncaughtThrow',
(...skipping 10 matching lines...) Expand all
155 Protocol.Runtime.evaluate({ expression: \`${name}() 155 Protocol.Runtime.evaluate({ expression: \`${name}()
156 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true}) 156 //# sourceURL=test${capitalize(name)}.js\`, awaitPromise: true})
157 .then(next); 157 .then(next);
158 }) 158 })
159 `); 159 `);
160 })); 160 }));
161 161
162 function capitalize(string) { 162 function capitalize(string) {
163 return string.charAt(0).toUpperCase() + string.slice(1); 163 return string.charAt(0).toUpperCase() + string.slice(1);
164 } 164 }
OLDNEW
« no previous file with comments | « test/inspector/debugger/async-console-count-doesnt-crash.js ('k') | test/inspector/debugger/async-instrumentation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698