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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script>
5 function test()
6 {
7 var executionContextId;
8
9 InspectorTest.sendCommand("Runtime.enable", {});
10 InspectorTest.eventHandler["Runtime.executionContextCreated"] = function(mes sageObject)
11 {
12 executionContextId = messageObject.params.context.id;
13
14 compileScriptPromise("\n (", false, "foo1.js")
15 .then(dumpResult)
16 .then(() => compileScriptPromise("239", true, "foo2.js"))
17 .then(dumpResult)
18 .then(() => compileScriptPromise("239", false, "foo3.js"))
19 .then(dumpResult)
20 .then(() => compileScriptPromise("testfunction f()\n{\n return 0; \n}\n", false, "foo4.js"))
21 .then(dumpResult)
22 .then(() => InspectorTest.completeTest());
23 }
24
25 function dumpResult(messageObject)
26 {
27 if (messageObject.result.exceptionDetails)
28 messageObject.result.exceptionDetails.scriptId = 0;
29 if (messageObject.result.scriptId)
30 messageObject.result.scriptId = 0;
31 InspectorTest.logObject(messageObject.result);
32 }
33
34 function compileScriptPromise(expression, persistScript, sourceURL)
35 {
36 var cb;
37 var p = new Promise((resolver) => cb = resolver);
38 InspectorTest.sendCommand("Runtime.compileScript", { expression: express ion, sourceURL: sourceURL, persistScript: persistScript, executionContextId: exe cutionContextId }, cb);
39 return p;
40 }
41 }
42 </script>
43 </head>
44 <body onLoad="runTest();"></body>
45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698