RESOLVED FIXED Bug 96803
Web Inspector: [Extensions API] explicitly manage extension audit progress
https://bugs.webkit.org/show_bug.cgi?id=96803
Summary Web Inspector: [Extensions API] explicitly manage extension audit progress
Andrey Kosyakov
Reported 2012-09-14 10:10:51 PDT
Currently we update extension audit progress implicitly, based on number of results added and an expected number of results declared when creating the category. It's suggested to make progress indication explicit to the extension code.
Attachments
Patch (15.61 KB, patch)
2012-09-14 10:18 PDT, Andrey Kosyakov
no flags
Patch (18.23 KB, patch)
2012-09-17 09:54 PDT, Andrey Kosyakov
no flags
Patch (18.28 KB, patch)
2012-09-18 00:41 PDT, Andrey Kosyakov
apavlov: review+
apavlov: commit-queue-
Andrey Kosyakov
Comment 1 2012-09-14 10:18:31 PDT
Pavel Feldman
Comment 2 2012-09-14 10:27:01 PDT
Comment on attachment 164179 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164179&action=review Should this new API have a test? > Source/WebCore/inspector/front-end/AuditsPanel.js:284 > + progress.done(); Thisbshould not be needed
Yury Semikhatsky
Comment 3 2012-09-17 04:43:59 PDT
Comment on attachment 164179 [details] Patch r- per pfeldman's comments.
Andrey Kosyakov
Comment 4 2012-09-17 09:54:09 PDT
Alexander Pavlov (apavlov)
Comment 5 2012-09-18 00:08:00 PDT
Comment on attachment 164410 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164410&action=review > Source/WebCore/ChangeLog:3 > + Web Inspector: [Extensions API] exlpicitly manage extension audit progress Please fix this line, too > Source/WebCore/ChangeLog:12 > + - retain old magic for computing audit progress if extension specifies extension results count; Remove trailing ';' > Source/WebCore/ChangeLog:34 > + (WebInspector.ProgressIndicator.prototype.done): Assure only first call to done() has effect; Ditto > Source/WebCore/inspector/front-end/AuditsPanel.js:132 > + category.run(requests, ruleResultReadyCallback.bind(this, result), categoryDoneCallback.bind(this), subprogresses[i]); Can you instantiate subprogresses here instead? Or do you need to always know the full amount of work up front? > Source/WebCore/inspector/front-end/ExtensionAPI.js:514 > + console.warn("Passing resultCouint to audits.addCategory() is deprecated. Use AuditResult.updateProgress() instead."); resultCouint -> resultCount
Andrey Kosyakov
Comment 6 2012-09-18 00:38:18 PDT
Comment on attachment 164410 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164410&action=review >> Source/WebCore/ChangeLog:12 >> + - retain old magic for computing audit progress if extension specifies extension results count; > > Remove trailing ';' replaced with '.' >> Source/WebCore/inspector/front-end/AuditsPanel.js:132 >> + category.run(requests, ruleResultReadyCallback.bind(this, result), categoryDoneCallback.bind(this), subprogresses[i]); > > Can you instantiate subprogresses here instead? Or do you need to always know the full amount of work up front? The reason I'm doing this upfront is that when all children are marked as done, the parent progress indicator is marked as done and hence is removed from view. So this is a guard against an audit category potentially marking its progress as done very early and hence causing the entire progress bar to disappear. I'm moving this down closer to usage, though. >> Source/WebCore/inspector/front-end/ExtensionAPI.js:514 >> + console.warn("Passing resultCouint to audits.addCategory() is deprecated. Use AuditResult.updateProgress() instead."); > > resultCouint -> resultCount fixed
Andrey Kosyakov
Comment 7 2012-09-18 00:41:06 PDT
Alexander Pavlov (apavlov)
Comment 8 2012-09-18 00:44:06 PDT
Comment on attachment 164507 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164507&action=review > Source/WebCore/inspector/front-end/AuditsPanel.js:101 > + var compositeProgress = new WebInspector.CompositeProgress(this._progress); Please move this below, somewhere around var subprogresses = [];
Andrey Kosyakov
Comment 9 2012-09-18 04:43:09 PDT
Raphael Kubo da Costa (:rakuco)
Comment 10 2012-09-18 07:17:12 PDT
I get an additional message here when running inspector/extensions/extensions-audit-api.html on EFL: CONSOLE MESSAGE: line 480: Passing resultCount to audits.addCategory() is deprecated. Use AuditResult.updateProgress() instead.
Andrey Kosyakov
Comment 11 2012-09-18 07:34:09 PDT
(In reply to comment #10) > I get an additional message here when running inspector/extensions/extensions-audit-api.html on EFL: > > CONSOLE MESSAGE: line 480: Passing resultCount to audits.addCategory() is deprecated. Use AuditResult.updateProgress() instead. The console message is there by design, however, the test expectations differ in EFL because other platforms just don't dump console output coming from inspector page to test output (I remember fixing this for chromium in bug 69632). So the long term fix would be to get efl's DRT changed to skip inspector console output as well, and short term would be to add custom expectations or skip the test. It looks like this test is already skipped in LayoutTests/platform/efl/Skipped, I wonder if EFL is using both NRWT and older run-webkit-test that uses Skipped?
Raphael Kubo da Costa (:rakuco)
Comment 12 2012-09-18 07:48:18 PDT
(In reply to comment #11) > (In reply to comment #10) > > I get an additional message here when running inspector/extensions/extensions-audit-api.html on EFL: > > > > CONSOLE MESSAGE: line 480: Passing resultCount to audits.addCategory() is deprecated. Use AuditResult.updateProgress() instead. > > The console message is there by design, however, the test expectations differ in EFL because other platforms just don't dump console output coming from inspector page to test output (I remember fixing this for chromium in bug 69632). So the long term fix would be to get efl's DRT changed to skip inspector console output as well Thanks for the information, I will work on that. > It looks like this test is already skipped in LayoutTests/platform/efl/Skipped, I wonder if EFL is using both NRWT and older run-webkit-test that uses Skipped? EFL uses NRWT; Skipped has extensions-api.html and extensions-audits.html, but not extensions-audit-apis.html :-)
Andrey Kosyakov
Comment 13 2012-09-18 07:54:15 PDT
(In reply to comment #12) > EFL uses NRWT; Skipped has extensions-api.html and extensions-audits.html, but not extensions-audit-apis.html :-) Ouch, sorry -- I missed it's extensions-audit-apis.html. Then I guess we could as well avoid using that deprecated parameter there -- it's not really required for the test and I guess it would be the must practical fix, as it would save us another Skipped test. The problem of inspector console output, though, remains relevant for some other tests (extensions-audits.html would be one example).
Note You need to log in before you can comment on or make changes to this bug.