Bug 875059, part 2: Move mailnews/base/search to mailnews/search. r=mkmelin
authorJoshua Cranmer <Pidgeot18@gmail.com>
Tue, 04 Aug 2020 20:13:10 +0000
changeset 39417 05d8dba407033ddf81f2ea51f0ea3b242cb80242
parent 39416 dc216c691deba37f2de6d346a8b44aeaca3f4302
child 39418 e12a85678599313cad211d7f9bdaba26104ebd93
push id2710
push userclokep@gmail.com
push dateMon, 24 Aug 2020 19:52:31 +0000
treeherdercomm-beta@b8162cd2900e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs875059
Bug 875059, part 2: Move mailnews/base/search to mailnews/search. r=mkmelin Depends on D85670 Differential Revision: https://phabricator.services.mozilla.com/D85671
mail/base/content/SearchDialog.js
mail/base/content/SearchDialog.xhtml
mail/components/addrbook/content/abSearchDialog.js
mail/components/addrbook/content/abSearchDialog.xhtml
mail/extensions/mailviews/content/mailViewSetup.js
mail/extensions/mailviews/content/mailViewSetup.xhtml
mailnews/base/content/virtualFolderProperties.js
mailnews/base/content/virtualFolderProperties.xhtml
mailnews/base/moz.build
mailnews/base/search/content/CustomHeaders.js
mailnews/base/search/content/CustomHeaders.xhtml
mailnews/base/search/content/FilterEditor.js
mailnews/base/search/content/FilterEditor.xhtml
mailnews/base/search/content/searchTerm.inc.xhtml
mailnews/base/search/content/searchTerm.js
mailnews/base/search/content/searchWidgets.js
mailnews/base/search/content/viewLog.js
mailnews/base/search/content/viewLog.xhtml
mailnews/base/search/public/moz.build
mailnews/base/search/public/nsIMsgFilter.idl
mailnews/base/search/public/nsIMsgFilterCustomAction.idl
mailnews/base/search/public/nsIMsgFilterHitNotify.idl
mailnews/base/search/public/nsIMsgFilterList.idl
mailnews/base/search/public/nsIMsgFilterPlugin.idl
mailnews/base/search/public/nsIMsgFilterService.idl
mailnews/base/search/public/nsIMsgOperationListener.idl
mailnews/base/search/public/nsIMsgSearchAdapter.idl
mailnews/base/search/public/nsIMsgSearchCustomTerm.idl
mailnews/base/search/public/nsIMsgSearchNotify.idl
mailnews/base/search/public/nsIMsgSearchScopeTerm.idl
mailnews/base/search/public/nsIMsgSearchSession.idl
mailnews/base/search/public/nsIMsgSearchTerm.idl
mailnews/base/search/public/nsIMsgSearchValidityManager.idl
mailnews/base/search/public/nsIMsgSearchValidityTable.idl
mailnews/base/search/public/nsIMsgSearchValue.idl
mailnews/base/search/public/nsIMsgTraitService.idl
mailnews/base/search/public/nsMsgBodyHandler.h
mailnews/base/search/public/nsMsgFilterCore.idl
mailnews/base/search/public/nsMsgResultElement.h
mailnews/base/search/public/nsMsgSearchAdapter.h
mailnews/base/search/public/nsMsgSearchBoolExpression.h
mailnews/base/search/public/nsMsgSearchCore.idl
mailnews/base/search/public/nsMsgSearchScopeTerm.h
mailnews/base/search/public/nsMsgSearchTerm.h
mailnews/base/search/src/Bogofilter.sfd
mailnews/base/search/src/DSPAM.sfd
mailnews/base/search/src/Habeas.sfd
mailnews/base/search/src/MsgTraitService.jsm
mailnews/base/search/src/POPFile.sfd
mailnews/base/search/src/PeriodicFilterManager.jsm
mailnews/base/search/src/SpamAssassin.sfd
mailnews/base/search/src/SpamCatcher.sfd
mailnews/base/search/src/SpamPal.sfd
mailnews/base/search/src/components.conf
mailnews/base/search/src/moz.build
mailnews/base/search/src/nsMsgBodyHandler.cpp
mailnews/base/search/src/nsMsgFilter.cpp
mailnews/base/search/src/nsMsgFilter.h
mailnews/base/search/src/nsMsgFilterList.cpp
mailnews/base/search/src/nsMsgFilterList.h
mailnews/base/search/src/nsMsgFilterService.cpp
mailnews/base/search/src/nsMsgFilterService.h
mailnews/base/search/src/nsMsgImapSearch.cpp
mailnews/base/search/src/nsMsgLocalSearch.cpp
mailnews/base/search/src/nsMsgLocalSearch.h
mailnews/base/search/src/nsMsgSearchAdapter.cpp
mailnews/base/search/src/nsMsgSearchImap.h
mailnews/base/search/src/nsMsgSearchNews.cpp
mailnews/base/search/src/nsMsgSearchNews.h
mailnews/base/search/src/nsMsgSearchSession.cpp
mailnews/base/search/src/nsMsgSearchSession.h
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/search/src/nsMsgSearchValue.cpp
mailnews/base/search/src/nsMsgSearchValue.h
mailnews/base/test/unit/test_base64_decoding.js
mailnews/base/test/unit/test_bug366491.js
mailnews/base/test/unit/test_bug404489.js
mailnews/base/test/unit/test_copyThenMoveManual.js
mailnews/base/test/unit/test_junkWhitelisting.js
mailnews/base/test/unit/test_quarantineFilterMove.js
mailnews/base/test/unit/test_search.js
mailnews/base/test/unit/test_searchAddressInAb.js
mailnews/base/test/unit/test_searchBody.js
mailnews/base/test/unit/test_searchBoolean.js
mailnews/base/test/unit/test_searchChaining.js
mailnews/base/test/unit/test_searchCustomTerm.js
mailnews/base/test/unit/test_searchJunk.js
mailnews/base/test/unit/test_searchLocalizationStrings.js
mailnews/base/test/unit/test_searchTag.js
mailnews/base/test/unit/test_searchUint32HdrProperty.js
mailnews/base/test/unit/xpcshell.ini
mailnews/build/moz.build
mailnews/jar.mn
mailnews/moz.build
mailnews/search/content/CustomHeaders.js
mailnews/search/content/CustomHeaders.xhtml
mailnews/search/content/FilterEditor.js
mailnews/search/content/FilterEditor.xhtml
mailnews/search/content/searchTerm.inc.xhtml
mailnews/search/content/searchTerm.js
mailnews/search/content/searchWidgets.js
mailnews/search/content/viewLog.js
mailnews/search/content/viewLog.xhtml
mailnews/search/public/moz.build
mailnews/search/public/nsIMsgFilter.idl
mailnews/search/public/nsIMsgFilterCustomAction.idl
mailnews/search/public/nsIMsgFilterHitNotify.idl
mailnews/search/public/nsIMsgFilterList.idl
mailnews/search/public/nsIMsgFilterPlugin.idl
mailnews/search/public/nsIMsgFilterService.idl
mailnews/search/public/nsIMsgOperationListener.idl
mailnews/search/public/nsIMsgSearchAdapter.idl
mailnews/search/public/nsIMsgSearchCustomTerm.idl
mailnews/search/public/nsIMsgSearchNotify.idl
mailnews/search/public/nsIMsgSearchScopeTerm.idl
mailnews/search/public/nsIMsgSearchSession.idl
mailnews/search/public/nsIMsgSearchTerm.idl
mailnews/search/public/nsIMsgSearchValidityManager.idl
mailnews/search/public/nsIMsgSearchValidityTable.idl
mailnews/search/public/nsIMsgSearchValue.idl
mailnews/search/public/nsIMsgTraitService.idl
mailnews/search/public/nsMsgBodyHandler.h
mailnews/search/public/nsMsgFilterCore.idl
mailnews/search/public/nsMsgResultElement.h
mailnews/search/public/nsMsgSearchAdapter.h
mailnews/search/public/nsMsgSearchBoolExpression.h
mailnews/search/public/nsMsgSearchCore.idl
mailnews/search/public/nsMsgSearchScopeTerm.h
mailnews/search/public/nsMsgSearchTerm.h
mailnews/search/src/Bogofilter.sfd
mailnews/search/src/DSPAM.sfd
mailnews/search/src/Habeas.sfd
mailnews/search/src/MsgTraitService.jsm
mailnews/search/src/POPFile.sfd
mailnews/search/src/PeriodicFilterManager.jsm
mailnews/search/src/SpamAssassin.sfd
mailnews/search/src/SpamCatcher.sfd
mailnews/search/src/SpamPal.sfd
mailnews/search/src/components.conf
mailnews/search/src/moz.build
mailnews/search/src/nsMsgBodyHandler.cpp
mailnews/search/src/nsMsgFilter.cpp
mailnews/search/src/nsMsgFilter.h
mailnews/search/src/nsMsgFilterList.cpp
mailnews/search/src/nsMsgFilterList.h
mailnews/search/src/nsMsgFilterService.cpp
mailnews/search/src/nsMsgFilterService.h
mailnews/search/src/nsMsgImapSearch.cpp
mailnews/search/src/nsMsgLocalSearch.cpp
mailnews/search/src/nsMsgLocalSearch.h
mailnews/search/src/nsMsgSearchAdapter.cpp
mailnews/search/src/nsMsgSearchImap.h
mailnews/search/src/nsMsgSearchNews.cpp
mailnews/search/src/nsMsgSearchNews.h
mailnews/search/src/nsMsgSearchSession.cpp
mailnews/search/src/nsMsgSearchSession.h
mailnews/search/src/nsMsgSearchTerm.cpp
mailnews/search/src/nsMsgSearchValue.cpp
mailnews/search/src/nsMsgSearchValue.h
mailnews/search/test/moz.build
mailnews/search/test/unit/head_mailbase.js
mailnews/search/test/unit/test_base64_decoding.js
mailnews/search/test/unit/test_bug366491.js
mailnews/search/test/unit/test_bug404489.js
mailnews/search/test/unit/test_copyThenMoveManual.js
mailnews/search/test/unit/test_junkWhitelisting.js
mailnews/search/test/unit/test_quarantineFilterMove.js
mailnews/search/test/unit/test_search.js
mailnews/search/test/unit/test_searchAddressInAb.js
mailnews/search/test/unit/test_searchBody.js
mailnews/search/test/unit/test_searchBoolean.js
mailnews/search/test/unit/test_searchChaining.js
mailnews/search/test/unit/test_searchCustomTerm.js
mailnews/search/test/unit/test_searchJunk.js
mailnews/search/test/unit/test_searchLocalizationStrings.js
mailnews/search/test/unit/test_searchTag.js
mailnews/search/test/unit/test_searchUint32HdrProperty.js
mailnews/search/test/unit/xpcshell.ini
--- a/mail/base/content/SearchDialog.js
+++ b/mail/base/content/SearchDialog.js
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* import-globals-from ../../../../toolkit/content/globalOverlay.js */
-/* import-globals-from ../../../mailnews/base/search/content/searchTerm.js */
+/* import-globals-from ../../../mailnews/search/content/searchTerm.js */
 /* import-globals-from folderDisplay.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from mailWindowOverlay.js */
 /* import-globals-from messageDisplay.js */
 /* import-globals-from threadPane.js */
 
 "use strict";
 
