Bug 1593347 - Fix LDAP address book search results. r+a=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 06 Nov 2019 20:50:00 +1300
changeset 36376 f28c010aac310532478294838f0c4ae9d988c9c8
parent 36375 48cd321f476533f865ecfccca545056e6b7f410c
child 36377 2bd2944137e359094aac45f9cd3cdae34fe9e3ac
push id2521
push usermozilla@jorgk.com
push dateWed, 06 Nov 2019 09:31:04 +0000
treeherdercomm-beta@308f336efa3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1593347
Bug 1593347 - Fix LDAP address book search results. r+a=jorgk Also, enable some address book tests that pass now we have JS as the default
mailnews/addrbook/jsaddrbook/AddrBookDirectory.jsm
mailnews/addrbook/test/unit/xpcshell-mdbaddrbook.ini
mailnews/addrbook/test/unit/xpcshell.ini
--- a/mailnews/addrbook/jsaddrbook/AddrBookDirectory.jsm
+++ b/mailnews/addrbook/jsaddrbook/AddrBookDirectory.jsm
@@ -61,16 +61,18 @@ ChromeUtils.defineModuleGetter(
 function AddrBookDirectory() {}
 AddrBookDirectory.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIAbDirectory]),
   classID: Components.ID("{e96ee804-0bd3-472f-81a6-8a9d65277ad3}"),
 
   _query: null,
 
   init(uri) {
+    this._uri = uri;
+
     let index = uri.indexOf("?");
     if (index >= 0) {
       this._query = uri.substring(index + 1);
       uri = uri.substring(0, index);
     }
     if (/\/MailList\d+$/.test(uri)) {
       let parent = MailServices.ab.getDirectory(
         uri.substring(0, uri.lastIndexOf("/"))
@@ -81,17 +83,16 @@ AddrBookDirectory.prototype = {
           this.__proto__ = list;
           return;
         }
       }
       throw Cr.NS_ERROR_UNEXPECTED;
     }
 
     this.__proto__ = bookPrototype;
-    this._uri = uri;
 
     if (!this.dirPrefId) {
       let filename = uri.substring("jsaddrbook://".length);
       for (let child of Services.prefs.getChildList("ldap_2.servers.")) {
         if (
           child.endsWith(".filename") &&
           Services.prefs.getStringPref(child) == filename
         ) {
--- a/mailnews/addrbook/test/unit/xpcshell-mdbaddrbook.ini
+++ b/mailnews/addrbook/test/unit/xpcshell-mdbaddrbook.ini
@@ -3,16 +3,11 @@ dupe-manifest =
 head = head_addrbook.js
 tail =
 support-files = data/*
 tags = mdbaddrbook
 
 # These are the tests that do not pass or should not pass when using the
 # JS directory provider.
 
-[test_bug534822.js] # head_jsaddrbook.js breaks test
-[test_ldap1.js]
-[test_ldap2.js]
-[test_ldapOffline.js]
-[test_uid.js]
 [test_uuid.js]
 
 [include:xpcshell.ini]
--- a/mailnews/addrbook/test/unit/xpcshell.ini
+++ b/mailnews/addrbook/test/unit/xpcshell.ini
@@ -1,24 +1,29 @@
 [test_basic_nsIAbCard.js]
 [test_basic_nsIAbDirectory.js]
 [test_bug387403.js]
 [test_bug448165.js]
+[test_bug534822.js]
 [test_bug1522453.js]
 [test_cardForEmail.js]
 [test_collection.js]
 [test_collection_2.js]
 [test_db_enumerator.js]
 [test_jsaddrbook.js]
+[test_ldap1.js]
+[test_ldap2.js]
+[test_ldapOffline.js]
 [test_mailList1.js]
 [test_notifications.js]
 [test_nsAbAutoCompleteMyDomain.js]
 [test_nsAbAutoCompleteSearch1.js]
 [test_nsAbAutoCompleteSearch2.js]
 [test_nsAbAutoCompleteSearch3.js]
 [test_nsAbAutoCompleteSearch4.js]
 [test_nsAbAutoCompleteSearch5.js]
 [test_nsAbAutoCompleteSearch6.js]
 [test_nsAbAutoCompleteSearch7.js]
 [test_nsAbManager1.js]
 [test_nsAbManager2.js]
 [test_nsAbManager3.js]
 [test_nsIAbCard.js]
+[test_uid.js]