trying to lower the frequency of intermittent in Bug 851349, r=past
authorGirish Sharma <scrapmachines@gmail.com>
Mon, 29 Jul 2013 22:40:20 +0530
changeset 152657 7647768b47066d6e4506971b57ac303c5d4c335e
parent 152656 82659e86fd98739a56cc08058d29751829634848
child 152658 14cdbdae216067894c15978143f54ec2e5e0b635
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs851349
milestone25.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
trying to lower the frequency of intermittent in Bug 851349, r=past
browser/devtools/inspector/selector-search.js
browser/devtools/inspector/test/browser_inspector_bug_831693_searchbox_panel_navigation.js
--- a/browser/devtools/inspector/selector-search.js
+++ b/browser/devtools/inspector/selector-search.js
@@ -193,17 +193,17 @@ SelectorSearch.prototype = {
    * invoked as the user is typing if the input box type is search.
    */
   _onHTMLSearch: function SelectorSearch__onHTMLSearch() {
     let query = this.searchBox.value;
     if (query == this._lastSearched) {
       return;
     }
     this._lastSearched = query;
-    this._searchResults = null;
+    this._searchResults = [];
     this._searchIndex = 0;
 
     if (query.length == 0) {
       this._lastValidSearch = "";
       this.searchBox.removeAttribute("filled");
       this.searchBox.classList.remove("devtools-no-search-result");
       if (this.searchPopup.isOpen) {
         this.searchPopup.hidePopup();
@@ -223,17 +223,17 @@ SelectorSearch.prototype = {
       // Value has changed since we started this request, we're done.
       if (query != this.searchBox.value) {
         if (queryList) {
           queryList.release();
         }
         return promise.reject(null);
       }
 
-      this._searchResults = queryList;
+      this._searchResults = queryList || [];
       if (this._searchResults && this._searchResults.length > 0) {
         this._lastValidSearch = query;
         // Even though the selector matched atleast one node, there is still
         // possibility of suggestions.
         if (query.match(/[\s>+]$/)) {
           // If the query has a space or '>' at the end, create a selector to match
           // the children of the selector inside the search box by adding a '*'.
           this._lastValidSearch += "*";
--- a/browser/devtools/inspector/test/browser_inspector_bug_831693_searchbox_panel_navigation.js
+++ b/browser/devtools/inspector/test/browser_inspector_bug_831693_searchbox_panel_navigation.js
@@ -103,16 +103,23 @@ function test()
     let [key, query] = keyStates[index];
     state = index;
 
     info("pressing key " + key + " to get searchbox value as " + query);
     EventUtils.synthesizeKey(key, {}, inspector.panelWin);
   }
 
   function checkState(event) {
+    if (event && event.keyCode != event.DOM_VK_UP &&
+        event.keyCode != event.DOM_VK_DOWN) {
+      info("Should wait before server sends the qSA response.");
+      inspector.searchSuggestions._lastQuery
+               .then(() => checkState(), () => checkState());
+      return;
+    }
     if (panelOpeningStates.indexOf(state) != -1 &&
         !inspector.searchSuggestions.searchPopup.isOpen) {
       info("Panel is not open, should wait before it shows up.");
       panel.parentNode.addEventListener("popupshown", function retry() {
         panel.parentNode.removeEventListener("popupshown", retry, false);
         info("Panel is visible now");
         executeSoon(checkState);
       }, false);