Web Inspector: ExtensionPanel.onSearch listener doesn't work
authorcaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2012 18:47:56 +0000 (18:47 +0000)
committercaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2012 18:47:56 +0000 (18:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89517

Patch by Jan Keromnes <janx@linux.com> on 2012-06-22
Reviewed by Yury Semikhatsky.

Source/WebCore:

Added a test to see if listener fires on search:
LayoutTests/inspector/extensions/extensions-panel.html

* inspector/front-end/ExtensionPanel.js:
(WebInspector.ExtensionPanel.prototype.searchCanceled):
(WebInspector.ExtensionPanel.prototype.performSearch):
(WebInspector.ExtensionPanel.prototype.jumpToNextSearchResult):
(WebInspector.ExtensionPanel.prototype.jumpToPreviousSearchResult):

LayoutTests:

* inspector/extensions/extensions-panel-expected.txt:
* inspector/extensions/extensions-panel.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/extensions/extensions-panel-expected.txt
LayoutTests/inspector/extensions/extensions-panel.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/ExtensionPanel.js

index 1e34b2c..ccd88aa 100644 (file)
@@ -1,3 +1,13 @@
+2012-06-22  Jan Keromnes  <janx@linux.com>
+
+        Web Inspector: ExtensionPanel.onSearch listener doesn't work
+        https://bugs.webkit.org/show_bug.cgi?id=89517
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/extensions/extensions-panel-expected.txt:
+        * inspector/extensions/extensions-panel.html:
+
 2012-06-22  Silvia Pfeiffer  <silviapf@chromium.org>
 
         [Chromium] Adjust the displayed elements of the new Chrome media controls.
index e5788be..867dab8 100644 (file)
@@ -23,6 +23,18 @@ Panel created
 }
 Extension panel size correct
 Panel shown
+RUNNING TEST: extension_testSearch
+Panel hidden
+Panel searched:
+{
+    0 : "performSearch"
+    1 : "hello"
+}
+Panel searched:
+{
+    0 : "cancelSearch"
+    1 : undefined
+}
 RUNNING TEST: extension_testStatusBarButtons
 Created a status bar button, dump follows:
 {
@@ -32,7 +44,6 @@ Created a status bar button, dump follows:
     }
     update : <function>
 }
-Panel hidden
 button1 clicked
 Status bar buttons state:
 status bar item 0, icon: .../inspector/resources/button1.png, tooltip: 'Button One tooltip', disabled: false
index ff1d4f6..262dc5c 100644 (file)
@@ -70,8 +70,6 @@ function initialize_extensionsPanelTest()
 
 function extension_testCreatePanel(nextTest)
 {
-    var callbackCount = 0;
-
     function onPanelCreated(panel)
     {
         output("Panel created");
@@ -104,6 +102,27 @@ function extension_testCreatePanel(nextTest)
     webInspector.panels.create("Test Panel", basePath + "extension-panel.png", basePath + "extension-panel.html", onPanelCreated);
 }
 
+function extension_testSearch(nextTest)
+{
+    var callbackCount = 0;
+
+    function onPanelCreated(panel)
+    {
+        panel.onSearch.addListener(function(action, queryString) {
+            output("Panel searched:");
+            dumpObject(Array.prototype.slice.call(arguments));
+            callbackCount++;
+            if (callbackCount === 2)
+                nextTest();
+        });
+
+        extension_showPanel("extension");
+    }
+    evaluateOnFrontend("WebInspector.searchController._performSearch('hello', true, false, false); reply()");
+    var basePath = location.pathname.replace(/\/[^/]*$/, "/");
+    webInspector.panels.create("Test Panel", basePath + "extension-panel.png", basePath + "non-existent.html", onPanelCreated);
+}
+
 function extension_testStatusBarButtons(nextTest)
 {
     var basePath = location.pathname.replace(/\/[^/]*$/, "/");
index d20f799..a32ffe6 100644 (file)
@@ -1,3 +1,19 @@
+2012-06-22  Jan Keromnes  <janx@linux.com>
+
+        Web Inspector: ExtensionPanel.onSearch listener doesn't work
+        https://bugs.webkit.org/show_bug.cgi?id=89517
+
+        Reviewed by Yury Semikhatsky.
+
+        Added a test to see if listener fires on search:
+        LayoutTests/inspector/extensions/extensions-panel.html
+
+        * inspector/front-end/ExtensionPanel.js:
+        (WebInspector.ExtensionPanel.prototype.searchCanceled):
+        (WebInspector.ExtensionPanel.prototype.performSearch):
+        (WebInspector.ExtensionPanel.prototype.jumpToNextSearchResult):
+        (WebInspector.ExtensionPanel.prototype.jumpToPreviousSearchResult):
+
 2012-06-22  Brian Salomon  <bsalomon@google.com>
 
         Increase the GrContext texture cache count cap to 2K
index d1c281c..551e394 100644 (file)
@@ -147,25 +147,25 @@ WebInspector.ExtensionPanel.prototype = {
 
     searchCanceled: function(startingNewSearch)
     {
-        WebInspector.extensionServer.notifySearchAction(this._id, WebInspector.extensionAPI.panels.SearchAction.CancelSearch);
+        WebInspector.extensionServer.notifySearchAction(this.name, WebInspector.extensionAPI.panels.SearchAction.CancelSearch);
         WebInspector.Panel.prototype.searchCanceled.apply(this, arguments);
     },
 
     performSearch: function(query)
     {
-        WebInspector.extensionServer.notifySearchAction(this._id, WebInspector.extensionAPI.panels.SearchAction.PerformSearch, query);
+        WebInspector.extensionServer.notifySearchAction(this.name, WebInspector.extensionAPI.panels.SearchAction.PerformSearch, query);
         WebInspector.Panel.prototype.performSearch.apply(this, arguments);
     },
 
     jumpToNextSearchResult: function()
     {
-        WebInspector.extensionServer.notifySearchAction(this._id, WebInspector.extensionAPI.panels.SearchAction.NextSearchResult);
+        WebInspector.extensionServer.notifySearchAction(this.name, WebInspector.extensionAPI.panels.SearchAction.NextSearchResult);
         WebInspector.Panel.prototype.jumpToNextSearchResult.call(this);
     },
 
     jumpToPreviousSearchResult: function()
     {
-        WebInspector.extensionServer.notifySearchAction(this._id, WebInspector.extensionAPI.panels.SearchAction.PreviousSearchResult);
+        WebInspector.extensionServer.notifySearchAction(this.name, WebInspector.extensionAPI.panels.SearchAction.PreviousSearchResult);
         WebInspector.Panel.prototype.jumpToPreviousSearchResult.call(this);
     },