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

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

Issue 2755863002: [Devtools] Add stacktrace to protocol for scriptParsed event (Closed)
Patch Set: fix tests 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 side-by-side diff with in-line comments
Download patch
Index: test/inspector/debugger/script-parsed-for-runtime-evaluate.js
diff --git a/test/inspector/debugger/script-parsed-for-runtime-evaluate.js b/test/inspector/debugger/script-parsed-for-runtime-evaluate.js
index be62089d7ada28f32ff708dc41062acab4873fb6..300821baa32dedff320544e5812bc19290a622ca 100644
--- a/test/inspector/debugger/script-parsed-for-runtime-evaluate.js
+++ b/test/inspector/debugger/script-parsed-for-runtime-evaluate.js
@@ -2,9 +2,29 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-InspectorTest.log("Checks that inspector reports script compiled in Runtime.evaluate," +
+InspectorTest.log("Checks that inspector reports script compiled in Runtime.evaluate, " +
"Runtime.callFunctionOn and Runtime.compileScript");
+InspectorTest.addScript(`
+function fooTop() {
+ eval(\`
+ function foo() {
+ eval("({})")
+ }
+ foo() //# sourceURL=second-frame.js\`);
+}
+//# sourceURL=top-frame.js`, 8, 26);
+
+InspectorTest.addScript(`
+function fooTopFail() {
+ eval(\`
+ function fooFail() {
+ eval("({}")
+ }
+ fooFail() //# sourceURL=second-frame-fail.js\`);
+}
+//# sourceURL=top-frame-fail.js`, 18, 26);
+
Promise.prototype.thenLog = function log(message) {
return this.then(() => InspectorTest.log(message));
}
@@ -46,4 +66,14 @@ Protocol.Debugger.enable()
.then(() => Protocol.Runtime.compileScript({ expression: "}",
sourceURL: "compile-script-syntax-error.js", persistScript: false }))
+ .thenLog('Runtime.evaluate compiled script with stack trace')
+ .then(() => Protocol.Runtime.evaluate({
+ expression: "fooTop()"}))
+ .then(msg => objectId = msg.result.result.objectId)
+
+ .thenLog('Runtime.evaluate compile script error with stack trace')
+ .then(() => Protocol.Runtime.evaluate({
+ expression: "fooTopFail()"}))
+ .then(msg => objectId = msg.result.result.objectId)
+
.then(InspectorTest.completeTest);

Powered by Google App Engine
This is Rietveld 408576698