Bug 96472

Summary: Web Inspector: InspectorBackend.loadFromJSONIfNeeded should take the JSON url as argument
Product: WebKit Reporter: Vivek Galatage <vivekgalatage>
Component: Web Inspector (Deprecated)Assignee: Vivek Galatage <vivekgalatage>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 90675    
Attachments:
Description Flags
Patch
none
Patch none

Vivek Galatage
Reported 2012-09-11 23:08:39 PDT
The method loadFromJSONIfNeeded of InspectorBackend in InspectorBackend.js should take the JSON url as input. This is needed for the Inspector Protocol test harness to load as the test will be residing in a different location. Patch to follow.
Attachments
Patch (2.32 KB, patch)
2012-09-11 23:13 PDT, Vivek Galatage
no flags
Patch (2.22 KB, patch)
2012-09-12 01:56 PDT, Vivek Galatage
no flags
Vivek Galatage
Comment 1 2012-09-11 23:13:33 PDT
Yury Semikhatsky
Comment 2 2012-09-12 00:39:26 PDT
Comment on attachment 163523 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=163523&action=review > Source/WebCore/inspector/front-end/inspector.js:409 > + var jsonUrl = location.href.slice(0, location.href.lastIndexOf("/")) + "/../Inspector.json"; It will fail on URL like this: http://localhost/inspector/front-end/inspector.html?ws=localhost:9222/devtools/page/2_1 Please test this with the instructions described here: https://groups.google.com/d/msg/google-chrome-developer-tools/L1nemsmtnJI/ndP4cYkTy-sJ
Yury Semikhatsky
Comment 3 2012-09-12 00:43:59 PDT
Bt(In reply to comment #2) > (From update of attachment 163523 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163523&action=review > > > Source/WebCore/inspector/front-end/inspector.js:409 > > + var jsonUrl = location.href.slice(0, location.href.lastIndexOf("/")) + "/../Inspector.json"; > > It will fail on URL like this: http://localhost/inspector/front-end/inspector.html?ws=localhost:9222/devtools/page/2_1 > > Please test this with the instructions described here: https://groups.google.com/d/msg/google-chrome-developer-tools/L1nemsmtnJI/ndP4cYkTy-sJ btw, what was wrong with '../Inspector.json' ?
Vivek Galatage
Comment 4 2012-09-12 01:20:10 PDT
(In reply to comment #3) > btw, what was wrong with '../Inspector.json' ? The call to above location is being made from inspector.js which is included in inspector.html in Source/WebCore/inspector/front-end. So this will work if its getting called from the inspector.html. But in case of the testing harness, the files protocol-test.html and protocol-test.js will be placed somewhere e.g. LayoutTests/http/tests/inspector-protocol folder. So when the call to loadFromJSONIfNeeded is being made from these places, the system will not find the path to the ../Inspector.json. Hence the call site should give the json location relative to where its placed.
Vivek Galatage
Comment 5 2012-09-12 01:29:20 PDT
(In reply to comment #2) > (From update of attachment 163523 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163523&action=review > > > Source/WebCore/inspector/front-end/inspector.js:409 > > + var jsonUrl = location.href.slice(0, location.href.lastIndexOf("/")) + "/../Inspector.json"; > > It will fail on URL like this: http://localhost/inspector/front-end/inspector.html?ws=localhost:9222/devtools/page/2_1 > > Please test this with the instructions described here: https://groups.google.com/d/msg/google-chrome-developer-tools/L1nemsmtnJI/ndP4cYkTy-sJ Or even simple we can just pass "../Inspector.json" as url is already done i.e. var jsonUrl = "../Inspector.json"; InspectorBackend.loadFromJSONIfNeeded(jsonUrl); Without any change with current implementation.
Yury Semikhatsky
Comment 6 2012-09-12 01:48:17 PDT
(In reply to comment #4) > (In reply to comment #3) > > btw, what was wrong with '../Inspector.json' ? > > The call to above location is being made from inspector.js which is included in inspector.html in Source/WebCore/inspector/front-end. So this will work if its getting called from the inspector.html. > > But in case of the testing harness, the files protocol-test.html and protocol-test.js will be placed somewhere e.g. LayoutTests/http/tests/inspector-protocol folder. So when the call to loadFromJSONIfNeeded is being made from these places, the system will not find the path to the ../Inspector.json. Hence the call site should give the json location relative to where its placed. Exactly. But it will only affect the new code. Current implementation can keep using relative URL. (In reply to comment #5) > (In reply to comment #2) > > (From update of attachment 163523 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=163523&action=review > > > > > Source/WebCore/inspector/front-end/inspector.js:409 > > > + var jsonUrl = location.href.slice(0, location.href.lastIndexOf("/")) + "/../Inspector.json"; > > > > It will fail on URL like this: http://localhost/inspector/front-end/inspector.html?ws=localhost:9222/devtools/page/2_1 > > > > Please test this with the instructions described here: https://groups.google.com/d/msg/google-chrome-developer-tools/L1nemsmtnJI/ndP4cYkTy-sJ > > Or even simple we can just pass "../Inspector.json" as url is already done i.e. > > var jsonUrl = "../Inspector.json"; > InspectorBackend.loadFromJSONIfNeeded(jsonUrl); > > Without any change with current implementation. Exactly.
Vivek Galatage
Comment 7 2012-09-12 01:56:34 PDT
WebKit Review Bot
Comment 8 2012-09-12 03:15:31 PDT
Comment on attachment 163551 [details] Patch Clearing flags on attachment: 163551 Committed r128287: <http://trac.webkit.org/changeset/128287>
WebKit Review Bot
Comment 9 2012-09-12 03:15:35 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.