Backout Bug 733802 due to unit test bustage a=bustage fix
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 20 Mar 2012 20:12:47 +0000
changeset 10674 83fc75101b40e82eac93840812273a2bd2d16d00
parent 10673 63a11393de40d63283e16842e372f58a4793dfc0
child 10675 256009588911d53c2965c9545b23c4af360b8a83
child 10678 9a283e3c87176973a01b82a78a9bd5502b1a3cbf
push id419
push userbugzilla@standard8.plus.com
push dateTue, 20 Mar 2012 20:17:26 +0000
treeherdercomm-beta@83fc75101b40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs733802
Backout Bug 733802 due to unit test bustage a=bustage fix
mail/components/mailComponents.manifest
mail/components/webSearchProvider.js
--- a/mail/components/mailComponents.manifest
+++ b/mail/components/mailComponents.manifest
@@ -14,9 +14,9 @@ contract @mozilla.org/uriloader/content-
 contract @mozilla.org/uriloader/content-handler;1?type=text/plain {1c73f03a-b817-4640-b984-18c3478a9ae3}
 
 component {eb239c82-fac9-431e-98d7-11cacd0f71b8} mailGlue.js
 contract @mozilla.org/mail/mailglue;1 {eb239c82-fac9-431e-98d7-11cacd0f71b8}
 category app-startup MailGlue service,@mozilla.org/mail/mailglue;1
 
 component {76a80bff-8c3f-4b78-ad2c-80099e35375d} webSearchProvider.js
 contract @mozilla.org/mail/web-search-provider;1 {76a80bff-8c3f-4b78-ad2c-80099e35375d}
-category xpcom-directory-providers web-search-directory-provider @mozilla.org/mail/web-search-provider;1
+category xpcom-directory-providers web-search-directory-provider service,@mozilla.org/mail/web-search-provider;1
--- a/mail/components/webSearchProvider.js
+++ b/mail/components/webSearchProvider.js
@@ -32,54 +32,41 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 const NS_APP_SEARCH_DIR_LIST = "SrchPluginsDL";
 const NS_APP_USER_SEARCH_DIR = "UsrSrchPlugns";
 const NS_APP_SEARCH_DIR = "SrchPlugns";
-const NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProcD";
+const NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProdD";
 const XRE_EXTENSIONS_DIR_LIST = "XREExtDL";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
-const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 function AppendingEnumerator(base, append) {
   this.base = base;
   this.append = append;
-  this.next = null;
-
-  this.getNext();
 }
 
 AppendingEnumerator.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISimpleEnumerator]),
 
   hasMoreElements: function() {
-    return this.next != null;
+    return this.base.hasMoreElements();
   },
 
   getNext: function() {
-    let res = this.next;
-    let next = null;
-
-    while (this.base.hasMoreElements() && !next) {
-      let file = this.base.getNext().QueryInterface(Ci.nsIFile);
-      file.append(this.append);
-      if (file.exists())
-        next = file;
-    }
-
-    this.next = next;
-    return res;
+    let file = this.base.getNext().QueryInterface(Ci.nsIFile);
+    file.append(this.append);
+    return file;
   },
 };
 
 function UnionEnumerator(first, second) {
   this.first = first;
   this.second = second;
 }
 
@@ -102,17 +89,17 @@ UnionEnumerator.prototype = {
 function WebSearchProvider() {}
 WebSearchProvider.prototype = {
   classDescription: "Web Search Provider",
   classID: Components.ID("{76a80bff-8c3f-4b78-ad2c-80099e35375d}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider,
                                          Ci.nsIDirectoryServiceProvider2]),
 
   getFile: function() {
-    return null;
+    throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
   },
 
   getFiles: function(prop) {
     if (prop != NS_APP_SEARCH_DIR_LIST)
       return null;
 
     /**
      * We want to preserve the following order, since the search service loads
@@ -172,16 +159,16 @@ WebSearchProvider.prototype = {
         array.appendElement(defLocalePlugins, false);
     }
     catch(e) {}
   },
 
   appendFileKey: function(key, array) {
     try {
       let file = Services.dirsvc.get(key, Ci.nsIFile);
-      if (file.exists())
+      if (!file.exists())
         array.appendElement(file, false);
     }
     catch(e) {}
   },
 };
 
 const NSGetFactory = XPCOMUtils.generateNSGetFactory([WebSearchProvider]);