dbfcc4878a
Some clients (see Node.js) use platform path as ScriptOrigin. Reporting platform path in protocol makes using protocol much harder. This CL introduced V8InspectorClient::resourceNameToUrl method that is called for any reported using protocol url. V8Inspector uses url internally as well so protocol client may generate pattern for blackboxing with file urls only and does not need to build complicated regexp that covers files urls and platform paths on different platforms. R=lushnikov@chromium.org TBR=yangguo@chromium.org Bug: none Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel Change-Id: Iff302e7441df922fa5d689fe510f5a9bfd470b9b Reviewed-on: https://chromium-review.googlesource.com/1164624 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Alexei Filippov <alph@chromium.org> Cr-Commit-Position: refs/heads/master@{#55029}
123 lines
3.0 KiB
Plaintext
123 lines
3.0 KiB
Plaintext
Tests V8InspectorClient::resourceNameToUrl.
|
|
Check script with url:
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
endColumn : 16
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : 033b33d191ed51ed823355d865eb871d811403e2
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 16
|
|
scriptId : <scriptId>
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : prefix://url
|
|
}
|
|
}
|
|
Check script with sourceURL comment:
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
endColumn : 37
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : true
|
|
hash : 06c136ce206c5f505f32af524e6ec71b5baa0bbb
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 37
|
|
scriptId : <scriptId>
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : foo.js
|
|
}
|
|
}
|
|
Check script failed to parse:
|
|
{
|
|
method : Debugger.scriptFailedToParse
|
|
params : {
|
|
endColumn : 15
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : 033b33d191ed51ed1f44cd0465eb871d811403e2
|
|
isModule : false
|
|
length : 15
|
|
scriptId : <scriptId>
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : prefix://url
|
|
}
|
|
}
|
|
Check script failed to parse with sourceURL comment:
|
|
{
|
|
method : Debugger.scriptFailedToParse
|
|
params : {
|
|
endColumn : 36
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : true
|
|
hash : 23a2885951475580023e2a742563d78876d8f05e
|
|
isModule : false
|
|
length : 36
|
|
scriptId : <scriptId>
|
|
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 :
|
|
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
|
|
]
|