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

Side by Side Diff: test/inspector/debugger/script-parsed-for-runtime-evaluate.js

Issue 2755863002: [Devtools] Add stacktrace to protocol for scriptParsed event (Closed)
Patch Set: [Devtools] Add stacktrace to protocol for scriptParsed event Created 3 years, 9 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 InspectorTest.log("Checks that inspector reports script compiled in Runtime.eval uate," + 5 InspectorTest.log("Checks that inspector reports script compiled in Runtime.eval uate, " +
6 "Runtime.callFunctionOn and Runtime.compileScript"); 6 "Runtime.callFunctionOn and Runtime.compileScript");
7 7
8 InspectorTest.addScript(`
9 function fooTop() {
10 eval(\`
11 function foo() {
12 eval("({})")
13 }
14 foo() //# sourceURL=second-frame.js\`);
15 }
16 //# sourceURL=top-frame.js`, 8, 26);
17
8 Promise.prototype.thenLog = function log(message) { 18 Promise.prototype.thenLog = function log(message) {
9 return this.then(() => InspectorTest.log(message)); 19 return this.then(() => InspectorTest.log(message));
10 } 20 }
11 21
12 var objectId; 22 var objectId;
13 Protocol.Runtime.enable(); 23 Protocol.Runtime.enable();
14 Protocol.Debugger.enable() 24 Protocol.Debugger.enable()
15 .then(() => Protocol.Debugger.onScriptParsed(InspectorTest.logMessage)) 25 .then(() => Protocol.Debugger.onScriptParsed(InspectorTest.logMessage))
16 .then(() => Protocol.Debugger.onScriptFailedToParse(InspectorTest.logMessage)) 26 .then(() => Protocol.Debugger.onScriptFailedToParse(InspectorTest.logMessage))
17 27
(...skipping 21 matching lines...) Expand all
39 .thenLog('Runtime.compileScript with syntax error') 49 .thenLog('Runtime.compileScript with syntax error')
40 .then(() => Protocol.Runtime.compileScript({ expression: "}", 50 .then(() => Protocol.Runtime.compileScript({ expression: "}",
41 sourceURL: "compile-script-syntax-error.js", persistScript: true })) 51 sourceURL: "compile-script-syntax-error.js", persistScript: true }))
42 52
43 .thenLog('Runtime.compileScript persistScript: false (should be no script even ts)') 53 .thenLog('Runtime.compileScript persistScript: false (should be no script even ts)')
44 .then(() => Protocol.Runtime.compileScript({ expression: "({})", 54 .then(() => Protocol.Runtime.compileScript({ expression: "({})",
45 sourceURL: "compile-script-syntax-error.js", persistScript: false })) 55 sourceURL: "compile-script-syntax-error.js", persistScript: false }))
46 .then(() => Protocol.Runtime.compileScript({ expression: "}", 56 .then(() => Protocol.Runtime.compileScript({ expression: "}",
47 sourceURL: "compile-script-syntax-error.js", persistScript: false })) 57 sourceURL: "compile-script-syntax-error.js", persistScript: false }))
48 58
59 .thenLog('Runtime.evaluate compiled script with stack trace')
60 .then(() => Protocol.Runtime.evaluate({
61 expression: "fooTop()"}))
62 .then(msg => objectId = msg.result.result.objectId)
63
49 .then(InspectorTest.completeTest); 64 .then(InspectorTest.completeTest);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698