Bug 1088660 - Improve the search bar UI to support one-off searches - fix tests that failed on fx-team, r=felipe over email.
authorFlorian Quèze <florian@queze.net>
Thu, 27 Nov 2014 12:24:53 +0100
changeset 242170 69c30325e867be4b9fdb6d1de6d7484dfd0a4afe
parent 242169 5c24bc95888c59672963c71033b6968e4373c998
child 242171 474e1bda6a0f9c824a498d9a5060bb33377fad43
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1088660
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1088660 - Improve the search bar UI to support one-off searches - fix tests that failed on fx-team, r=felipe over email.
browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js
toolkit/components/search/SearchSuggestionController.jsm
--- a/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js
+++ b/browser/components/customizableui/test/browser_940307_panel_click_closure_handling.js
@@ -96,16 +96,17 @@ add_task(function*() {
   ok(isPanelUIOpen(), "Panel should still be open");
 
   let hiddenPanelPromise = promisePanelHidden(window);
   EventUtils.synthesizeKey("VK_ESCAPE", {});
   yield hiddenPanelPromise;
   ok(!isPanelUIOpen(), "Panel should no longer be open");
 
   Services.prefs.setBoolPref("browser.search.suggest.enabled", suggestEnabled);
+  CustomizableUI.reset();
 });
 
 add_task(function*() {
   button = document.createElement("toolbarbutton");
   button.id = "browser_946166_button_disabled";
   button.setAttribute("disabled", "true");
   button.setAttribute("label", "Button");
   PanelUI.contents.appendChild(button);
--- a/toolkit/components/search/SearchSuggestionController.jsm
+++ b/toolkit/components/search/SearchSuggestionController.jsm
@@ -313,17 +313,23 @@ this.SearchSuggestionController.prototyp
     }
   },
 
   /**
    * @param {Array} suggestResults - an array of result objects from different sources (local or remote)
    * @return {Object}
    */
   _dedupeAndReturnResults: function(suggestResults) {
-    NS_ASSERT(this._searchString !== null, "this._searchString shouldn't be null when returning results");
+    if (this._searchString === null) {
+      // _searchString can be null if stop() was called and remote suggestions
+      // were disabled (stopping if we are fetching remote suggestions will
+      // cause a promise rejection before we reach _dedupeAndReturnResults).
+      return null;
+    }
+
     let results = {
       term: this._searchString,
       remote: [],
       local: [],
       formHistoryResult: null,
     };
 
     for (let result of suggestResults) {