RESOLVED FIXED 89517
Web Inspector: ExtensionPanel.onSearch listener doesn't work
https://bugs.webkit.org/show_bug.cgi?id=89517
Summary Web Inspector: ExtensionPanel.onSearch listener doesn't work
Jan Keromnes
Reported 2012-06-19 15:18:31 PDT
Cross-report from https://code.google.com/p/chromium/issues/detail?id=124800 Reported by kdzwinel, Apr 24, 2012 Chrome Version : 18.0.1025.162 (Official Build 131933) URLs (if applicable) : Other browsers tested: What steps will reproduce the problem? 1. Create an extension that adds new panel to Developer Tools: chrome.devtools.panels.create("xxx", "img/icon_24.png", "xxx.html", function(panel) { //here goes code from point 2}); 2. Set onSearch listener for given panel: panel.onSearch.addListener(function(action, queryString) {console.log('eZTemplates onSearch ' + queryString);}); 3.Load extension, open Developer Tools, navigate to new panel, enter text in search box (top right) What is the expected result? Our listener function should be fired. What happens instead? Listener function is never fired. Please provide any additional information below. Attach a screenshot if possible. Bug appears on both Linux and Windows. Other listeners (onShow, onHidden) declared in the same way in the same chrome.devtools.panels.create callback work as expected.
Attachments
Patch (5.58 KB, patch)
2012-06-20 14:30 PDT, Jan Keromnes
no flags
Archive of layout-test-results from ec2-cr-linux-01 (560.33 KB, application/zip)
2012-06-20 15:24 PDT, WebKit Review Bot
no flags
Patch (5.99 KB, patch)
2012-06-21 12:04 PDT, Jan Keromnes
no flags
Patch (5.97 KB, patch)
2012-06-21 14:12 PDT, Jan Keromnes
no flags
Patch (6.31 KB, patch)
2012-06-22 00:06 PDT, Jan Keromnes
no flags
Patch (6.23 KB, patch)
2012-06-22 11:26 PDT, Jan Keromnes
janx: review+
janx: commit-queue-
Jan Keromnes
Comment 1 2012-06-20 14:30:08 PDT
Jan Keromnes
Comment 2 2012-06-20 14:31:15 PDT
The bug is fixed but the test doesn't seem to work, I'm trying to figure out why.
WebKit Review Bot
Comment 3 2012-06-20 15:24:03 PDT
Comment on attachment 148656 [details] Patch Attachment 148656 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13009322 New failing tests: inspector/extensions/extensions-panel.html
WebKit Review Bot
Comment 4 2012-06-20 15:24:12 PDT
Created attachment 148665 [details] Archive of layout-test-results from ec2-cr-linux-01 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-01 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Jan Keromnes
Comment 5 2012-06-21 12:04:14 PDT
Andrey Kosyakov
Comment 6 2012-06-21 13:53:05 PDT
Comment on attachment 148857 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148857&action=review > LayoutTests/inspector/extensions/extensions-panel.html:87 > + dumpObject({ dumpObject(Array.prototype.slice.call(arguments)) -- this will take care of all the arguments in case we accidentally add any. > LayoutTests/inspector/extensions/extensions-panel.html:92 > + if (callbackCount == 2) == => === > LayoutTests/inspector/extensions/extensions-panel.html:116 > + function performSearch() > + { > + evaluateOnFrontend("WebInspector.searchController._performSearch('hello', true, false, false); reply()"); > + } > // The panel code is expected to report its size via InspectorTest.panelCallback() > - evaluateOnFrontend("InspectorTest.waitForPanel(reply);", nextTest); > + evaluateOnFrontend("InspectorTest.waitForPanel(reply);", performSearch); This could be a separate test (in fact, show() could also be separate).
Jan Keromnes
Comment 7 2012-06-21 14:12:39 PDT
Jan Keromnes
Comment 8 2012-06-21 14:20:30 PDT
(In reply to comment #6) > dumpObject(Array.prototype.slice.call(arguments)) -- this will take care of all the arguments in case we accidentally add any. Fixed. > > LayoutTests/inspector/extensions/extensions-panel.html:92 > > + if (callbackCount == 2) > > == => === Also fixed. > > LayoutTests/inspector/extensions/extensions-panel.html:116 > > + function performSearch() > > + { > > + evaluateOnFrontend("WebInspector.searchController._performSearch('hello', true, false, false); reply()"); > > + } > > // The panel code is expected to report its size via InspectorTest.panelCallback() > > - evaluateOnFrontend("InspectorTest.waitForPanel(reply);", nextTest); > > + evaluateOnFrontend("InspectorTest.waitForPanel(reply);", performSearch); > > This could be a separate test (in fact, show() could also be separate). I actually tried to place it in another test, but as _performSearch has no callback, the tests were flaky. Putting the tests back together was the only way I found to resolve that flakiness issue, and without creating several test panels.
Andrey Kosyakov
Comment 9 2012-06-21 18:09:21 PDT
Comment on attachment 148886 [details] Patch LGTM
Jan Keromnes
Comment 10 2012-06-22 00:06:30 PDT
Jan Keromnes
Comment 11 2012-06-22 00:08:51 PDT
Better patch with separate tests.
Yury Semikhatsky
Comment 12 2012-06-22 00:20:52 PDT
Comment on attachment 148970 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148970&action=review > Source/WebCore/inspector/front-end/ExtensionPanel.js:150 > + WebInspector.extensionServer.notifySearchAction(this._panelName, WebInspector.extensionAPI.panels.SearchAction.CancelSearch); Here and below, please use this.name instead of this._panelName as the latter is private for Panel.js file.
Jan Keromnes
Comment 13 2012-06-22 11:26:55 PDT
Jan Keromnes
Comment 14 2012-06-22 11:28:05 PDT
(In reply to comment #12) > > Source/WebCore/inspector/front-end/ExtensionPanel.js:150 > > + WebInspector.extensionServer.notifySearchAction(this._panelName, WebInspector.extensionAPI.panels.SearchAction.CancelSearch); > > Here and below, please use this.name instead of this._panelName as the latter is private for Panel.js file. Fixed.
Andrey Kosyakov
Comment 15 2012-06-22 11:48:12 PDT
Note You need to log in before you can comment on or make changes to this bug.