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

Side by Side Diff: test/inspector/debugger/script-on-after-compile.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 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 correctly process compiled scripts"); 5 InspectorTest.log("Checks that inspector correctly process compiled scripts");
6 6
7 function addScripts() { 7 function addScripts() {
8 // sourceURL in the same line 8 // sourceURL in the same line
9 return addScript("function foo1(){}//# sourceURL=oneline.js\n") 9 return addScript("function foo1(){}//# sourceURL=oneline.js\n")
10 // sourceURL without end line 10 // sourceURL without end line
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 function addScript(source) { 58 function addScript(source) {
59 return Protocol.Runtime.evaluate({ expression: source }); 59 return Protocol.Runtime.evaluate({ expression: source });
60 } 60 }
61 61
62 function requestSourceAndDump(scriptParsedMessage, scriptParsed) { 62 function requestSourceAndDump(scriptParsedMessage, scriptParsed) {
63 Protocol.Debugger.getScriptSource({ scriptId: scriptParsedMessage.params.scrip tId }) 63 Protocol.Debugger.getScriptSource({ scriptId: scriptParsedMessage.params.scrip tId })
64 .then((sourceMessage) => dumpScriptParsed(scriptParsedMessage, sourceMessage , scriptParsed)); 64 .then((sourceMessage) => dumpScriptParsed(scriptParsedMessage, sourceMessage , scriptParsed));
65 } 65 }
66 66
67 function dumpScriptParsed(scriptParsedMessage, sourceMessage, scriptParsed) { 67 function dumpScriptParsed(scriptParsedMessage, sourceMessage, scriptParsed) {
68 var params = scriptParsedMessage.params;
69 var re = /[A-Z0-9]{40,40}/;
70 if (!params.hash || !matchExact(re, params.hash))
71 params.hash = "Invalid hash: " + params.hash;
72 else
73 params.hash = "<hash>";
74 if (params.executionContextId <= 0)
75 params.executionContextId = "Invalid executionContextId: " + params.executio nContextId;
76 else
77 params.executionContextId = "<executionContextId>";
78 if (params.scriptId * 1 <= 0)
79 params.scriptId = "Invalid scriptId: " + params.scriptId;
80 else
81 params.scriptId = "<scriptId>";
82
83 var sourceResult = sourceMessage.result; 68 var sourceResult = sourceMessage.result;
84 sourceResult.scriptSource = sourceResult.scriptSource.replace(/\n/g, "<nl>"); 69 sourceResult.scriptSource = sourceResult.scriptSource.replace(/\n/g, "<nl>");
85 InspectorTest.log(scriptParsed ? "scriptParsed" : "scriptFailedToParse"); 70 InspectorTest.log(scriptParsed ? "scriptParsed" : "scriptFailedToParse");
86 InspectorTest.logObject(sourceResult); 71 InspectorTest.logObject(sourceResult);
87 InspectorTest.logObject(params); 72 InspectorTest.logMessage(scriptParsedMessage.params);
88 } 73 }
89
90 function matchExact(re, str) {
91 var match = str.match(re);
92 return match !== null && str === match[0];
93 }
OLDNEW
« no previous file with comments | « src/inspector/v8-debugger-agent-impl.cc ('k') | test/inspector/debugger/script-on-after-compile-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698