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

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

Issue 2219393003: DevTools: Runtime.compileScript with persistScript = false should not report script (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-compileScript-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 function test() 5 function test()
6 { 6 {
7 var executionContextId; 7 var executionContextId;
8 8
9 InspectorTest.sendCommand("Runtime.enable", {}); 9 InspectorTest.sendCommand("Debugger.enable", {}, onDebuggerEnabled);
10 InspectorTest.eventHandler["Runtime.executionContextCreated"] = function(mes sageObject) 10
11 function onDebuggerEnabled()
12 {
13 InspectorTest.sendCommand("Runtime.enable", {});
14 InspectorTest.eventHandler["Debugger.scriptParsed"] = onScriptParsed;
15 InspectorTest.eventHandler["Runtime.executionContextCreated"] = onExecut ionContextCreated;
16 }
17
18 function onScriptParsed(messageObject)
19 {
20 if (!messageObject.params.url)
21 return;
22 InspectorTest.log("Debugger.scriptParsed: " + messageObject.params.url);
23 }
24
25 function onExecutionContextCreated(messageObject)
11 { 26 {
12 executionContextId = messageObject.params.context.id; 27 executionContextId = messageObject.params.context.id;
13 28 testCompileScript("\n (", false, "foo1.js")
14 compileScriptPromise("\n (", false, "foo1.js") 29 .then(() => testCompileScript("239", true, "foo2.js"))
15 .then(dumpResult) 30 .then(() => testCompileScript("239", false, "foo3.js"))
16 .then(() => compileScriptPromise("239", true, "foo2.js")) 31 .then(() => testCompileScript("testfunction f()\n{\n return 0;\n} \n", false, "foo4.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()); 32 .then(() => InspectorTest.completeTest());
23 } 33 }
24 34
25 function dumpResult(messageObject) 35 function testCompileScript(expression, persistScript, sourceURL)
26 { 36 {
27 if (messageObject.result.exceptionDetails) 37 InspectorTest.log("Compiling script: " + sourceURL);
28 messageObject.result.exceptionDetails.scriptId = 0; 38 InspectorTest.log(" persist: " + persistScript);
29 if (messageObject.result.scriptId) 39 var callback;
30 messageObject.result.scriptId = 0; 40 var promise = new Promise(resolver => callback = resolver);
31 InspectorTest.logObject(messageObject.result); 41 InspectorTest.sendCommand("Runtime.compileScript", {
32 } 42 expression: expression,
43 sourceURL: sourceURL,
44 persistScript: persistScript,
45 executionContextId: executionContextId
46 }, onCompiled);
47 return promise;
33 48
34 function compileScriptPromise(expression, persistScript, sourceURL) 49 function onCompiled(messageObject)
35 { 50 {
36 var cb; 51 var result = messageObject.result;
37 var p = new Promise((resolver) => cb = resolver); 52 if (result.exceptionDetails)
38 InspectorTest.sendCommand("Runtime.compileScript", { expression: express ion, sourceURL: sourceURL, persistScript: persistScript, executionContextId: exe cutionContextId }, cb); 53 result.exceptionDetails.scriptId = 0;
39 return p; 54 if (result.scriptId)
55 result.scriptId = 0;
56 InspectorTest.logObject(result, "compilation result: ");
57 InspectorTest.log("-----");
58 callback();
59 }
40 } 60 }
41 } 61 }
42 </script> 62 </script>
43 </head> 63 </head>
44 <body onLoad="runTest();"></body> 64 <body onLoad="runTest();"></body>
45 </html> 65 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-compileScript-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698