Bug 614313 - Find arrows are not updated correctly [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Tue, 23 Nov 2010 19:53:29 +0100
changeset 67063 adaaa2c20d1b3e9e0b4ee22bce4d00af9abd1a78
parent 67062 def0ac079806a354fd25cb7614b11c6d3412c60d
child 67064 41d044a0601f61c967fa2f636eba29134892a846
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs614313
Bug 614313 - Find arrows are not updated correctly [r=mfinkle]
mobile/chrome/content/browser-ui.js
mobile/chrome/tests/browser_find.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -1761,23 +1761,22 @@ var FindHelperUI = {
     Browser.selectedBrowser.messageManager.sendAsyncMessage("FindAssist:Previous", { });
   },
 
   goToNext: function findHelperGoToNext() {
     Browser.selectedBrowser.messageManager.sendAsyncMessage("FindAssist:Next", { });
   },
 
   search: function findHelperSearch(aValue) {
+    this.updateCommands(aValue);
+
     // Don't bother searching if the value is empty
-    if (aValue == "") {
-      this.status = null;
+    if (aValue == "")
       return;
-    }
-
-    this.updateCommands(aValue);
+
     Browser.selectedBrowser.messageManager.sendAsyncMessage("FindAssist:Find", { searchString: aValue });
   },
 
   updateCommands: function findHelperUpdateCommands(aValue) {
     let disabled = (this._status == Ci.nsITypeAheadFind.FIND_NOTFOUND) || (aValue == "");
     this._cmdPrevious.setAttribute("disabled", disabled);
     this._cmdNext.setAttribute("disabled", disabled);
   },
--- a/mobile/chrome/tests/browser_find.js
+++ b/mobile/chrome/tests/browser_find.js
@@ -12,12 +12,15 @@ function test() {
   getIdentityHandler().show();
   ok(!menu.hidden, "Site menu is open");
   ok(!navigator.isActive, "Toolbar is closed");
 
   EventUtils.sendMouseEvent({ type: "click" }, item);
   ok(menu.hidden, "Site menu is closed");
   ok(navigator.isActive, "Toolbar is open");
 
+  is(navigator._previousButton.disabled, true, "Previous button should be disabled");
+  is(navigator._nextButton.disabled, true, "Previous button should be disabled");
+
   EventUtils.synthesizeKey("VK_ESCAPE", {}, window);
   ok(menu.hidden, "Site menu is closed");
   ok(!navigator.isActive, "Toolbar is closed");
 }