--- a/mail/base/content/SearchDialog.xhtml
+++ b/mail/base/content/SearchDialog.xhtml
@@ -114,17 +114,17 @@
                     accesskey="&searchOnServer.accesskey;"
                     oncommand="updateSearchLocalSystem();"
                     persist="checked"/>
         </hbox>
       </vbox>
 
       <hbox flex="1">
         <vbox id="searchTermListBox" flex="1">
-#include ../../../mailnews/base/search/content/searchTerm.inc.xhtml
+#include ../../../mailnews/search/content/searchTerm.inc.xhtml
       </hbox>
     </vbox>
 
     <splitter id="gray_horizontal_splitter" persist="state" orient="vertical"/>
 
     <vbox id="searchResults" flex="4" persist="height">
       <vbox id="searchResultListBox" flex="1">
 #include threadTree.inc.xhtml
--- a/mail/components/addrbook/content/abSearchDialog.js
+++ b/mail/components/addrbook/content/abSearchDialog.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* import-globals-from ../../../../../toolkit/content/globalOverlay.js */
 /* import-globals-from ../../../../mailnews/base/content/dateFormat.js */
-/* import-globals-from ../../../../mailnews/base/search/content/searchTerm.js */
+/* import-globals-from ../../../../mailnews/search/content/searchTerm.js */
 /* import-globals-from ../../../base/content/commandglue.js */
 /* import-globals-from ../../../base/content/mailWindow.js */
 /* import-globals-from ../../../base/content/msgMail3PaneWindow.js */
 /* import-globals-from abCommon.js */
 
 var { encodeABTermValue } = ChromeUtils.import(
   "resource:///modules/ABQueryUtils.jsm"
 );
