v8/test/inspector/debugger/resource-name-to-url-expected.txt
Sigurd Schneider 83d7c4d34b Report reliable embedderName in scriptParsed/scriptFailedToParse
Currently, only a scriptURL is reported, which can be over-written by
sourceURL comments of the script. This means a script can basically
claim to come from anywhere. This means that DevTools doesn't know the
resource name the embedder provided if there is a sourceURL comment.
This CL adds a `embedderName` field to the scriptParsed and
scriptFailedToParse events that reports the name the embedder
associated with the script.

Bug: chromium:974543
Change-Id: I9863f878f57638174847890d9a3818952b1efc27
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2317310
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69078}
2020-07-27 15:40:00 +00:00

131 lines
3.3 KiB
Plaintext

Tests V8InspectorClient::resourceNameToUrl.
Check script with url:
{
method : Debugger.scriptParsed
params : {
embedderName : prefix://url
endColumn : 16
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 033b33d191ed51ed823355d865eb871d811403e2
isLiveEdit : false
isModule : false
length : 16
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
startColumn : 0
startLine : 0
url : prefix://url
}
}
Check script with sourceURL comment:
{
method : Debugger.scriptParsed
params : {
embedderName : prefix://url
endColumn : 37
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : true
hash : 06c136ce206c5f505f32af524e6ec71b5baa0bbb
isLiveEdit : false
isModule : false
length : 37
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
startColumn : 0
startLine : 0
url : foo.js
}
}
Check script failed to parse:
{
method : Debugger.scriptFailedToParse
params : {
embedderName : prefix://url
endColumn : 15
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : false
hash : 033b33d191ed51ed1f44cd0465eb871d811403e2
isModule : false
length : 15
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
startColumn : 0
startLine : 0
url : prefix://url
}
}
Check script failed to parse with sourceURL comment:
{
method : Debugger.scriptFailedToParse
params : {
embedderName : prefix://url
endColumn : 36
endLine : 0
executionContextId : <executionContextId>
hasSourceURL : true
hash : 23a2885951475580023e2a742563d78876d8f05e
isModule : false
length : 36
scriptId : <scriptId>
scriptLanguage : JavaScript
sourceMapURL :
startColumn : 0
startLine : 0
url : foo.js
}
}
Test runtime stack trace:
{
method : Runtime.consoleAPICalled
params : {
args : [
[0] : {
description : 42
type : number
value : 42
}
]
executionContextId : <executionContextId>
stackTrace : {
callFrames : [
[0] : {
columnNumber : 14
functionName : foo
lineNumber : 2
scriptId : <scriptId>
url : prefix://url
}
[1] : {
columnNumber : 0
functionName : eval
lineNumber : 0
scriptId : <scriptId>
url : boo.js
}
[2] : {
columnNumber : 4
functionName :
lineNumber : 4
scriptId : <scriptId>
url : prefix://url
}
]
}
timestamp : <timestamp>
type : log
}
}
Test debugger stack trace:
[
[0] : prefix://url
[1] : boo.js
[2] : prefix://url
]