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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-compileScript.html

Issue 2130203002: [DevTools] Better ExceptionDetails in js_protocol.json (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 5 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: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-compileScript.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-compileScript.html b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-compileScript.html
new file mode 100644
index 0000000000000000000000000000000000000000..699e55bf0731193b46f82932f043c3da01bf9108
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-compileScript.html
@@ -0,0 +1,45 @@
+<html>
+<head>
+<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
+<script>
+function test()
+{
+ var executionContextId;
+
+ InspectorTest.sendCommand("Runtime.enable", {});
+ InspectorTest.eventHandler["Runtime.executionContextCreated"] = function(messageObject)
+ {
+ executionContextId = messageObject.params.context.id;
+
+ compileScriptPromise("\n (", false, "foo1.js")
+ .then(dumpResult)
+ .then(() => compileScriptPromise("239", true, "foo2.js"))
+ .then(dumpResult)
+ .then(() => compileScriptPromise("239", false, "foo3.js"))
+ .then(dumpResult)
+ .then(() => compileScriptPromise("testfunction f()\n{\n return 0;\n}\n", false, "foo4.js"))
+ .then(dumpResult)
+ .then(() => InspectorTest.completeTest());
+ }
+
+ function dumpResult(messageObject)
+ {
+ if (messageObject.result.exceptionDetails)
+ messageObject.result.exceptionDetails.scriptId = 0;
+ if (messageObject.result.scriptId)
+ messageObject.result.scriptId = 0;
+ InspectorTest.logObject(messageObject.result);
+ }
+
+ function compileScriptPromise(expression, persistScript, sourceURL)
+ {
+ var cb;
+ var p = new Promise((resolver) => cb = resolver);
+ InspectorTest.sendCommand("Runtime.compileScript", { expression: expression, sourceURL: sourceURL, persistScript: persistScript, executionContextId: executionContextId }, cb);
+ return p;
+ }
+}
+</script>
+</head>
+<body onLoad="runTest();"></body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698