@@ -140,26 +140,24 @@ function SelectDirectory(aURI) {
   if (abPopup) {
     abPopup.value = selectedAB;
   }
 
   setSearchScope(GetScopeForDirectoryURI(selectedAB));
 }
 
 function GetScopeForDirectoryURI(aURI) {
+  var directory = MailServices.ab.getDirectory(aURI);
   var booleanAnd = gSearchBooleanRadiogroup.selectedItem.value == "and";
 
-  if (aURI != "moz-abdirectory://?") {
-    let directory = MailServices.ab.getDirectory(aURI);
-    if (directory.isRemote) {
-      if (booleanAnd) {
-        return nsMsgSearchScope.LDAPAnd;
-      }
-      return nsMsgSearchScope.LDAP;
+  if (directory.isRemote) {
+    if (booleanAnd) {
+      return nsMsgSearchScope.LDAPAnd;
     }
+    return nsMsgSearchScope.LDAP;
   }
 
   if (booleanAnd) {
     return nsMsgSearchScope.LocalABAnd;
   }
   return nsMsgSearchScope.LocalAB;
 }
 
@@ -184,17 +182,17 @@ function onSearch() {
 
   gSearchSession.clearScopes();
 
   var currentAbURI = document.getElementById("abPopup").getAttribute("value");
 
   gSearchSession.addDirectoryScopeTerm(GetScopeForDirectoryURI(currentAbURI));
   saveSearchTerms(gSearchSession.searchTerms, gSearchSession);
 
-  var searchUri = "(";
+  var searchUri = currentAbURI + "?(";
   for (let i = 0; i < gSearchSession.searchTerms.length; i++) {
     let searchTerm = gSearchSession.searchTerms.queryElementAt(
       i,
       nsIMsgSearchTerm
     );
 
     // get the "and" / "or" value from the first term
     if (i == 0) {
@@ -331,17 +329,17 @@ function onSearch() {
         opStr +
         "," +
         encodeABTermValue(searchTerm.value.str) +
         ")";
     }
   }
 
   searchUri += ")";
-  SetAbView(currentAbURI, searchUri);
+  SetAbView(searchUri);
 }
 
 // used to toggle functionality for Search/Stop button.
 function onSearchButton(event) {
   if (event.target.label == gSearchBundle.getString("labelForSearchButton")) {
     onSearch();
   } else {
     onSearchStop();
--- a/mail/components/addrbook/content/abSearchDialog.xhtml
+++ b/mail/components/addrbook/content/abSearchDialog.xhtml
@@ -72,17 +72,17 @@
         <hbox align="center">
           <spacer flex="1"/>
           <button label="&resetButton.label;" oncommand="onAbSearchReset(event);" accesskey="&resetButton.accesskey;"/>
         </hbox>
       </vbox>
 
       <hbox flex="1">
         <vbox id="searchTermListBox" flex="1">
-#include ../../../../mailnews/base/search/content/searchTerm.inc.xhtml
+#include ../../../../mailnews/search/content/searchTerm.inc.xhtml
       </hbox>
     </vbox>
 
     <splitter id="gray_horizontal_splitter" collapse="after" persist="state" orient="vertical"/>
 
     <vbox id="searchResults" flex="4" persist="height">
       <vbox id="searchResultListBox" flex="1" >
         <tree id="abResultsTree" flex="1" enableColumnDrag="true" class="plain"
--- a/mail/extensions/mailviews/content/mailViewSetup.js
+++ b/mail/extensions/mailviews/content/mailViewSetup.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-/* import-globals-from ../../../../mailnews/base/search/content/searchTerm.js */
+/* import-globals-from ../../../../mailnews/search/content/searchTerm.js */
 
 document.addEventListener("dialogaccept", onOK);
 
 var gMailView = null;
 
 var dialog;
 
 function mailViewOnLoad() {
--- a/mail/extensions/mailviews/content/mailViewSetup.xhtml
+++ b/mail/extensions/mailviews/content/mailViewSetup.xhtml
@@ -46,14 +46,14 @@
                     oninput="doEnabling();"/>
       </hbox>
     </vbox>
 
     <separator/>
     <label value="&searchTermCaption.label;"/>
     <hbox flex="1">
       <vbox id="searchTermListBox" flex="1">
-#include ../../../../mailnews/base/search/content/searchTerm.inc.xhtml
+#include ../../../../mailnews/search/content/searchTerm.inc.xhtml
     </hbox>
   </vbox>
 
 </dialog>
 </window>
--- a/mailnews/base/content/virtualFolderProperties.js
+++ b/mailnews/base/content/virtualFolderProperties.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-/* import-globals-from ../search/content/searchTerm.js */
+/* import-globals-from ../../search/content/searchTerm.js */
 
 var gFolderTreeView;
 var gPickedFolder;
 var gMailView = null;
 var msgWindow; // important, don't change the name of this variable. it's really a global used by commandglue.js
 var gSearchTermSession; // really an in memory temporary filter we use to read in and write out the search terms
 var gSearchFolderURIs = "";
 var gMessengerBundle = null;
--- a/mailnews/base/content/virtualFolderProperties.xhtml
+++ b/mailnews/base/content/virtualFolderProperties.xhtml
@@ -107,13 +107,13 @@
   </hbox>
 
   <separator class="thin"/>
 
   <vbox flex="2">
     <label value="&searchTermCaption.label;"/>
     <hbox flex="1">
       <vbox id="virtualFolderSearchTermListBox" flex="2">
-#include ../search/content/searchTerm.inc.xhtml
+#include ../../search/content/searchTerm.inc.xhtml
     </hbox>
   </vbox>
 </dialog>
 </window>
--- a/mailnews/base/moz.build
+++ b/mailnews/base/moz.build
@@ -2,13 +2,11 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += [
     'public',
     'src',
     'util',
-    'search/public',
-    'search/src',
 ]
 
 TEST_DIRS += ['test']
--- a/mailnews/base/test/unit/xpcshell.ini
+++ b/mailnews/base/test/unit/xpcshell.ini
@@ -4,44 +4,39 @@ tail =
 support-files = nodelist_test.xml data/*
 
 [test_accountMgr.js]
 [test_accountMgr2.js]
 [test_accountMgrCustomTypes.js]
 [test_accountMigration.js]
 [test_acctRepair.js]
 [test_bccInDatabase.js]
-[test_bug366491.js]
-[test_bug404489.js]
 [test_bug428427.js]
 [test_bug434810.js]
 [test_bug471682.js]
 [test_bug514945.js]
-[test_base64_decoding.js]
 [test_compactFailure.js]
 [test_compactColumnSave.js]
 [test_mailstoreConverter.js]
 [test_converterDeferredAccount.js]
 [test_copyChaining.js]
-[test_copyThenMoveManual.js]
 [test_copyToInvalidDB.js]
 [test_detachToFile.js]
 [test_emptyTrash.js]
 [test_fix_deferred_accounts.js]
 [test_folderCompact.js]
 [test_folderLookupService.js]
 [test_getMsgTextFromStream.js]
 [test_headerFoldingInDatabase.js]
 [test_hostnameUtils.js]
 [test_imapPump.js]
 [test_inheritedFolderProperties.js]
 [test_iteratorUtils.js]
 [test_jsTreeSelection.js]
 [test_junkingWhenDisabled.js]
-[test_junkWhitelisting.js]
 [test_loadVirtualFolders.js]
 [test_mailServices.js]
 [test_mimemaltdetach.js]
 [test_newMailNotification.js]
 # Not yet working for non-Mac OS
 skip-if = os != 'mac'
 
 [test_nsIMsgContentPolicy.js]
@@ -53,27 +48,16 @@ skip-if = true # See bug 1446587.
 [test_nsMailDirProvider.js]
 [test_nsMsgDBView.js]
 [test_nsMsgDBView_headerValues.js]
 [test_nsMsgMailSession_Alerts.js]
 skip-if = true # See bug 1418063.
 [test_nsMsgMailSession_Listeners.js]
 [test_nsMsgTraitService.js]
 [test_postPluginFilters.js]
-[test_quarantineFilterMove.js]
 [test_retention.js]
-[test_search.js]
-[test_searchAddressInAb.js]
-[test_searchBody.js]
-[test_searchBoolean.js]
-[test_searchChaining.js]
-[test_searchCustomTerm.js]
-[test_searchJunk.js]
-[test_searchLocalizationStrings.js]
-[test_searchTag.js]
-[test_searchUint32HdrProperty.js]
 [test_testsuite_base64.js]
 [test_testsuite_fakeserver_imapd_gmail.js]
 [test_testsuite_fakeserver_imapd_list-extended.js]
 [test_testsuite_fakeserverAuth.js]
 [test_viewSortByAddresses.js]
 [test_formatFileSize.js]
 [test_nsIFolderListener.js]
--- a/mailnews/build/moz.build
+++ b/mailnews/build/moz.build
@@ -28,24 +28,24 @@ else:
     OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     OS_LIBS += CONFIG['TK_LIBS']
     OS_LIBS += ['-framework Cocoa']
 
 LOCAL_INCLUDES += [
     '../addrbook/src',
-    '../base/search/src',
     '../base/src',
     '../base/util',
     '../compose/src',
     '../extensions/bayesian-spam-filter/src',
     '../extensions/fts3/src',
     '../extensions/mailviews/src',
     '../extensions/mdn/src',
     '../extensions/smime/src',
     '../imap/src',
     '../intl',
     '../local/src',
     '../mime/emitters',
     '../mime/src',
     '../news/src',
+    '../search/src',
 ]
--- a/mailnews/jar.mn
+++ b/mailnews/jar.mn
@@ -88,24 +88,24 @@ messenger.jar:
     content/messenger/virtualFolderProperties.js                               (base/content/virtualFolderProperties.js)
     content/messenger/msgPrintEngine.js                                        (base/content/msgPrintEngine.js)
     content/messenger/msgPrintEngine.xhtml                                     (base/content/msgPrintEngine.xhtml)
 *   content/messenger/junkMailInfo.xhtml                                       (base/content/junkMailInfo.xhtml)
     content/messenger/junkCommands.js                                          (base/content/junkCommands.js)
     content/messenger/junkLog.xhtml                                            (base/content/junkLog.xhtml)
     content/messenger/junkLog.js                                               (base/content/junkLog.js)
     content/messenger/jsTreeView.js                                            (base/content/jsTreeView.js)
-    content/messenger/searchTerm.js                                            (base/search/content/searchTerm.js)
-*   content/messenger/CustomHeaders.xhtml                                      (base/search/content/CustomHeaders.xhtml)
-    content/messenger/CustomHeaders.js                                         (base/search/content/CustomHeaders.js)
-*   content/messenger/FilterEditor.xhtml                                       (base/search/content/FilterEditor.xhtml)
-    content/messenger/FilterEditor.js                                          (base/search/content/FilterEditor.js)
-    content/messenger/searchWidgets.js                                         (base/search/content/searchWidgets.js)
-    content/messenger/viewLog.xhtml                                            (base/search/content/viewLog.xhtml)
-    content/messenger/viewLog.js                                               (base/search/content/viewLog.js)
+    content/messenger/searchTerm.js                                            (search/content/searchTerm.js)
+*   content/messenger/CustomHeaders.xhtml                                      (search/content/CustomHeaders.xhtml)
+    content/messenger/CustomHeaders.js                                         (search/content/CustomHeaders.js)
+*   content/messenger/FilterEditor.xhtml                                       (search/content/FilterEditor.xhtml)
+    content/messenger/FilterEditor.js                                          (search/content/FilterEditor.js)
+    content/messenger/searchWidgets.js                                         (search/content/searchWidgets.js)
+    content/messenger/viewLog.xhtml                                            (search/content/viewLog.xhtml)
+    content/messenger/viewLog.js                                               (search/content/viewLog.js)
     content/messenger/messengercompose/askSendFormat.js                        (compose/content/askSendFormat.js)
     content/messenger/messengercompose/askSendFormat.xhtml                     (compose/content/askSendFormat.xhtml)
     content/messenger/messengercompose/sendProgress.xhtml                      (compose/content/sendProgress.xhtml)
     content/messenger/messengercompose/sendProgress.js                         (compose/content/sendProgress.js)
     content/messenger/importDialog.js                                          (import/content/importDialog.js)
 *   content/messenger/importDialog.xhtml                                       (import/content/importDialog.xhtml)
 *   content/messenger/fieldMapImport.xhtml                                     (import/content/fieldMapImport.xhtml)
     content/messenger/fieldMapImport.css                                       (import/content/fieldMapImport.css)
--- a/mailnews/moz.build
+++ b/mailnews/moz.build
@@ -18,16 +18,18 @@ DIRS += [
     'import/text/src',
     'import/vcard/src',
     'intl',
     'jsaccount',
     'local/public',
     'local/src',
     'mime',
     'news',
+    'search/public',
+    'search/src',
 ]
 
 if not CONFIG['MOZ_SUITE']:
     DIRS += [
         'import/seamonkey/src',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
@@ -45,16 +47,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
         DIRS += [
             'import/winlivemail',
         ]
 
 TEST_DIRS += [
     'imap/test',
     'import/test',
     'local/test',
+    'search/test',
 ]
 
 if CONFIG['MOZ_MAPI_SUPPORT']:
     DIRS += [
         'mapi/mapiDll',
         'mapi/mapihook',
     ]
     TEST_DIRS += ['mapi/test']
rename from mailnews/base/search/content/CustomHeaders.js
rename to mailnews/search/content/CustomHeaders.js
rename from mailnews/base/search/content/CustomHeaders.xhtml
rename to mailnews/search/content/CustomHeaders.xhtml
rename from mailnews/base/search/content/FilterEditor.js
rename to mailnews/search/content/FilterEditor.js
rename from mailnews/base/search/content/FilterEditor.xhtml
rename to mailnews/search/content/FilterEditor.xhtml
rename from mailnews/base/search/content/searchTerm.inc.xhtml
rename to mailnews/search/content/searchTerm.inc.xhtml
rename from mailnews/base/search/content/searchTerm.js
rename to mailnews/search/content/searchTerm.js
--- a/mailnews/base/search/content/searchTerm.js
+++ b/mailnews/search/content/searchTerm.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-/* import-globals-from ../../../../mail/components/addrbook/content/abSearchDialog.js */
+/* import-globals-from ../../../mail/components/addrbook/content/abSearchDialog.js */
 
 var gTotalSearchTerms = 0;
 var gSearchTermList;
 var gSearchTerms = [];
 var gSearchRemovedTerms = [];
 var gSearchScope;
 var gSearchBooleanRadiogroup;
 
rename from mailnews/base/search/content/searchWidgets.js
rename to mailnews/search/content/searchWidgets.js
rename from mailnews/base/search/content/viewLog.js
rename to mailnews/search/content/viewLog.js
rename from mailnews/base/search/content/viewLog.xhtml
rename to mailnews/search/content/viewLog.xhtml
rename from mailnews/base/search/public/moz.build
rename to mailnews/search/public/moz.build
rename from mailnews/base/search/public/nsIMsgFilter.idl
rename to mailnews/search/public/nsIMsgFilter.idl
rename from mailnews/base/search/public/nsIMsgFilterCustomAction.idl
rename to mailnews/search/public/nsIMsgFilterCustomAction.idl
rename from mailnews/base/search/public/nsIMsgFilterHitNotify.idl
rename to mailnews/search/public/nsIMsgFilterHitNotify.idl
rename from mailnews/base/search/public/nsIMsgFilterList.idl
rename to mailnews/search/public/nsIMsgFilterList.idl
rename from mailnews/base/search/public/nsIMsgFilterPlugin.idl
rename to mailnews/search/public/nsIMsgFilterPlugin.idl
rename from mailnews/base/search/public/nsIMsgFilterService.idl
rename to mailnews/search/public/nsIMsgFilterService.idl
rename from mailnews/base/search/public/nsIMsgOperationListener.idl
rename to mailnews/search/public/nsIMsgOperationListener.idl
rename from mailnews/base/search/public/nsIMsgSearchAdapter.idl
rename to mailnews/search/public/nsIMsgSearchAdapter.idl
rename from mailnews/base/search/public/nsIMsgSearchCustomTerm.idl
rename to mailnews/search/public/nsIMsgSearchCustomTerm.idl
rename from mailnews/base/search/public/nsIMsgSearchNotify.idl
rename to mailnews/search/public/nsIMsgSearchNotify.idl
rename from mailnews/base/search/public/nsIMsgSearchScopeTerm.idl
rename to mailnews/search/public/nsIMsgSearchScopeTerm.idl
rename from mailnews/base/search/public/nsIMsgSearchSession.idl
rename to mailnews/search/public/nsIMsgSearchSession.idl
rename from mailnews/base/search/public/nsIMsgSearchTerm.idl
rename to mailnews/search/public/nsIMsgSearchTerm.idl
rename from mailnews/base/search/public/nsIMsgSearchValidityManager.idl
rename to mailnews/search/public/nsIMsgSearchValidityManager.idl
rename from mailnews/base/search/public/nsIMsgSearchValidityTable.idl
rename to mailnews/search/public/nsIMsgSearchValidityTable.idl
rename from mailnews/base/search/public/nsIMsgSearchValue.idl
rename to mailnews/search/public/nsIMsgSearchValue.idl
rename from mailnews/base/search/public/nsIMsgTraitService.idl
rename to mailnews/search/public/nsIMsgTraitService.idl
rename from mailnews/base/search/public/nsMsgBodyHandler.h
rename to mailnews/search/public/nsMsgBodyHandler.h
rename from mailnews/base/search/public/nsMsgFilterCore.idl
rename to mailnews/search/public/nsMsgFilterCore.idl
rename from mailnews/base/search/public/nsMsgResultElement.h
rename to mailnews/search/public/nsMsgResultElement.h
rename from mailnews/base/search/public/nsMsgSearchAdapter.h
rename to mailnews/search/public/nsMsgSearchAdapter.h
rename from mailnews/base/search/public/nsMsgSearchBoolExpression.h
rename to mailnews/search/public/nsMsgSearchBoolExpression.h
rename from mailnews/base/search/public/nsMsgSearchCore.idl
rename to mailnews/search/public/nsMsgSearchCore.idl
rename from mailnews/base/search/public/nsMsgSearchScopeTerm.h
rename to mailnews/search/public/nsMsgSearchScopeTerm.h
rename from mailnews/base/search/public/nsMsgSearchTerm.h
rename to mailnews/search/public/nsMsgSearchTerm.h
rename from mailnews/base/search/src/Bogofilter.sfd
rename to mailnews/search/src/Bogofilter.sfd
rename from mailnews/base/search/src/DSPAM.sfd
rename to mailnews/search/src/DSPAM.sfd
rename from mailnews/base/search/src/Habeas.sfd
rename to mailnews/search/src/Habeas.sfd
rename from mailnews/base/search/src/MsgTraitService.jsm
rename to mailnews/search/src/MsgTraitService.jsm
rename from mailnews/base/search/src/POPFile.sfd
rename to mailnews/search/src/POPFile.sfd
rename from mailnews/base/search/src/PeriodicFilterManager.jsm
rename to mailnews/search/src/PeriodicFilterManager.jsm
rename from mailnews/base/search/src/SpamAssassin.sfd
rename to mailnews/search/src/SpamAssassin.sfd
rename from mailnews/base/search/src/SpamCatcher.sfd
rename to mailnews/search/src/SpamCatcher.sfd
rename from mailnews/base/search/src/SpamPal.sfd
rename to mailnews/search/src/SpamPal.sfd
rename from mailnews/base/search/src/components.conf
rename to mailnews/search/src/components.conf
rename from mailnews/base/search/src/moz.build
rename to mailnews/search/src/moz.build
rename from mailnews/base/search/src/nsMsgBodyHandler.cpp
rename to mailnews/search/src/nsMsgBodyHandler.cpp
rename from mailnews/base/search/src/nsMsgFilter.cpp
rename to mailnews/search/src/nsMsgFilter.cpp
rename from mailnews/base/search/src/nsMsgFilter.h
rename to mailnews/search/src/nsMsgFilter.h
rename from mailnews/base/search/src/nsMsgFilterList.cpp
rename to mailnews/search/src/nsMsgFilterList.cpp
rename from mailnews/base/search/src/nsMsgFilterList.h
rename to mailnews/search/src/nsMsgFilterList.h
rename from mailnews/base/search/src/nsMsgFilterService.cpp
rename to mailnews/search/src/nsMsgFilterService.cpp
rename from mailnews/base/search/src/nsMsgFilterService.h
rename to mailnews/search/src/nsMsgFilterService.h
rename from mailnews/base/search/src/nsMsgImapSearch.cpp
rename to mailnews/search/src/nsMsgImapSearch.cpp
rename from mailnews/base/search/src/nsMsgLocalSearch.cpp
rename to mailnews/search/src/nsMsgLocalSearch.cpp
rename from mailnews/base/search/src/nsMsgLocalSearch.h
rename to mailnews/search/src/nsMsgLocalSearch.h
rename from mailnews/base/search/src/nsMsgSearchAdapter.cpp
rename to mailnews/search/src/nsMsgSearchAdapter.cpp
rename from mailnews/base/search/src/nsMsgSearchImap.h
rename to mailnews/search/src/nsMsgSearchImap.h
rename from mailnews/base/search/src/nsMsgSearchNews.cpp
rename to mailnews/search/src/nsMsgSearchNews.cpp
rename from mailnews/base/search/src/nsMsgSearchNews.h
rename to mailnews/search/src/nsMsgSearchNews.h
rename from mailnews/base/search/src/nsMsgSearchSession.cpp
rename to mailnews/search/src/nsMsgSearchSession.cpp
rename from mailnews/base/search/src/nsMsgSearchSession.h
rename to mailnews/search/src/nsMsgSearchSession.h
rename from mailnews/base/search/src/nsMsgSearchTerm.cpp
rename to mailnews/search/src/nsMsgSearchTerm.cpp
rename from mailnews/base/search/src/nsMsgSearchValue.cpp
rename to mailnews/search/src/nsMsgSearchValue.cpp
rename from mailnews/base/search/src/nsMsgSearchValue.h
rename to mailnews/search/src/nsMsgSearchValue.h
new file mode 100644
--- /dev/null
+++ b/mailnews/search/test/moz.build
@@ -0,0 +1,7 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
+
copy from mailnews/base/test/unit/head_mailbase.js
copy to mailnews/search/test/unit/head_mailbase.js
rename from mailnews/base/test/unit/test_base64_decoding.js
rename to mailnews/search/test/unit/test_base64_decoding.js
rename from mailnews/base/test/unit/test_bug366491.js
rename to mailnews/search/test/unit/test_bug366491.js
rename from mailnews/base/test/unit/test_bug404489.js
rename to mailnews/search/test/unit/test_bug404489.js
rename from mailnews/base/test/unit/test_copyThenMoveManual.js
rename to mailnews/search/test/unit/test_copyThenMoveManual.js
rename from mailnews/base/test/unit/test_junkWhitelisting.js
rename to mailnews/search/test/unit/test_junkWhitelisting.js
rename from mailnews/base/test/unit/test_quarantineFilterMove.js
rename to mailnews/search/test/unit/test_quarantineFilterMove.js
rename from mailnews/base/test/unit/test_search.js
rename to mailnews/search/test/unit/test_search.js
rename from mailnews/base/test/unit/test_searchAddressInAb.js
rename to mailnews/search/test/unit/test_searchAddressInAb.js
rename from mailnews/base/test/unit/test_searchBody.js
rename to mailnews/search/test/unit/test_searchBody.js
rename from mailnews/base/test/unit/test_searchBoolean.js
rename to mailnews/search/test/unit/test_searchBoolean.js
rename from mailnews/base/test/unit/test_searchChaining.js
rename to mailnews/search/test/unit/test_searchChaining.js
rename from mailnews/base/test/unit/test_searchCustomTerm.js
rename to mailnews/search/test/unit/test_searchCustomTerm.js
rename from mailnews/base/test/unit/test_searchJunk.js
rename to mailnews/search/test/unit/test_searchJunk.js
rename from mailnews/base/test/unit/test_searchLocalizationStrings.js
rename to mailnews/search/test/unit/test_searchLocalizationStrings.js
rename from mailnews/base/test/unit/test_searchTag.js
rename to mailnews/search/test/unit/test_searchTag.js
rename from mailnews/base/test/unit/test_searchUint32HdrProperty.js
rename to mailnews/search/test/unit/test_searchUint32HdrProperty.js
copy from mailnews/base/test/unit/xpcshell.ini
copy to mailnews/search/test/unit/xpcshell.ini
--- a/mailnews/base/test/unit/xpcshell.ini
+++ b/mailnews/search/test/unit/xpcshell.ini
@@ -1,79 +1,20 @@
 [DEFAULT]
 head = head_mailbase.js
 tail =
-support-files = nodelist_test.xml data/*
 
-[test_accountMgr.js]
-[test_accountMgr2.js]
-[test_accountMgrCustomTypes.js]
-[test_accountMigration.js]
-[test_acctRepair.js]
-[test_bccInDatabase.js]
+[test_base64_decoding.js]
 [test_bug366491.js]
 [test_bug404489.js]
-[test_bug428427.js]
-[test_bug434810.js]
-[test_bug471682.js]
-[test_bug514945.js]
-[test_base64_decoding.js]
-[test_compactFailure.js]
-[test_compactColumnSave.js]
-[test_mailstoreConverter.js]
-[test_converterDeferredAccount.js]
-[test_copyChaining.js]
 [test_copyThenMoveManual.js]
-[test_copyToInvalidDB.js]
-[test_detachToFile.js]
-[test_emptyTrash.js]
-[test_fix_deferred_accounts.js]
-[test_folderCompact.js]
-[test_folderLookupService.js]
-[test_getMsgTextFromStream.js]
-[test_headerFoldingInDatabase.js]
-[test_hostnameUtils.js]
-[test_imapPump.js]
-[test_inheritedFolderProperties.js]
-[test_iteratorUtils.js]
-[test_jsTreeSelection.js]
-[test_junkingWhenDisabled.js]
 [test_junkWhitelisting.js]
-[test_loadVirtualFolders.js]
-[test_mailServices.js]
-[test_mimemaltdetach.js]
-[test_newMailNotification.js]
-# Not yet working for non-Mac OS
-skip-if = os != 'mac'
-
-[test_nsIMsgContentPolicy.js]
-skip-if = true # See bug 1446587.
-[test_nsIMsgFolder.js]
-[test_nsIMsgFolderListener.js]
-[test_nsIMsgFolderListenerLocal.js]
-[test_nsIMsgTagService.js]
-[test_nsMailDirProvider.js]
-[test_nsMsgDBView.js]
-[test_nsMsgDBView_headerValues.js]
-[test_nsMsgMailSession_Alerts.js]
-skip-if = true # See bug 1418063.
-[test_nsMsgMailSession_Listeners.js]
-[test_nsMsgTraitService.js]
-[test_postPluginFilters.js]
 [test_quarantineFilterMove.js]
-[test_retention.js]
 [test_search.js]
 [test_searchAddressInAb.js]
 [test_searchBody.js]
 [test_searchBoolean.js]
 [test_searchChaining.js]
 [test_searchCustomTerm.js]
 [test_searchJunk.js]
 [test_searchLocalizationStrings.js]
 [test_searchTag.js]
 [test_searchUint32HdrProperty.js]
-[test_testsuite_base64.js]
-[test_testsuite_fakeserver_imapd_gmail.js]
-[test_testsuite_fakeserver_imapd_list-extended.js]
-[test_testsuite_fakeserverAuth.js]
-[test_viewSortByAddresses.js]
-[test_formatFileSize.js]
-[test_nsIFolderListener.js]