Bug 593855 - Part 4, Fixups needed for path changes in c-c tests. r=KaiRo
authorJustin Wood <Callek@gmail.com>
Mon, 06 Sep 2010 20:58:22 -0400
changeset 6342 a09c8dfad8a92bff28ce2256ad639df9e72d0cb8
parent 6341 4380f07f155d5ca90fe2f851dbd7593943fa1e1c
child 6343 8e3d1110643bec628aafc2b97bc5821da9f6b47f
push idunknown
push userunknown
push dateunknown
reviewersKaiRo
bugs593855, 586754
Bug 593855 - Part 4, Fixups needed for path changes in c-c tests. r=KaiRo (Port |Bug 586754 Xpcshell tests should use relativesrcdir instead of $MODULE| to comm-central)
mail/base/test/unit/head_mailbase.js
mail/base/test/unit/tail_base.js
mail/base/test/unit/test_emptyTrash_dbViewWrapper.js
mail/base/test/unit/test_viewWrapper_imapFolder.js
mail/base/test/unit/test_viewWrapper_logic.js
mail/base/test/unit/test_viewWrapper_realFolder.js
mail/base/test/unit/test_viewWrapper_virtualFolder.js
mailnews/addrbook/test/unit/head_addrbook.js
mailnews/addrbook/test/unit/tail_addrbook.js
mailnews/addrbook/test/unit/test_bug387403.js
mailnews/addrbook/test/unit/test_mailList1.js
mailnews/addrbook/test/unit/test_nsAbAutoCompleteSearch5.js
mailnews/base/test/unit/head_mailbase.js
mailnews/base/test/unit/tail_base.js
mailnews/base/test/unit/test_bccInDatabase.js
mailnews/base/test/unit/test_bug366491.js
mailnews/base/test/unit/test_bug404489.js
mailnews/base/test/unit/test_bug428427.js
mailnews/base/test/unit/test_bug465805.js
mailnews/base/test/unit/test_bug471682.js
mailnews/base/test/unit/test_copyChaining.js
mailnews/base/test/unit/test_copyThenMoveManual.js
mailnews/base/test/unit/test_detachToFile.js
mailnews/base/test/unit/test_emptyTrash.js
mailnews/base/test/unit/test_folderCompact.js
mailnews/base/test/unit/test_getMsgTextFromStream.js
mailnews/base/test/unit/test_imapPump.js
mailnews/base/test/unit/test_junkWhitelisting.js
mailnews/base/test/unit/test_junkingWhenDisabled.js
mailnews/base/test/unit/test_loadVirtualFolders.js
mailnews/base/test/unit/test_nsIMsgFolderListenerLocal.js
mailnews/base/test/unit/test_nsMsgDBView.js
mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
mailnews/base/test/unit/test_postPluginFilters.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_searchTag.js
mailnews/base/test/unit/test_searchUint32HdrProperty.js
mailnews/base/test/unit/test_testsuite_fakeserverAuth.js
mailnews/compose/test/unit/head_compose.js
mailnews/compose/test/unit/tail_compose.js
mailnews/compose/test/unit/test_bug155172.js
mailnews/compose/test/unit/test_nsMsgCompose1.js
mailnews/compose/test/unit/test_nsMsgCompose3.js
mailnews/compose/test/unit/test_sendMessageLater2.js
mailnews/compose/test/unit/test_sendMessageLater3.js
mailnews/compose/test/unit/test_smtpPassword.js
mailnews/compose/test/unit/test_smtpPassword2.js
mailnews/compose/test/unit/test_smtpPasswordFailure1.js
mailnews/compose/test/unit/test_smtpPasswordFailure2.js
mailnews/compose/test/unit/test_smtpPasswordFailure3.js
mailnews/db/gloda/test/unit/head_gloda.js
mailnews/db/gloda/test/unit/resources/glodaTestHelper.js
mailnews/db/gloda/test/unit/tail_gloda.js
mailnews/db/gloda/test/unit/test_corrupt_database.js
mailnews/db/gloda/test/unit/test_mime_attachments_size.js
mailnews/db/gloda/test/unit/test_mime_emitter.js
mailnews/db/msgdb/test/unit/head_maildb.js
mailnews/db/msgdb/test/unit/tail_msgdb.js
mailnews/db/msgdb/test/unit/test_enumerator_cleanup.js
mailnews/db/msgdb/test/unit/test_filter_enumerator.js
mailnews/db/msgdb/test/unit/test_maildb.js
mailnews/db/msgdb/test/unit/test_propertyEnumerator.js
mailnews/db/msgdb/test/unit/test_references_parsing.js
mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js
mailnews/extensions/bayesian-spam-filter/test/unit/tail_bayesian.js
mailnews/extensions/mdn/test/unit/test_askuser.js
mailnews/extensions/mdn/test/unit/test_mdnFlags.js
mailnews/imap/test/unit/head_server.js
mailnews/imap/test/unit/tail_imap.js
mailnews/imap/test/unit/test_autosync_date_constraints.js
mailnews/imap/test/unit/test_bccProperty.js
mailnews/imap/test/unit/test_bug460636.js
mailnews/imap/test/unit/test_compactOfflineStore.js
mailnews/imap/test/unit/test_copyThenMove.js
mailnews/imap/test/unit/test_dod.js
mailnews/imap/test/unit/test_dontStatNoSelect.js
mailnews/imap/test/unit/test_downloadOffline.js
mailnews/imap/test/unit/test_filterNeedsBody.js
mailnews/imap/test/unit/test_imapAttachmentSaves.js
mailnews/imap/test/unit/test_imapAuthMethods.js
mailnews/imap/test/unit/test_imapAutoSync.js
mailnews/imap/test/unit/test_imapContentLength.js
mailnews/imap/test/unit/test_imapCopyTimeout.js
mailnews/imap/test/unit/test_imapFilterActions.js
mailnews/imap/test/unit/test_imapFlagChange.js
mailnews/imap/test/unit/test_imapFolderCopy.js
mailnews/imap/test/unit/test_imapPasswordFailure.js
mailnews/imap/test/unit/test_imapStoreMsgOffline.js
mailnews/imap/test/unit/test_imapUndo.js
mailnews/imap/test/unit/test_largeOfflineStore.js
mailnews/imap/test/unit/test_localToImapFilter.js
mailnews/imap/test/unit/test_localToImapFilterQuarantine.js
mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js
mailnews/imap/test/unit/test_offlinePlayback.js
mailnews/imap/test/unit/test_preserveDataOnMove.js
mailnews/imap/test/unit/test_starttlsFailure.js
mailnews/imap/test/unit/test_syncChanges.js
mailnews/imap/test/unit/test_trustSpamAssassin.js
mailnews/import/test/unit/head_import.js
mailnews/import/test/unit/resources/AB_README
mailnews/import/test/unit/tail_import.js
mailnews/local/test/unit/head_maillocal.js
mailnews/local/test/unit/tail_local.js
mailnews/local/test/unit/test_fileName.js
mailnews/local/test/unit/test_mailboxContentLength.js
mailnews/local/test/unit/test_msgCopy.js
mailnews/local/test/unit/test_over2GBMailboxes.js
mailnews/local/test/unit/test_pop3Password.js
mailnews/local/test/unit/test_pop3Password2.js
mailnews/local/test/unit/test_pop3Password3.js
mailnews/local/test/unit/test_pop3PasswordFailure.js
mailnews/local/test/unit/test_pop3Pump.js
mailnews/local/test/unit/test_preview.js
mailnews/mime/test/unit/head_mime.js
mailnews/mime/test/unit/tail_mime.js
mailnews/mime/test/unit/test_mimeStreaming.js
mailnews/news/test/unit/head_server_setup.js
mailnews/news/test/unit/tail_news.js
mailnews/news/test/unit/test_biff.js
mailnews/news/test/unit/test_filter.js
mailnews/news/test/unit/test_nntpPassword.js
mailnews/news/test/unit/test_nntpPassword2.js
mailnews/news/test/unit/test_nntpPassword3.js
mailnews/test/resources/IMAPpump.js
mailnews/test/resources/POP3pump.js
mailnews/test/resources/messageInjection.js
suite/common/places/tests/unit/head_bookmarks.js
--- a/mail/base/test/unit/head_mailbase.js
+++ b/mail/base/test/unit/head_mailbase.js
@@ -1,3 +1,3 @@
 // Import the main scripts that mail tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../../mailnews/resources/mailDirService.js");
+load("../../../../mailnews/resources/mailTestUtils.js");
--- a/mail/base/test/unit/tail_base.js
+++ b/mail/base/test/unit/tail_base.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../../mailnews/resources/mailShutdown.js");
--- a/mail/base/test/unit/test_emptyTrash_dbViewWrapper.js
+++ b/mail/base/test/unit/test_emptyTrash_dbViewWrapper.js
@@ -1,14 +1,14 @@
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
 
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils({mode: "imap", offline: false});
 
 function test_real_folder_load_and_move_to_trash() {
   let viewWrapper = make_view_wrapper();
   let [msgFolder, msgSet] = make_folder_with_sets([{count: 1}]);
 
--- a/mail/base/test/unit/test_viewWrapper_imapFolder.js
+++ b/mail/base/test/unit/test_viewWrapper_imapFolder.js
@@ -1,20 +1,20 @@
 /**
  * Test DBViewWrapper against a single imap folder.  Try and test all the
  *  features we can without having a fake newsgroup.  (Some features are
  *  newsgroup specific.)
  */
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
 
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils({mode: "imap", offline: false});
 
 /**
  * Create an empty folder, inject messages into it without triggering an
  *  updateFolder, sanity check that we believe there are no messages in the
  *  folder, then enter, making sure we immediately enter and that the view
--- a/mail/base/test/unit/test_viewWrapper_logic.js
+++ b/mail/base/test/unit/test_viewWrapper_logic.js
@@ -1,14 +1,14 @@
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
 
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils();
 
 /**
  * Verify that flipping between threading and grouped by sort settings properly
  *  clears the other flag.  (Because they're mutually exclusive, you see.)
  */
--- a/mail/base/test/unit/test_viewWrapper_realFolder.js
+++ b/mail/base/test/unit/test_viewWrapper_realFolder.js
@@ -1,20 +1,20 @@
 /**
  * Test DBViewWrapper against a single local folder.  Try and test all the
  *  features we can without having a fake newsgroup.  (Some features are
  *  newsgroup specific.)
  */
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
 
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils();
 
 /* ===== Real Folder, no features ===== */
 
 /**
  * Open a pre-populated real folder, make sure all the messages show up.
--- a/mail/base/test/unit/test_viewWrapper_virtualFolder.js
+++ b/mail/base/test/unit/test_viewWrapper_virtualFolder.js
@@ -6,22 +6,22 @@
  *   view's problem!  (We test it in the real folder to make sure we are telling
  *   it to do things correctly.)
  * - view flags.  Again, it's a db view issue once we're sure we set the bits.
  * - special view with threads.  same deal.
  *
  * We could test all these things, but my patch is way behind schedule...
  */
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
 
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils();
 
 /**
  * Make sure we open a virtual folder backed by a single underlying folder
  *  correctly; no constraints.
  */
--- a/mailnews/addrbook/test/unit/head_addrbook.js
+++ b/mailnews/addrbook/test/unit/head_addrbook.js
@@ -1,5 +1,5 @@
 // Import the main scripts that mailnews tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
+load("../../../resources/mailDirService.js");
 
 // Import the required setup scripts.
-load("../../mailnews/resources/abSetup.js");
+load("../../../resources/abSetup.js");
--- a/mailnews/addrbook/test/unit/tail_addrbook.js
+++ b/mailnews/addrbook/test/unit/tail_addrbook.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../resources/mailShutdown.js");
--- a/mailnews/addrbook/test/unit/test_bug387403.js
+++ b/mailnews/addrbook/test/unit/test_bug387403.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Test for bug 387403 crash when opening e-mail with broken vcard.
  */
 
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../resources/mailTestUtils.js");
 
 function run_test() {
   var abManager = Components.classes["@mozilla.org/abmanager;1"]
                             .getService(Components.interfaces.nsIAbManager);
 
   // Before bug 387403 this would hang, eating up all the memory until it
   // crashed.
   abManager.escapedVCardToAbCard("begin:vcard\nfn;quoted-printable:Xxxx=C5=82xx  Xxx\nn;quoted-printable:Xxx;Xxxx=C5=82xx \nadr;quoted-printable;quoted-printable;dom:;;xx. Xxxxxxxxxxxx X;Xxxxxx=C3=3");
--- a/mailnews/addrbook/test/unit/test_mailList1.js
+++ b/mailnews/addrbook/test/unit/test_mailList1.js
@@ -27,17 +27,17 @@ function checkLists(childNodes, number) 
   }
 
   mailListArray.forEach(function (value) { do_check_neq(value, null); });
 }
 
 function run_test() {
   // Create a new card
   // Test setup - copy the data file into place
-  var testAB = do_get_file("../../mailnews/data/abLists1.mab");
+  var testAB = do_get_file("../../../data/abLists1.mab");
 
   // Copy the file to the profile directory for a PAB
   testAB.copyTo(gProfileDir, kPABData.fileName);
 
   // Test - Get the directory.
 
   var abManager = Components.classes["@mozilla.org/abmanager;1"]
                             .getService(Components.interfaces.nsIAbManager);
--- a/mailnews/addrbook/test/unit/test_nsAbAutoCompleteSearch5.js
+++ b/mailnews/addrbook/test/unit/test_nsAbAutoCompleteSearch5.js
@@ -41,17 +41,17 @@ acObserver.prototype = {
   onSearchResult: function (aSearch, aResult) {
     this._search = aSearch;
     this._result = aResult;
   }
 };
 
 function run_test() {
   // Copy the data files into place
-  let testAB = do_get_file("../../mailnews/data/tb2hexpopularity.mab");
+  let testAB = do_get_file("../../../data/tb2hexpopularity.mab");
 
   testAB.copyTo(gProfileDir, kPABData.fileName);
 
   // Test - Create a new search component
 
   let acs = Components.classes["@mozilla.org/autocomplete/search;1?name=addrbook"]
     .getService(Components.interfaces.nsIAutoCompleteSearch);
 
--- a/mailnews/base/test/unit/head_mailbase.js
+++ b/mailnews/base/test/unit/head_mailbase.js
@@ -1,3 +1,5 @@
+gDEPTH = "../../../../";
+
 // Import the main scripts that mailnews tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../resources/mailDirService.js");
+load("../../../resources/mailTestUtils.js");
--- a/mailnews/base/test/unit/tail_base.js
+++ b/mailnews/base/test/unit/tail_base.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../resources/mailShutdown.js");
--- a/mailnews/base/test/unit/test_bccInDatabase.js
+++ b/mailnews/base/test/unit/test_bccInDatabase.js
@@ -52,17 +52,17 @@ function run_test()
     OnStartCopy: function() {},
     OnProgress: function(aProgress, aProgressMax) {},
     SetMessageKey: function(aKey) { hdr = gLocalInboxFolder.GetMessageHeader(aKey);},
     SetMessageId: function(aMessageId) {},
     OnStopCopy: function(aStatus) { continueTest();}
   };
 
   // Get a message into the local filestore.
-  var draft = do_get_file("../../mailnews/data/draft1");
+  var draft = do_get_file("../../../data/draft1");
   do_test_pending();
   copyService.CopyFileMessage(draft, gLocalInboxFolder, null, false, 0,
                               "", copyListener, null);
 }
 
 function continueTest()
 {
   //dump("\nbccList >" + hdr.bccList);
--- a/mailnews/base/test/unit/test_bug366491.js
+++ b/mailnews/base/test/unit/test_bug366491.js
@@ -121,13 +121,13 @@ var doTestingListener =
       do_test_finished();
   }
 };
 
 // helper functions
 
 function getSpec(aFileName)
 {
-  var file = do_get_file("../../test_bayes/unit/resources/" + aFileName);
+  var file = do_get_file("../../../bayesian-spam-filter/test/unit/resources/" + aFileName);
   var uri = nsIIOService.newFileURI(file).QueryInterface(Ci.nsIURL);
   uri.query = "type=application/x-message-display";
   return uri.spec;
 }
--- a/mailnews/base/test/unit/test_bug404489.js
+++ b/mailnews/base/test/unit/test_bug404489.js
@@ -44,17 +44,17 @@ const gPrefs = Cc["@mozilla.org/preferen
 
 const nsMsgSearchScope = Ci.nsMsgSearchScope;
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 const nsMsgSearchOp = Ci.nsMsgSearchOp;
 const Contains = nsMsgSearchOp.Contains;
 const offlineMail = nsMsgSearchScope.offlineMail;
 const gArrayHdrs = ["X-Bugzilla-Who", "Sender"];
 const gFirstHeader = nsMsgSearchAttrib.OtherHeader + 1;
-const fileName = "../../mailnews/data/SenderHeader";
+const fileName = "../../../data/SenderHeader";
 
 var Tests =
 [
   /* test header:
   X-Bugzilla-Who: bugmail@example.org
 
   This just shows that normal custom headers work
   */
--- a/mailnews/base/test/unit/test_bug428427.js
+++ b/mailnews/base/test/unit/test_bug428427.js
@@ -37,17 +37,17 @@
 // Test of message count changes in virtual folder views
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 const tagService = Cc["@mozilla.org/messenger/tagservice;1"]
                      .getService(Ci.nsIMsgTagService);
 const dbviewContractId = "@mozilla.org/messenger/msgdbview;1?type=" + "quicksearch";
 const dbView = Cc[dbviewContractId].createInstance(Ci.nsIMsgDBView);
-const bugmail1 = do_get_file("../../mailnews/data/bugmail1");
+const bugmail1 = do_get_file("../../../data/bugmail1");
 // I'm only loading msgDBService to help load symbols for debugging
 //const msgDBService = Cc["@mozilla.org/msgDatabase/msgDBService;1"]
 //                     .getService(Ci.nsIMsgDBService);
                      
 // main test
 
 // the headers for the test messages. All messages are identical, but
 // have different properties set on them.
--- a/mailnews/base/test/unit/test_bug465805.js
+++ b/mailnews/base/test/unit/test_bug465805.js
@@ -32,17 +32,17 @@
  * 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 ***** */
 
 // This tests that we do not crash when loading the email bodySearchCrash,
 // which was fixed in bug 465805
 
-load("../../mailnews/resources/searchTestUtils.js");
+load("../../../resources/searchTestUtils.js");
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"].
                       getService(Ci.nsIMsgCopyService);
 
 const nsMsgSearchScope = Ci.nsMsgSearchScope;
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 const nsMsgSearchOp = Ci.nsMsgSearchOp;
 
@@ -50,18 +50,18 @@ const Contains = nsMsgSearchOp.Contains;
 
 const offlineMail = nsMsgSearchScope.offlineMail;
 const offlineMailFilter = nsMsgSearchScope.offlineMailFilter;
 
 const Body = nsMsgSearchAttrib.Body;
 
 var Files = 
 [
-  "../../mailnews/data/bugmail1",
-  "../../mailnews/data/bodySearchCrash"
+  "../../../data/bugmail1",
+  "../../../data/bodySearchCrash"
 ]
 
 var Tests =
 [
 
 // this number appears in bugmail1
   { value: "432710",
     attrib: Body,
--- a/mailnews/base/test/unit/test_bug471682.js
+++ b/mailnews/base/test/unit/test_bug471682.js
@@ -37,17 +37,17 @@
 /*
  * Test of message database validity on local copy from bug 471682. What
  * we want to do here is to copy a couple of message to a new folder, and
  * then compare the date and filesize of the folder file with the
  * stored result in dbfolderinfo. If they don't match, that's bad.
  */
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
-const bugmail1 = do_get_file("../../mailnews/data/bugmail1");
+const bugmail1 = do_get_file("../../../data/bugmail1");
 var gHdr; // header of test message in local folder
 
 loadLocalMailAccount();
 // create a subfolder as a target for copies
 var gSubfolder = gLocalInboxFolder.addSubfolder("subfolder");
 
 function run_test()
 {
--- a/mailnews/base/test/unit/test_copyChaining.js
+++ b/mailnews/base/test/unit/test_copyChaining.js
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Test of chaining copies between the same folders
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 var gCopySource;
 var gCopyDest;
 var gMsgEnumerator;
 var gCurTestNum = 1;
 
 // main test
 
--- a/mailnews/base/test/unit/test_copyThenMoveManual.js
+++ b/mailnews/base/test/unit/test_copyThenMoveManual.js
@@ -1,17 +1,17 @@
 /*
  * This file tests copy followed by a move in a single filter.
  * Tests fix from bug 448337.
  *
  * Original author: Kent James <kent@caspia.com>
  */
 
-load("../../mailnews/resources/POP3pump.js");
-const gFiles = ["../../mailnews/data/bugmail1"];
+load("../../../resources/POP3pump.js");
+const gFiles = ["../../../data/bugmail1"];
 var gCopyFolder;
 var gMoveFolder;
 var gFilter; // the test filter
 var gFilterList;
 var gCurTestNum = 1;
 var gFilterService = Cc["@mozilla.org/messenger/services/filters;1"]
                        .getService(Ci.nsIMsgFilterService);
 const gTestArray =
--- a/mailnews/base/test/unit/test_detachToFile.js
+++ b/mailnews/base/test/unit/test_detachToFile.js
@@ -33,19 +33,19 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Tests nsIMessenger's detachAttachmentsWOPrompts
  */
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/mailTestUtils.js");
+load("../../../resources/asyncTestUtils.js");
 
 // javascript mime emitter functions
 mimeMsg = {};
 Components.utils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
@@ -54,17 +54,17 @@ var tests = [
   startMime,
   startDetach,
   testDetach,
 ]
 
 function startCopy()
 {
   // Get a message into the local filestore.
-  var mailFile = do_get_file("../../mailnews/data/external-attach-test");
+  var mailFile = do_get_file("../../../data/external-attach-test");
   copyService.CopyFileMessage(mailFile, gLocalInboxFolder, null, false, 0,
                               "", asyncCopyListener, null);
   yield false;
 }
 
 // process the message through mime
 function startMime()
 {
--- a/mailnews/base/test/unit/test_emptyTrash.js
+++ b/mailnews/base/test/unit/test_emptyTrash.js
@@ -132,17 +132,17 @@ gMFListener.prototype =
     aFolder.msgDatabase = null;
   },
 };
 
 function run_test()
 {
   loadLocalMailAccount();
   // Load up a message so that we can copy it in later.
-  gMsgFile1 = do_get_file("../../mailnews/data/bugmail10");
+  gMsgFile1 = do_get_file("../../../data/bugmail10");
   // our front end code clears the msg db when it gets told the folder for
   // an open view has been deleted - so simulate that.
   var folderDeletedListener = new gMFListener();
   gMFNService.addListener(folderDeletedListener, nsIMFNService.folderDeleted);
 
   // "Master" do_test_pending(), paired with a do_test_finished() at the end of all the operations.
   do_test_pending();
 
--- a/mailnews/base/test/unit/test_folderCompact.js
+++ b/mailnews/base/test/unit/test_folderCompact.js
@@ -159,19 +159,19 @@ const gTestArray =
     urlListener.OnStopRunningUrl(null, 0);
   }
 ];
 
 function run_test()
 {
   loadLocalMailAccount();
   // Load up some messages so that we can copy them in later.
-  gMsgFile1 = do_get_file("../../mailnews/data/bugmail10");
-  gMsgFile2 = do_get_file("../../mailnews/data/bugmail11");
-  gMsgFile3 = do_get_file("../../mailnews/data/draft1");
+  gMsgFile1 = do_get_file("../../../data/bugmail10");
+  gMsgFile2 = do_get_file("../../../data/bugmail11");
+  gMsgFile3 = do_get_file("../../../data/draft1");
 
   // Create another folder to move and copy messages around, and force initialization.
   var rootFolder = gLocalIncomingServer.rootMsgFolder;
   gLocalFolder2 = rootFolder.addSubfolder("folder2");
   var folderName = gLocalFolder2.prettiestName;
   // Create a third folder for more testing.
   gLocalFolder3 = rootFolder.addSubfolder("folder3");
   folderName = gLocalFolder3.prettiestName;
--- a/mailnews/base/test/unit/test_getMsgTextFromStream.js
+++ b/mailnews/base/test/unit/test_getMsgTextFromStream.js
@@ -9,17 +9,17 @@
 /**
  * Test suite for GetMsgTextFromStream.
  *
  * Currently tests: text/plain, text/html -- with tags stripped and without,
  * base64, multipart.
  * Does not currently test: quoted-printable, stripping quotes, UTF-8, small values of
  * bytesToRead.
  */
-const kDataRoot = "../../mailnews/data/"
+const kDataRoot = "../../../data/"
 
 function create(fileName, bytes, compressQuotes, stripHTML, outContentType)
 {
   return {name: fileName, bytesToRead: bytes, compressQuotes: compressQuotes, stripHTML: stripHTML,
           contentType: outContentType};
 }
 
 const gTestFiles =
--- a/mailnews/base/test/unit/test_imapPump.js
+++ b/mailnews/base/test/unit/test_imapPump.js
@@ -32,22 +32,22 @@
  * 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 ***** */
 
 // This test is intended as a simple demonstration of the imap pump test method
 
 // async support 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/mailTestUtils.js");
+load("../../../resources/asyncTestUtils.js");
 
 // IMAP pump
-load("../../mailnews/resources/IMAPpump.js");
+load("../../../resources/IMAPpump.js");
 
 // Globals
 
 // Messages to load must have CRLF line endings, that is Windows style
 const gMessage = "bugmail10"; // message file used as the test message
 
 setupIMAPPump();
 
@@ -91,15 +91,15 @@ function firstMsgHdr(folder) {
   if (enumerator.hasMoreElements())
     return enumerator.getNext().QueryInterface(Ci.nsIMsgDBHdr);
   return null;
 }
 
 // given a test file, return the file uri spec
 function specForFileName(aFileName)
 {
-  let file = do_get_file("../../mailnews/data/" + aFileName);
+  let file = do_get_file("../../../data/" + aFileName);
   let msgfileuri = Cc["@mozilla.org/network/io-service;1"]
                      .getService(Ci.nsIIOService)
                      .newFileURI(file)
                      .QueryInterface(Ci.nsIFileURL);
   return msgfileuri.spec;
 }
--- a/mailnews/base/test/unit/test_junkWhitelisting.js
+++ b/mailnews/base/test/unit/test_junkWhitelisting.js
@@ -34,20 +34,20 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Testing of junk whitelisting
  */
  
 // add address book setup
-load("../../mailnews/resources/abSetup.js");
+load("../../../resources/abSetup.js");
 
 // add fake POP3 server driver
-load("../../mailnews/resources/POP3pump.js");
+load("../../../resources/POP3pump.js");
 
 const prefs = Cc["@mozilla.org/preferences-service;1"]
                 .getService(Ci.nsIPrefBranch);
 
 /*
  * The address available in the test address book is "PrimaryEmail1@test.invalid"
  * Test emails may also include the address "invalid@example.com"
  *
@@ -60,27 +60,27 @@ const prefs = Cc["@mozilla.org/preferenc
  */
  
  // indices into hdrs[] of email by domain
  const kDomainTest = 0;
  const kDomainExample = 1;
 
 var Files = 
 [
-  "../../mailnews/data/bugmail1",
-  "../../mailnews/data/bugmail3"
+  "../../../data/bugmail1",
+  "../../../data/bugmail3"
 ]
 
 let hdrs = [];
 
 function run_test()
 {
 
   // Test setup - copy the data file into place
-  var testAB = do_get_file("../../test_addbook/unit/data/cardForEmail.mab");
+  var testAB = do_get_file("../../../addrbook/test/unit/data/cardForEmail.mab");
 
   // Copy the file to the profile directory for a PAB (this is the personal address book)
   testAB.copyTo(gProfileDir, kPABData.fileName);
 
   do_test_pending();
 
   // kick off copying
   gPOP3Pump.files = Files;
--- a/mailnews/base/test/unit/test_junkingWhenDisabled.js
+++ b/mailnews/base/test/unit/test_junkingWhenDisabled.js
@@ -1,20 +1,20 @@
 /*
  * Test that junk actions work even when the bayes filtering of incoming
  *  messages is disabled, as fixed in bug 487610. Test developed by Kent
  *  James using test_nsMsgDBView.js as a base.
  */
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../resources/messageGenerator.js");
+load("../../../resources/messageModifier.js");
+load("../../../resources/messageInjection.js");
 
 Components.utils.import("resource:///modules/jsTreeSelection.js");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const nsIMFNService = Ci.nsIMsgFolderNotificationService;
 var gMFNService = Cc["@mozilla.org/messenger/msgnotificationservice;1"]
                     .getService(nsIMFNService);
 
--- a/mailnews/base/test/unit/test_loadVirtualFolders.js
+++ b/mailnews/base/test/unit/test_loadVirtualFolders.js
@@ -40,17 +40,17 @@
 
 const am = Components.classes["@mozilla.org/messenger/account-manager;1"]
                      .getService(Components.interfaces.nsIMsgAccountManager);
 
 // main test
 
 function run_test()
 {
-  let vfdat = do_get_file("../../mailnews/data/test_virtualFolders.dat");
+  let vfdat = do_get_file("../../../data/test_virtualFolders.dat");
 
   vfdat.copyTo(gProfileDir, "virtualFolders.dat");
   loadLocalMailAccount();
   let localMailDir = gProfileDir.clone();
   localMailDir.append("Mail");
   localMailDir.append("Local Folders");
   localMailDir.append("unread-local");
   localMailDir.create(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("0644", 8));
--- a/mailnews/base/test/unit/test_nsIMsgFolderListenerLocal.js
+++ b/mailnews/base/test/unit/test_nsIMsgFolderListenerLocal.js
@@ -14,17 +14,17 @@
   * - Adding new folders
   * - Copy messages from files into the db
   * - Moving and copying one or more messages from one local folder to another
   * - Moving folders, with and without subfolders
   * - Renaming folders
   * - Deleting messages and folders, to trash and from trash (permanently)
   */
 
-load("../../mailnews/resources/msgFolderListenerSetup.js");
+load("../../../resources/msgFolderListenerSetup.js");
 
 // Globals
 var gMsgFile1, gMsgFile2, gMsgFile3;
 var gRootFolder;
 var gLocalFolder2;
 var gLocalFolder3;
 var gLocalTrashFolder;
 
@@ -277,19 +277,19 @@ const gTestArray =
 function run_test()
 {
   // Add a listener.
   gMFNService.addListener(gMFListener, allTestedEvents);
 
   loadLocalMailAccount();
 
   // Load up some messages so that we can copy them in later.
-  gMsgFile1 = do_get_file("../../mailnews/data/bugmail10");
-  gMsgFile2 = do_get_file("../../mailnews/data/bugmail11");
-  gMsgFile3 = do_get_file("../../mailnews/data/draft1");
+  gMsgFile1 = do_get_file("../../../data/bugmail10");
+  gMsgFile2 = do_get_file("../../../data/bugmail11");
+  gMsgFile3 = do_get_file("../../../data/draft1");
 
   // "Trash" folder
   gRootFolder = gLocalIncomingServer.rootMsgFolder;
   gLocalTrashFolder = gRootFolder.getChildNamed("Trash");
 
   // "Master" do_test_pending(), paired with a do_test_finished() at the end of all the operations.
   do_test_pending();
 
--- a/mailnews/base/test/unit/test_nsMsgDBView.js
+++ b/mailnews/base/test/unit/test_nsMsgDBView.js
@@ -4,22 +4,22 @@
  *
  * Things we really should do:
  * - Test that secondary sorting works, especially when the primary column is
  *   a custom column.
  *
  * You may also want to look into the test_viewWrapper_*.js tests as well.
  */
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../resources/messageGenerator.js");
+load("../../../resources/messageModifier.js");
+load("../../../resources/messageInjection.js");
 
 var gMessageGenerator = new MessageGenerator();
 var gScenarioFactory = new MessageScenarioFactory(gMessageGenerator);
 
 var gTestFolder;
 var gSiblingsMissingParentsSubject;
 
 function setup_globals(aNextFunc) {
--- a/mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
+++ b/mailnews/base/test/unit/test_nsMsgMailSession_Alerts.js
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsMsgMailSession functions relating to alerts and their
  * listeners.
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 var gDialogTitle = null;
 var gText = null;
 
 function reset() {
   gDialogTitle = null;
   gText = null;
 }
--- a/mailnews/base/test/unit/test_postPluginFilters.js
+++ b/mailnews/base/test/unit/test_postPluginFilters.js
@@ -33,17 +33,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * tests post-plugin message filters as implemented in bug 198100
  */
 
-load("../../mailnews/resources/POP3pump.js");
+load("../../../resources/POP3pump.js");
 
 // Globals
 
 const nsIJunkMailPlugin =
   Cc["@mozilla.org/messenger/filter-plugin;1?name=bayesianfilter"]
     .getService(Ci.nsIJunkMailPlugin);
 
 const gDbService = Cc["@mozilla.org/msgDatabase/msgDBService;1"]
@@ -51,18 +51,18 @@ const gDbService = Cc["@mozilla.org/msgD
 
 // command functions for test data
 const kTrain = 0;  // train a file as a trait
 const kClass = 1;  // classify files with traits
 
 var gTest; // currently active test
 var gMsgHdr; // current message header
 
-const kJunkFile = "../../mailnews/data/bugmail1";
-const kGoodFile = "../../mailnews/data/draft1";
+const kJunkFile = "../../../data/bugmail1";
+const kGoodFile = "../../../data/draft1";
 
 const kPriorityLow = 3;
 const kPriorityHigh = 5;
 var gInboxListener; // database listener object
 
 var gTests =
 [
   // train two different messages
@@ -288,15 +288,15 @@ function startCommand()
       gPOP3Pump.onDone = function(){do_timeout(100, startCommand);};
       gPOP3Pump.run();
       break;
   }
 }
 
 function getSpec(aFileName)
 {
-  var file = do_get_file("../../mailnews/data/" + aFileName);
+  var file = do_get_file(aFileName);
   var uri = Cc["@mozilla.org/network/io-service;1"]
                .getService(Ci.nsIIOService)
                .newFileURI(file).QueryInterface(Ci.nsIURL);
   uri.query = "type=application/x-message-display";
   return uri.spec;
 }
--- a/mailnews/base/test/unit/test_search.js
+++ b/mailnews/base/test/unit/test_search.js
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Testing of general mail search features.
  *
  * This tests some search attributes not tested by other specific tests,
  * e.g., test_searchTag.js or test_searchJunk.js
  */
-load("../../mailnews/resources/searchTestUtils.js");
+load("../../../resources/searchTestUtils.js");
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
 const nsMsgSearchScope = Ci.nsMsgSearchScope;
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 const nsMsgSearchOp = Ci.nsMsgSearchOp;
 
@@ -147,17 +147,17 @@ function run_test()
     OnProgress: function(aProgress, aProgressMax) {},
     SetMessageKey: function(aKey) {},
     SetMessageId: function(aMessageId) {},
     OnStopCopy: function(aStatus) { testSearch();}
   };
 
   // Get a message into the local filestore. function testSearch() continues
   // the testing after the copy.
-  var bugmail1 = do_get_file("../../mailnews/data/bugmail1");
+  var bugmail1 = do_get_file("../../../data/bugmail1");
   do_test_pending();
   copyService.CopyFileMessage(bugmail1, gLocalInboxFolder, null, false, 0,
                               "", copyListener, null);
 }
 
 // process each test from queue, calls itself upon completion of each search
 var testObject;
 function testSearch()
--- a/mailnews/base/test/unit/test_searchAddressInAb.js
+++ b/mailnews/base/test/unit/test_searchAddressInAb.js
@@ -32,20 +32,20 @@
  * 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 ***** */
 
 // Testing of to, cc, toorcc in addressbook search features added in bug 187768
 // Added testing of AllAddresses from bug 310359
 
-load("../../mailnews/resources/searchTestUtils.js");
+load("../../../resources/searchTestUtils.js");
 
 // add address book setup
-load("../../mailnews/resources/abSetup.js");
+load("../../../resources/abSetup.js");
 
 const ABUri = kPABData.URI;
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"].
                       getService(Ci.nsIMsgCopyService);
 
 const nsMsgSearchScope = Ci.nsMsgSearchScope;
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
@@ -129,36 +129,36 @@ var Tests =
   { value: ABUri,
     attrib: CCopy,
     op: IsntInAB,
     count: 4 },
 ];
 
 var Files = 
 [
-  "../../mailnews/data/bugmail1",
-  "../../mailnews/data/bugmail2",
-  "../../mailnews/data/bugmail3",
-  "../../mailnews/data/bugmail4",
-  "../../mailnews/data/bugmail5",
-  "../../mailnews/data/bugmail6",
-  "../../mailnews/data/bugmail7",
-  "../../mailnews/data/bugmail8"
+  "../../../data/bugmail1",
+  "../../../data/bugmail2",
+  "../../../data/bugmail3",
+  "../../../data/bugmail4",
+  "../../../data/bugmail5",
+  "../../../data/bugmail6",
+  "../../../data/bugmail7",
+  "../../../data/bugmail8"
 ]
 
 var messageKey, hdr;
 
 function run_test()
 {
   // Setup local mail accounts.
 
   loadLocalMailAccount();
     
     // Test setup - copy the data file into place
-  var testAB = do_get_file("../../test_addbook/unit/data/cardForEmail.mab");
+  var testAB = do_get_file("../../../addrbook/test/unit/data/cardForEmail.mab");
 
   // Copy the file to the profile directory for a PAB
   testAB.copyTo(gProfileDir, kPABData.fileName);
 
   // test that validity table terms are valid
 
   // offline mail table
   testValidityTable(offlineMail, IsInAB, Sender, true);
--- a/mailnews/base/test/unit/test_searchBody.js
+++ b/mailnews/base/test/unit/test_searchBody.js
@@ -32,17 +32,17 @@
  * 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 ***** */
 
 /*
  * This tests various body search criteria.
  */
-load("../../mailnews/resources/searchTestUtils.js");
+load("../../../resources/searchTestUtils.js");
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
 const nsMsgSearchScope = Ci.nsMsgSearchScope;
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 const nsMsgSearchOp = Ci.nsMsgSearchOp;
 
@@ -59,20 +59,20 @@ const onlineMail = nsMsgSearchScope.onli
 const offlineMailFilter = nsMsgSearchScope.offlineMailFilter;
 const onlineMailFilter = nsMsgSearchScope.onlineMailFilter;
 const news = nsMsgSearchScope.news; // control entry not enabled
 
 const Body = nsMsgSearchAttrib.Body;
 
 var Files =
 [
-  "../../mailnews/data/base64-1",
-  "../../mailnews/data/basic1",
-  "../../mailnews/data/multipart-base64-2",
-  "../../mailnews/data/bug132340"
+  "../../../data/base64-1",
+  "../../../data/basic1",
+  "../../../data/multipart-base64-2",
+  "../../../data/bug132340"
 ]
 var Tests =
 [
   /* Translate Base64 messages */
   { value: "World!",
     op: Contains,
     count: 2 },
   /* Don't match the base64 text */
--- a/mailnews/base/test/unit/test_searchBoolean.js
+++ b/mailnews/base/test/unit/test_searchBoolean.js
@@ -187,17 +187,17 @@ function run_test()
     OnProgress: function(aProgress, aProgressMax) {},
     SetMessageKey: function(aKey) { gHdr = gLocalInboxFolder.GetMessageHeader(aKey);},
     SetMessageId: function(aMessageId) {},
     OnStopCopy: function(aStatus) { testSearch();}
   };
 
   // Get a message into the local filestore. function testSearch() continues
   // the testing after the copy.
-  var bugmail1 = do_get_file("../../mailnews/data/bugmail1");
+  var bugmail1 = do_get_file("../../../data/bugmail1");
   do_test_pending();
   gCopyService.CopyFileMessage(bugmail1, gLocalInboxFolder, null, false, 0,
                               "", copyListener, null);
 }
 
 let gTest = null;
 // process each test from queue, calls itself upon completion of each search
 function testSearch()
--- a/mailnews/base/test/unit/test_searchChaining.js
+++ b/mailnews/base/test/unit/test_searchChaining.js
@@ -35,31 +35,31 @@
  * ***** END LICENSE BLOCK ***** */
 
 // Test of chaining of search scopes in a search session. In particular,
 //  Bug 541969 made us not search an imap folder if the search scope before it
 // there was an empty local folder.
 
 // main test
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 var gIMAPInbox;
 var gServer, gIMAPIncomingServer;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
 // Globals
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 function run_test()
 {
   // Pull in the IMAP fake server code
-  load("../../test_imap/unit/head_server.js");
+  load("../../../imap/test/unit/head_server.js");
 
   loadLocalMailAccount();
 
   /*
    * Set up an IMAP server.
    */
   let IMAPDaemon = new imapDaemon();
   gServer = makeServer(IMAPDaemon, "");
--- a/mailnews/base/test/unit/test_searchCustomTerm.js
+++ b/mailnews/base/test/unit/test_searchCustomTerm.js
@@ -33,17 +33,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Testing of custom search features.
  *
  */
-load("../../mailnews/resources/searchTestUtils.js");
+load("../../../resources/searchTestUtils.js");
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
 const kCustomId = "xpcomtest@mozilla.org#test";
 var gHdr;
 
 var Tests =
@@ -103,17 +103,17 @@ function run_test()
     OnProgress: function(aProgress, aProgressMax) {},
     SetMessageKey: function(aKey) { gHdr = gLocalInboxFolder.GetMessageHeader(aKey);},
     SetMessageId: function(aMessageId) {},
     OnStopCopy: function(aStatus) { doTest();}
   };
 
   // Get a message into the local filestore.
   // function testSearch() continues the testing after the copy.
-  let bugmail1 = do_get_file("../../mailnews/data/bugmail1");
+  let bugmail1 = do_get_file("../../../data/bugmail1");
   do_test_pending();
 
   copyService.CopyFileMessage(bugmail1, gLocalInboxFolder, null, false, 0,
                               "", copyListener, null);
 }
 
 var testObject;
 
--- a/mailnews/base/test/unit/test_searchJunk.js
+++ b/mailnews/base/test/unit/test_searchJunk.js
@@ -31,17 +31,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * 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 ***** */
 
 // Testing of search by junk percent and junk score origin
 
-load("../../mailnews/resources/searchTestUtils.js");
+load("../../../resources/searchTestUtils.js");
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
 const nsMsgSearchScope = Ci.nsMsgSearchScope;
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 const nsMsgSearchOp = Ci.nsMsgSearchOp;
 
@@ -50,17 +50,17 @@ const IsLessThan = nsMsgSearchOp.IsLessT
 const Is = nsMsgSearchOp.Is;
 const Isnt = nsMsgSearchOp.Isnt;
 
 const offlineMail = nsMsgSearchScope.offlineMail;
 
 const JunkScoreOrigin = nsMsgSearchAttrib.JunkScoreOrigin;
 const JunkPercent = nsMsgSearchAttrib.JunkPercent;
 
-const fileName = "../../mailnews/data/bugmail1";
+const fileName = "../../../data/bugmail1";
 
 /*
  * The search for junkpercent is defined as the effective value,
  * while the "junkpercent" database term is always the result
  * from the bayes filter. This is optimized to make views that
  * rely on junk percent search work with the best value for junk
  * percent, while allowing junk percent from the bayes filter
  * to be saved for analysis.
--- a/mailnews/base/test/unit/test_searchTag.js
+++ b/mailnews/base/test/unit/test_searchTag.js
@@ -36,17 +36,17 @@
 
 /*
  * Testing of tag search features.
  *
  * Specifically tests changes implemented in bug 217034
  * Does not do comprehensive testing.
  *
  */
-load("../../mailnews/resources/searchTestUtils.js");
+load("../../../resources/searchTestUtils.js");
 
 const tagService = Cc["@mozilla.org/messenger/tagservice;1"]
                      .getService(Ci.nsIMsgTagService);
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
 const nsMsgSearchScope = Ci.nsMsgSearchScope;
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
@@ -378,17 +378,17 @@ function run_test()
     OnStartCopy: function() {},
     OnProgress: function(aProgress, aProgressMax) {},
     SetMessageKey: function(aKey) { hdr = gLocalInboxFolder.GetMessageHeader(aKey);},
     SetMessageId: function(aMessageId) {},
     OnStopCopy: function(aStatus) { testKeywordSearch();}
   };
 
   // Get a message into the local filestore. function testKeywordSearch() continues the testing after the copy.
-  var bugmail1 = do_get_file("../../mailnews/data/bugmail1");
+  var bugmail1 = do_get_file("../../../data/bugmail1");
   do_test_pending();
   copyService.CopyFileMessage(bugmail1, gLocalInboxFolder, null, false, 0,
                               "", copyListener, null);
 }
 
 // process each test from queue, calls itself upon completion of each search
 var testObject;
 function testKeywordSearch()
--- a/mailnews/base/test/unit/test_searchUint32HdrProperty.js
+++ b/mailnews/base/test/unit/test_searchUint32HdrProperty.js
@@ -33,17 +33,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Testing of Uint32HdrProperty search attribute. Adapted from test_search.js
  */
  
-load("../../mailnews/resources/searchTestUtils.js");
+load("../../../resources/searchTestUtils.js");
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 const nsMsgSearchOp = Ci.nsMsgSearchOp;
 
 const Isnt = nsMsgSearchOp.Isnt;
@@ -114,17 +114,17 @@ function run_test()
     OnProgress: function(aProgress, aProgressMax) {},
     SetMessageKey: function(aKey) {},
     SetMessageId: function(aMessageId) {},
     OnStopCopy: function(aStatus) { testSearch();}
   };
 
   // Get a message into the local filestore. function testSearch() continues
   // the testing after the copy.
-  var bugmail1 = do_get_file("../../mailnews/data/bugmail1");
+  var bugmail1 = do_get_file("../../../data/bugmail1");
   do_test_pending();
   copyService.CopyFileMessage(bugmail1, gLocalInboxFolder, null, false, 0,
                               "", copyListener, null);
 }
 
 // process each test from queue, calls itself upon completion of each search
 var testObject;
 function testSearch()
--- a/mailnews/base/test/unit/test_testsuite_fakeserverAuth.js
+++ b/mailnews/base/test/unit/test_testsuite_fakeserverAuth.js
@@ -2,17 +2,17 @@
  * Tests functions in mailnews/test/fakeserver/auth.js
  * which are responsible for the authentication in the
  * fakeserver.
  *
  * Do NOT essentially re-code the auth schemes here,
  * just check roundtrips, against static values etc..
  */
 
-load("../../mailnews/fakeserver/auth.js")
+load("../../../fakeserver/auth.js")
 
 const kUsername = "fred1";
 const kPassword = "wilma2";
 
 function run_test()
 {
   authPLAIN();
   authCRAMMD5();
--- a/mailnews/compose/test/unit/head_compose.js
+++ b/mailnews/compose/test/unit/head_compose.js
@@ -1,19 +1,19 @@
 // Import the main scripts that mailnews tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../resources/mailDirService.js");
+load("../../../resources/mailTestUtils.js");
 
 // Import the required setup scripts.
-load("../../mailnews/resources/abSetup.js");
+load("../../../resources/abSetup.js");
 
 // Import the smtp server scripts
-load("../../mailnews/fakeserver/maild.js")
-load("../../mailnews/fakeserver/auth.js")
-load("../../mailnews/fakeserver/smtpd.js")
+load("../../../fakeserver/maild.js")
+load("../../../fakeserver/auth.js")
+load("../../../fakeserver/smtpd.js")
 
 const SMTP_PORT = 1024+120;
 
 // Setup the daemon and server
 function setupServerDaemon(handler) {
   if (!handler)
     handler = new SMTP_RFC2821_handler(new smtpDaemon());
   var server = new nsMailServer(handler);
--- a/mailnews/compose/test/unit/tail_compose.js
+++ b/mailnews/compose/test/unit/tail_compose.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../resources/mailShutdown.js");
--- a/mailnews/compose/test/unit/test_bug155172.js
+++ b/mailnews/compose/test/unit/test_bug155172.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Authentication tests for SMTP.
  */
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 var gNewPassword = null;
 
 function confirmEx(aDialogTitle, aText, aButtonFlags, aButton0Title,
                    aButton1Title, aButton2Title, aCheckMsg, aCheckState) {
   // Just return 2 which will is pressing button 2 - enter a new password.
   return 2;
 }
--- a/mailnews/compose/test/unit/test_nsMsgCompose1.js
+++ b/mailnews/compose/test/unit/test_nsMsgCompose1.js
@@ -38,22 +38,22 @@ function checkPopulate(aTo, aNonHTMLReci
 
   do_check_eq(fields.to, aCheckTo);
 
   do_check_eq(nonHTMLRecipients.value, aNonHTMLRecipients);
 }
 
 function run_test() {
   // Test setup - copy the data files into place
-  var testAB = do_get_file("../../mailnews/data/abLists1.mab");
+  var testAB = do_get_file("../../../data/abLists1.mab");
 
   // Copy the file to the profile directory for a PAB
   testAB.copyTo(gProfileDir, kPABData.fileName);
 
-  testAB = do_get_file("../../mailnews/data/abLists2.mab");
+  testAB = do_get_file("../../../data/abLists2.mab");
 
   // Copy the file to the profile directory for a CAB
   testAB.copyTo(gProfileDir, kCABData.fileName);
 
   // Test - Check we can initalize with fewest specified
   // parameters and don't fail/crash like we did in bug 411646.
 
   var msgCompose = Components.classes[MsgComposeContractID]
--- a/mailnews/compose/test/unit/test_nsMsgCompose3.js
+++ b/mailnews/compose/test/unit/test_nsMsgCompose3.js
@@ -57,17 +57,17 @@ function checkPopulate(aTo, aNonHTMLReci
 
   do_check_eq(fields.to, aCheckTo);
 
   do_check_eq(nonHTMLRecipients.value, aNonHTMLRecipients);
 }
 
 function run_test() {
   // Test setup - copy the data files into place
-  let testAB = do_get_file("../../mailnews/data/tb2hexpopularity.mab");
+  let testAB = do_get_file("../../../data/tb2hexpopularity.mab");
 
   // Copy the file to the profile directory for a PAB
   testAB.copyTo(gProfileDir, kPABData.fileName);
 
   // Check the popularity index on a couple of cards.
   let abManager = Cc["@mozilla.org/abmanager;1"].getService(Ci.nsIAbManager);
 
   let AB = abManager.getDirectory(kPABData.URI);
--- a/mailnews/compose/test/unit/test_sendMessageLater2.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater2.js
@@ -7,18 +7,18 @@
  * from one send later instance, however due to the fact we use one connection
  * per message sent, it is very difficult to consistently get the fake server
  * reconected in time for the next connection. Thus, sending of multiple
  * messages is currently disabled (but commented out for local testing if
  * required), when we fix bug 136871 we should be able to enable the multiple
  * messages option. 
  */
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/asyncTestUtils.js");
 
 var test = "sendMessageLater";
 var server = null;
 var gSentFolder;
 var originalData;
 var identity = null;
 var gMsgFile =
 [
--- a/mailnews/compose/test/unit/test_sendMessageLater3.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater3.js
@@ -3,17 +3,17 @@
  * Protocol tests for SMTP.
  *
  * For trying to send a message later with no server connected, this test
  * verifies:
  *   - A correct status response.
  *   - A correct state at the end of attempting to send.
  */
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 var type = null;
 var test = null;
 var server;
 var sentFolder;
 var transaction;
 var originalData;
 var finished = false;
--- a/mailnews/compose/test/unit/test_smtpPassword.js
+++ b/mailnews/compose/test/unit/test_smtpPassword.js
@@ -15,17 +15,17 @@ function run_test() {
   var handler = new SMTP_RFC2821_handler(new smtpDaemon());
   server = new nsMailServer(handler);
   // Username and password need to match signons.txt
   handler.kUsername = kUsername;
   handler.kPassword = kPassword;
   handler.kAuthRequired = true;
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   // Test file
   var testFile = do_get_file("data/message1.eml");
 
   // Ensure we have at least one mail account
--- a/mailnews/compose/test/unit/test_smtpPassword2.js
+++ b/mailnews/compose/test/unit/test_smtpPassword2.js
@@ -10,17 +10,17 @@ const kHostname = "localhost";
 const kServerUrl = kProtocol + "://" + kHostname;
 
 function run_test()
 {
   // Login Manager
   var loginMgr = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8-multiple.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8-multiple.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   // Set up the basic accounts and folders.
   loadLocalMailAccount();
 
   var smtpServer1 = getBasicSmtpServer();
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure1.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure1.js
@@ -7,17 +7,17 @@
  *   - Check cancel does what it should do.
  *
  * XXX Due to problems with the fakeserver + smtp not using one connection for
  * multiple sends, the rest of this test is in test_smtpPasswordFailure2.js.
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 var server;
 var attempt = 0;
 
 const kSender = "from@invalid.com";
 const kTo = "to@invalid.com";
 const kUsername = "testsmtp";
 // This is the same as in the signons file.
@@ -80,17 +80,17 @@ function run_test() {
   var handler = new SMTP_RFC2821_handler(new smtpDaemon());
   server = new nsMailServer(handler);
   // Username needs to match signons.txt
   handler.kUsername = kUsername;
   handler.kPassword = kValidPassword;
   handler.kAuthRequired = true;
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   registerAlertTestUtils();
 
   // Test file
   var testFile = do_get_file("data/message1.eml");
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure2.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure2.js
@@ -7,17 +7,17 @@
  *
  * XXX Due to problems with the fakeserver + smtp not using one connection for
  * multiple sends, the first part of this test is in
  * test_smtpPasswordFailure2.js.
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 var server;
 var attempt = 0;
 
 const kSender = "from@invalid.com";
 const kTo = "to@invalid.com";
 const kUsername = "testsmtp";
 // This is the same as in the signons file.
@@ -91,17 +91,17 @@ function run_test() {
   server = new nsMailServer(handler);
   // Username needs to match signons.txt
   handler.kUsername = kUsername;
   handler.kPassword = kValidPassword;
   handler.kAuthRequired = true;
   handler.kAuthSchemes = [ "PLAIN", "LOGIN" ]; // make match expected transaction below
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   registerAlertTestUtils();
 
   // Test file
   var testFile = do_get_file("data/message1.eml");
--- a/mailnews/compose/test/unit/test_smtpPasswordFailure3.js
+++ b/mailnews/compose/test/unit/test_smtpPasswordFailure3.js
@@ -5,17 +5,17 @@
  *   - Have an invalid password in the password database.
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  *
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 var server;
 var attempt = 0;
 
 const kSender = "from@invalid.com";
 const kTo = "to@invalid.com";
 const kUsername = "testsmtp";
 // This is the same as in the signons file.
@@ -90,17 +90,17 @@ function run_test() {
   server = new nsMailServer(handler);
   // Username needs to match signons.txt
   handler.kUsername = kUsername;
   handler.kPassword = kValidPassword;
   handler.kAuthRequired = true;
   handler.kAuthSchemes = [ "PLAIN", "LOGIN" ]; // make match expected transaction below
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   registerAlertTestUtils();
 
   // Test file
   var testFile = do_get_file("data/message1.eml");
--- a/mailnews/db/gloda/test/unit/head_gloda.js
+++ b/mailnews/db/gloda/test/unit/head_gloda.js
@@ -1,2 +1,4 @@
+gDEPTH = "../../../../../";
+
 // Import the required setup scripts.
-load("../../mailnews/resources/abSetup.js");
+load("../../../../resources/abSetup.js");
--- a/mailnews/db/gloda/test/unit/resources/glodaTestHelper.js
+++ b/mailnews/db/gloda/test/unit/resources/glodaTestHelper.js
@@ -49,26 +49,26 @@
  * There is no need to tell us to expect the messages to be indexed prior to the
  *  waiting as long as nothing spins the event loop after you perform the action
  *  that triggers indexing.  None of our existing xpcshell tests do this, but it
  *  is part of the mozmill idiom for its waiting mechanism, so be sure to not
  *  perform a mozmill wait without first telling us to expect the messages.
  */
 
 // Import the main scripts that mailnews tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../resources/mailDirService.js");
+load("../../../../resources/mailTestUtils.js");
+load("../../../../resources/logHelper.js");
+load("../../../../resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../../resources/messageGenerator.js");
+load("../../../../resources/messageModifier.js");
+load("../../../../resources/messageInjection.js");
 
-load("../../mailnews/resources/folderEventLogHelper.js");
+load("../../../../resources/folderEventLogHelper.js");
 // register this before gloda gets a chance to do anything so that
 registerFolderEventLogHelper();
 
 
 // Create a message generator
 const msgGen = gMessageGenerator = new MessageGenerator();
 // Create a message scenario generator using that message generator
 const scenarios = gMessageScenarioFactory = new MessageScenarioFactory(msgGen);
--- a/mailnews/db/gloda/test/unit/tail_gloda.js
+++ b/mailnews/db/gloda/test/unit/tail_gloda.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../../resources/mailShutdown.js");
--- a/mailnews/db/gloda/test/unit/test_corrupt_database.js
+++ b/mailnews/db/gloda/test/unit/test_corrupt_database.js
@@ -39,20 +39,20 @@
  * 1) We need to do things as part of the test without gloda having remotely
  *    thought about opening the database.
  * 2) We expect and desire that the logger produce a warning and glodaTestHelper
  *    takes the view that warnings = death.
  *
  * We do use the rest of the test infrastructure though.
  */
 
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../resources/mailDirService.js");
+load("../../../../resources/mailTestUtils.js");
+load("../../../../resources/logHelper.js");
+load("../../../../resources/asyncTestUtils.js");
 
 // -- Do configure the gloda prefs though...
 const gPrefs = Cc["@mozilla.org/preferences-service;1"]
                  .getService(Ci.nsIPrefBranch);
 // yes to indexing
 gPrefs.setBoolPref("mailnews.database.global.indexer.enabled", true);
 // no to a sweep we don't control
 gPrefs.setBoolPref("mailnews.database.global.indexer.perform_initial_sweep",
--- a/mailnews/db/gloda/test/unit/test_mime_attachments_size.js
+++ b/mailnews/db/gloda/test/unit/test_mime_attachments_size.js
@@ -40,24 +40,24 @@
  * is streamed to us is actually labeled with the right size.
  */
 
 /*
  * Do not include glodaTestHelper because we do not want gloda loaded and it
  *  adds a lot of runtime overhead which makes certain debugging strategies like
  *  using chronicle-recorder impractical.
  */
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../resources/mailDirService.js");
+load("../../../../resources/mailTestUtils.js");
+load("../../../../resources/logHelper.js");
+load("../../../../resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../../resources/messageGenerator.js");
+load("../../../../resources/messageModifier.js");
+load("../../../../resources/messageInjection.js");
 
 // Create a message generator
 const msgGen = gMessageGenerator = new MessageGenerator();
 // Create a message scenario generator using that message generator
 const scenarios = gMessageScenarioFactory = new MessageScenarioFactory(msgGen);
 
 Components.utils.import("resource:///modules/gloda/mimemsg.js");
 
--- a/mailnews/db/gloda/test/unit/test_mime_emitter.js
+++ b/mailnews/db/gloda/test/unit/test_mime_emitter.js
@@ -45,24 +45,24 @@
  * - sun attachment
  */
 
 /*
  * Do not include glodaTestHelper because we do not want gloda loaded and it
  *  adds a lot of runtime overhead which makes certain debugging strategies like
  *  using chronicle-recorder impractical.
  */
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../../resources/mailDirService.js");
+load("../../../../resources/mailTestUtils.js");
+load("../../../../resources/logHelper.js");
+load("../../../../resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/messageGenerator.js");
-load("../../mailnews/resources/messageModifier.js");
-load("../../mailnews/resources/messageInjection.js");
+load("../../../../resources/messageGenerator.js");
+load("../../../../resources/messageModifier.js");
+load("../../../../resources/messageInjection.js");
 
 // Create a message generator
 const msgGen = gMessageGenerator = new MessageGenerator();
 // Create a message scenario generator using that message generator
 const scenarios = gMessageScenarioFactory = new MessageScenarioFactory(msgGen);
 
 Components.utils.import("resource:///modules/gloda/mimemsg.js");
 
--- a/mailnews/db/msgdb/test/unit/head_maildb.js
+++ b/mailnews/db/msgdb/test/unit/head_maildb.js
@@ -1,3 +1,3 @@
 // Import the main scripts that mailnews tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../../resources/mailDirService.js");
+load("../../../../resources/mailTestUtils.js");
--- a/mailnews/db/msgdb/test/unit/tail_msgdb.js
+++ b/mailnews/db/msgdb/test/unit/tail_msgdb.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../../resources/mailShutdown.js");
--- a/mailnews/db/msgdb/test/unit/test_enumerator_cleanup.js
+++ b/mailnews/db/msgdb/test/unit/test_enumerator_cleanup.js
@@ -1,15 +1,15 @@
 /*
  * Test nsMsgDatabase's cleanup of nsMsgDBEnumerators
  */
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
-const anyOldMessage = do_get_file("../../mailnews/data/bugmail1");
+const anyOldMessage = do_get_file("../../../../data/bugmail1");
 
 /**
  * Test closing a db with an outstanding enumerator.
  */
 function test_enumerator_cleanup() {
   let db = gLocalInboxFolder.msgDatabase;
   let enumerator = db.EnumerateMessages();
   db.forceFolderDBClosed(gLocalInboxFolder);
--- a/mailnews/db/msgdb/test/unit/test_filter_enumerator.js
+++ b/mailnews/db/msgdb/test/unit/test_filter_enumerator.js
@@ -1,9 +1,9 @@
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../../resources/messageGenerator.js");
 
 var gMessages = [];
 const nsMsgSearchScope  = Ci.nsMsgSearchScope;
 const nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
 const nsMsgSearchOp     = Ci.nsMsgSearchOp;
 const nsMsgMessageFlags = Ci.nsMsgMessageFlags;
 const nsMsgFolderFlags = Ci.nsMsgFolderFlags;
 
--- a/mailnews/db/msgdb/test/unit/test_maildb.js
+++ b/mailnews/db/msgdb/test/unit/test_maildb.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for msg database functions.
  */
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../../resources/messageGenerator.js");
 
 var dbService;
 var gTestFolder;
 var gCurTestNum = 0;
 const kNumTestMessages = 10;
 
 const gTestArray =
 [
--- a/mailnews/db/msgdb/test/unit/test_propertyEnumerator.js
+++ b/mailnews/db/msgdb/test/unit/test_propertyEnumerator.js
@@ -31,27 +31,27 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * 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 ***** */
 
  // tests propertyEnumerator in nsIMsgDBHdr;
 
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../../resources/mailTestUtils.js");
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 var gHdr;
 
 function run_test() {
   loadLocalMailAccount();
   // Get a message into the local filestore.
   // Function continue_test() continues the testing after the copy.
-  var bugmail1 = do_get_file("../../mailnews/data/bugmail1");
+  var bugmail1 = do_get_file("../../../../data/bugmail1");
   do_test_pending();
   copyService.CopyFileMessage(bugmail1, gLocalInboxFolder, null, false, 0,
                               "", copyListener, null);
 }
 
 var copyListener =
 {
   OnStartCopy: function() {},
--- a/mailnews/db/msgdb/test/unit/test_references_parsing.js
+++ b/mailnews/db/msgdb/test/unit/test_references_parsing.js
@@ -1,15 +1,15 @@
 /*
  * Test nsMsgHdr's In-Reply-To/References parsing logic.
  */
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
-const anyOldMessage = do_get_file("../../mailnews/data/bugmail1");
+const anyOldMessage = do_get_file("../../../../data/bugmail1");
 
 var refsAndResults = [
   // an empty string is not a reference.
   ["", []],
   // super valid things
   ["<abc@def>", ["abc@def"]],
   ["<up@down> <left@right> <ying@yang>",
     ["up@down", "left@right", "ying@yang"]],
--- a/mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js
+++ b/mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js
@@ -1,11 +1,11 @@
 // Import the main scripts that mailnews tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../../resources/mailDirService.js");
+load("../../../../resources/mailTestUtils.js");
 
 function getSpec(aFileName)
 {
   var file = do_get_file("resources/" + aFileName);
   var uri = Cc["@mozilla.org/network/io-service;1"]
                .getService(Ci.nsIIOService)
                .newFileURI(file).QueryInterface(Ci.nsIURL);
   uri.query = "type=application/x-message-display";
--- a/mailnews/extensions/bayesian-spam-filter/test/unit/tail_bayesian.js
+++ b/mailnews/extensions/bayesian-spam-filter/test/unit/tail_bayesian.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../../resources/mailShutdown.js");
--- a/mailnews/extensions/mdn/test/unit/test_askuser.js
+++ b/mailnews/extensions/mdn/test/unit/test_askuser.js
@@ -1,10 +1,10 @@
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../../resources/mailDirService.js");
+load("../../../../resources/mailTestUtils.js");
 
 var gMessenger = Cc["@mozilla.org/messenger;1"].
                    createInstance(Ci.nsIMessenger);
 
 loadLocalMailAccount();
 
 let acctMgr = Cc["@mozilla.org/messenger/account-manager;1"]
                .getService(Ci.nsIMsgAccountManager);
--- a/mailnews/extensions/mdn/test/unit/test_mdnFlags.js
+++ b/mailnews/extensions/mdn/test/unit/test_mdnFlags.js
@@ -1,15 +1,15 @@
 /**
  * This tests that setting mdn flags works correctly, so that we don't
  * reprompt when the user re-selects a message.
  */
 
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../../resources/mailDirService.js");
+load("../../../../resources/mailTestUtils.js");
 
 var gMessenger = Cc["@mozilla.org/messenger;1"].
                    createInstance(Ci.nsIMessenger);
 
 loadLocalMailAccount();
 
 let acctMgr = Cc["@mozilla.org/messenger/account-manager;1"]
                .getService(Ci.nsIMsgAccountManager);
--- a/mailnews/imap/test/unit/head_server.js
+++ b/mailnews/imap/test/unit/head_server.js
@@ -1,16 +1,21 @@
+// We can be executed from multiple depths
+// Provide gDEPTH if not already defined
+if (typeof gDEPTH == "undefined")
+  gDEPTH = "../../../../";
+
 // Import fakeserver
-load("../../mailnews/fakeserver/maild.js");
-load("../../mailnews/fakeserver/auth.js");
-load("../../mailnews/fakeserver/imapd.js");
+load(gDEPTH + "mailnews/fakeserver/maild.js");
+load(gDEPTH + "mailnews/fakeserver/auth.js");
+load(gDEPTH + "mailnews/fakeserver/imapd.js");
 
 // And mailnews scripts
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load(gDEPTH + "mailnews/resources/mailDirService.js");
+load(gDEPTH + "mailnews/resources/mailTestUtils.js");
 
 const IMAP_PORT = 1024 + 143;
 
 function makeServer(daemon, infoString) {
   if (infoString in configurations)
     return makeServer(daemon, configurations[infoString].join(","));
 
   var handler = new IMAP_RFC3501_handler(daemon);
--- a/mailnews/imap/test/unit/tail_imap.js
+++ b/mailnews/imap/test/unit/tail_imap.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../resources/mailShutdown.js");
--- a/mailnews/imap/test/unit/test_autosync_date_constraints.js
+++ b/mailnews/imap/test/unit/test_autosync_date_constraints.js
@@ -1,16 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test autosync date constraints
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
 // Globals
 var gRootFolder;
 var gIMAPInbox, gIMAPTrashFolder, gMsgImapInboxFolder;
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
--- a/mailnews/imap/test/unit/test_bccProperty.js
+++ b/mailnews/imap/test/unit/test_bccProperty.js
@@ -8,17 +8,17 @@
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
 const gFileName = "draft1";
-const gMsgFile = do_get_file("../../mailnews/data/" + gFileName);
+const gMsgFile = do_get_file("../../../data/" + gFileName);
 
 var gDownloadedOnce = false;
 var gIMAPInbox;
 
 function run_test()
 {
   loadLocalMailAccount();
 
--- a/mailnews/imap/test/unit/test_bug460636.js
+++ b/mailnews/imap/test/unit/test_bug460636.js
@@ -3,17 +3,17 @@
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer, gSavedMsgFile;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
 const gFileName = "bug460636";
-const gMsgFile = do_get_file("../../mailnews/data/" + gFileName);
+const gMsgFile = do_get_file("../../../data/" + gFileName);
                      
 function run_test()
 {
   /*
    * Set up an IMAP server. The bug is only triggered when nsMsgSaveAsListener
    * is used (i.e., for IMAP and NNTP).
    */
   gIMAPDaemon = new imapDaemon();
--- a/mailnews/imap/test/unit/test_compactOfflineStore.js
+++ b/mailnews/imap/test/unit/test_compactOfflineStore.js
@@ -4,34 +4,34 @@
  * and returns success.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 // Globals
 var gRootFolder;
 var gIMAPInbox, gIMAPTrashFolder, gMsgImapInboxFolder;
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 var gImapInboxOfflineStoreSize;
 var gCurTestNum;
 
-const gMsgFile1 = do_get_file("../../mailnews/data/bugmail10");
-const gMsgFile2 = do_get_file("../../mailnews/data/bugmail11");
-const gMsgFile3 = do_get_file("../../mailnews/data/draft1");
-const gMsgFile4 = do_get_file("../../mailnews/data/bugmail7");
-const gMsgFile5 = do_get_file("../../mailnews/data/bugmail6");
+const gMsgFile1 = do_get_file("../../../data/bugmail10");
+const gMsgFile2 = do_get_file("../../../data/bugmail11");
+const gMsgFile3 = do_get_file("../../../data/draft1");
+const gMsgFile4 = do_get_file("../../../data/bugmail7");
+const gMsgFile5 = do_get_file("../../../data/bugmail6");
 
 // Copied straight from the example files
 const gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
 const gMsgId2 = "200804111417.m3BEHTk4030129@mrapp51.mozilla.org";
 const gMsgId3 = "4849BF7B.2030800@example.com";
 const gMsgId4 = "bugmail7.m47LtAEf007542@mrapp51.mozilla.org";
 const gMsgId5 = "bugmail6.m47LtAEf007542@mrapp51.mozilla.org";
 
--- a/mailnews/imap/test/unit/test_copyThenMove.js
+++ b/mailnews/imap/test/unit/test_copyThenMove.js
@@ -36,24 +36,24 @@ const gTestArray =
     dump("gEmpty2 " + gEmptyLocal2.URI + "\n");
     let folders = new Array;
     folders.push(gEmptyLocal2);
     let array = toXPCOMArray(folders, Ci.nsIMutableArray);
     gCopyService.CopyFolders(array, gIMAPInbox, false, CopyListener, null);
   },
   function getLocalMessage1() {
     dump("getLocalMessage\n");
-    var file = do_get_file("../../mailnews/data/bugmail1");
+    var file = do_get_file("../../../data/bugmail1");
     gCopyService.CopyFileMessage(file, gLocalInboxFolder, null, false, 0,
                                 "", CopyListener, null);
   },
   function getLocalMessage2() {
     gMessages.appendElement(gLocalInboxFolder.GetMessageHeader(gLastKey), false);
     dump("getLocalMessage\n");
-    var file = do_get_file("../../mailnews/data/draft1");
+    var file = do_get_file("../../../data/draft1");
     gCopyService.CopyFileMessage(file, gLocalInboxFolder, null, false, 0,
                                 "", CopyListener, null);
   },
   function copyMessages() {
     gMessages.appendElement(gLocalInboxFolder.GetMessageHeader(gLastKey), false);
     let folder1 = gIMAPInbox.getChildNamed("empty 1");
     gCopyService.CopyMessages(gLocalInboxFolder, gMessages, folder1, false, CopyListener, null, false);
   },
--- a/mailnews/imap/test/unit/test_dod.js
+++ b/mailnews/imap/test/unit/test_dod.js
@@ -39,17 +39,17 @@ function run_test()
 
   do_test_pending();
   do_timeout(10000, function(){
     do_throw('Tests did not complete within 10 seconds. ABORTING.');
     }
   );
 
   let fileNames = [];
-  let msgFiles = do_get_file("../../mailnews/data/").directoryEntries;
+  let msgFiles = do_get_file("../../../data/").directoryEntries;
   while (msgFiles.hasMoreElements()) {
     let file = msgFiles.getNext();
     let msgfileuri = ioS.newFileURI(file).QueryInterface(Ci.nsIFileURL);
     if (/^bodystructure/i.test(msgfileuri.fileName)) {
       inbox.addMessage(new imapMessage(msgfileuri.spec, inbox.uidnext++, []));
       fileNames.push(msgfileuri.fileName);
     }
   }
--- a/mailnews/imap/test/unit/test_dontStatNoSelect.js
+++ b/mailnews/imap/test/unit/test_dontStatNoSelect.js
@@ -1,16 +1,16 @@
 // This file tests that checking folders for new mail with STATUS
 // doesn't try to STAT noselect folders.
 
 var gServer, gImapServer;
 var gIMAPInbox, gIMAPFolder1, gIMAPFolder2;
 var gFolder2Mailbox;
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 const nsIIOService = Cc["@mozilla.org/network/io-service;1"]
                      .getService(Ci.nsIIOService);
 
 function run_test() {
   var daemon = new imapDaemon();
   daemon.createMailbox("folder 1", {subscribed : true});
   let folder1Mailbox = daemon.getMailbox("folder 1");
--- a/mailnews/imap/test/unit/test_downloadOffline.js
+++ b/mailnews/imap/test/unit/test_downloadOffline.js
@@ -4,20 +4,20 @@
  * and returns success.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 const gFileName = "bug460636";
-const gMsgFile = do_get_file("../../mailnews/data/" + gFileName);
+const gMsgFile = do_get_file("../../../data/" + gFileName);
 
 var gDownloadedOnce = false;
 var gIMAPInbox;
 
 function run_test()
 {
   loadLocalMailAccount();
 
--- a/mailnews/imap/test/unit/test_filterNeedsBody.js
+++ b/mailnews/imap/test/unit/test_filterNeedsBody.js
@@ -218,15 +218,15 @@ actionTestOffline =
 
 /*
  * helper functions
  */
 
 // given a test file, return the file uri spec
 function specForFileName(aFileName)
 {
-  let file = do_get_file("../../mailnews/data/" + aFileName);
+  let file = do_get_file("../../../data/" + aFileName);
   let msgfileuri = Cc["@mozilla.org/network/io-service;1"]
                      .getService(Ci.nsIIOService)
                      .newFileURI(file)
                      .QueryInterface(Ci.nsIFileURL);
   return msgfileuri.spec;
 }
--- a/mailnews/imap/test/unit/test_imapAttachmentSaves.js
+++ b/mailnews/imap/test/unit/test_imapAttachmentSaves.js
@@ -35,27 +35,27 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Tests imap save and detach attachments.
  */
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/asyncTestUtils.js");
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/mailTestUtils.js");
+load("../../../resources/asyncTestUtils.js");
+load("../../../resources/messageGenerator.js");
 
 // javascript mime emitter functions
 mimeMsg = {};
 Components.utils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
 
 // IMAP pump
-load("../../mailnews/resources/IMAPpump.js");
+load("../../../resources/IMAPpump.js");
 
 const kAttachFileName = 'bob.txt';
 
 setupIMAPPump();
 
 // Dummy message window so we can say the inbox is open in a window.
 var dummyMsgWindow =
 {
--- a/mailnews/imap/test/unit/test_imapAuthMethods.js
+++ b/mailnews/imap/test/unit/test_imapAuthMethods.js
@@ -7,17 +7,17 @@
  * BUGS:
  * - cleanup after each test doesn't seem to work correctly. Effects:
  *    - one more "lsub" per test, e.g. "capability", "auth...", "lsub", "lsub", "lsub", "list" in the 3. test.,
  *    - root folder check succeeds although login failed
  * - removeIncomingServer(..., true); (cleanup files) fails.
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 //const kUsername = "fred";
 //const kPassword = "wilma";
 
 var acctMgr;
 var thisTest;
 var test = null;
 
--- a/mailnews/imap/test/unit/test_imapAutoSync.js
+++ b/mailnews/imap/test/unit/test_imapAutoSync.js
@@ -97,23 +97,23 @@ var gMockIdleServiceFactory = {
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory]),
 };
 
 Cm.registerFactory(kMockIdleServiceCID, "Mock idle service",
                    IDLE_SERVICE_CONTRACTID, gMockIdleServiceFactory);
 
 // IMAP pump
-load("../../mailnews/resources/IMAPpump.js");
-load("../../mailnews/resources/logHelper.js");
+load("../../../resources/IMAPpump.js");
+load("../../../resources/logHelper.js");
 
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/asyncTestUtils.js");
 
-load("../../mailnews/resources/alertTestUtils.js");
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/alertTestUtils.js");
+load("../../../resources/messageGenerator.js");
 
 // Globals
 
 setupIMAPPump();
 
 const msgFlagOffline = Ci.nsMsgMessageFlags.Offline;
 
 var gGotAlert;
--- a/mailnews/imap/test/unit/test_imapContentLength.js
+++ b/mailnews/imap/test/unit/test_imapContentLength.js
@@ -7,17 +7,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Test content length for the IMAP protocol. This focuses on necko URLs
  * that are run externally.
  */
 
 // Take a multipart message as we're testing attachment URLs as well
-const gFile = do_get_file("../../mailnews/data/multipart-complex2");
+const gFile = do_get_file("../../../data/multipart-complex2");
 var gIMAPDaemon, gIMAPServer, gIMAPIncomingServer, gIMAPInbox;
 const gMFNService = Cc["@mozilla.org/messenger/msgnotificationservice;1"]
                       .getService(Ci.nsIMsgFolderNotificationService);
                    
 // Adds some messages directly to a mailbox (eg new mail)
 function addMessageToServer(file, mailbox)
 {
   let ioService = Cc["@mozilla.org/network/io-service;1"]
--- a/mailnews/imap/test/unit/test_imapCopyTimeout.js
+++ b/mailnews/imap/test/unit/test_imapCopyTimeout.js
@@ -38,24 +38,24 @@
 // This tests our handling of server timeouts during online move of
 // an imap message. The move is done as an offline operation and then
 // played back, to copy what the apps do.
 
 let prefs = Components.classes["@mozilla.org/preferences-service;1"].
                 getService(Components.interfaces.nsIPrefService).getBranch("");
 prefs.setIntPref("mailnews.tcptimeout", 2);
 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/asyncTestUtils.js");
-load("../../mailnews/resources/alertTestUtils.js");
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/mailTestUtils.js");
+load("../../../resources/asyncTestUtils.js");
+load("../../../resources/alertTestUtils.js");
+load("../../../resources/messageGenerator.js");
 
 // IMAP pump
-load("../../mailnews/resources/IMAPpump.js");
+load("../../../resources/IMAPpump.js");
 
 // Globals
 
 setupIMAPPump();
 
 var gGotAlert = false;
 
 var dummyDocShell =
--- a/mailnews/imap/test/unit/test_imapFilterActions.js
+++ b/mailnews/imap/test/unit/test_imapFilterActions.js
@@ -701,17 +701,17 @@ function listMessages(folder) {
     let hdr = enumerator.getNext().QueryInterface(Ci.nsIMsgDBHdr);
     dump(msgCount + ": " + hdr.subject + "\n");
   }
 }
 
 // given a test file, return the file uri spec
 function specForFileName(aFileName)
 {
-  let file = do_get_file("../../mailnews/data/" + aFileName);
+  let file = do_get_file("../../../data/" + aFileName);
   let msgfileuri = Cc["@mozilla.org/network/io-service;1"]
                      .getService(Ci.nsIIOService)
                      .newFileURI(file)
                      .QueryInterface(Ci.nsIFileURL);
   return msgfileuri.spec;
 }
 
 // shorthand for the inbox message summary database
--- a/mailnews/imap/test/unit/test_imapFlagChange.js
+++ b/mailnews/imap/test/unit/test_imapFlagChange.js
@@ -4,17 +4,17 @@
  * are stored in db.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 var gIMAPInbox;
 var gMessage;
 var gTest;
 var gSecondFolder;
 var gSynthMessage;
 
 const gTestArray =
--- a/mailnews/imap/test/unit/test_imapFolderCopy.js
+++ b/mailnews/imap/test/unit/test_imapFolderCopy.js
@@ -1,15 +1,15 @@
 // This file tests the folder copying with IMAP. In particular, we're
 // going to test copying local folders to imap servers, but other tests
 // could be added.
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
 // Globals
 var gRootFolder;
 var gIMAPInbox, gIMAPTrashFolder;
 var gEmptyLocal1, gEmptyLocal2, gEmptyLocal3, gNotEmptyLocal4;
--- a/mailnews/imap/test/unit/test_imapPasswordFailure.js
+++ b/mailnews/imap/test/unit/test_imapPasswordFailure.js
@@ -6,17 +6,17 @@
  *   - Check retry does what it should do.
  *   - Check cancel does what it should do.
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 const kUserName = "user";
 const kInvalidPassword = "imaptest";
 const kValidPassword = "password";
 
 var dummyDocShell =
 {
   getInterface: function (iid) {
@@ -78,17 +78,17 @@ function promptPasswordPS(aParent, aDial
   }
   return false;
 }
 
 function run_test() {
   do_test_pending();
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  let signons = do_get_file("../../mailnews/data/signons-mailnews1.8-imap.txt");
+  let signons = do_get_file("../../../data/signons-mailnews1.8-imap.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   registerAlertTestUtils();
 
   let daemon = new imapDaemon();
   daemon.createMailbox("Subscribed", {subscribed : true});
--- a/mailnews/imap/test/unit/test_imapStoreMsgOffline.js
+++ b/mailnews/imap/test/unit/test_imapStoreMsgOffline.js
@@ -17,21 +17,21 @@ var gIMAPDaemon;
 var gIMAPInbox;
 var gIMAPIncomingServer;
 var gIMAPTrashFolder;
 var gMessenger;
 var gMsgWindow;
 var gRootFolder;
 var gCurTestNum;
 
-var gMsgFile1 = do_get_file("../../mailnews/data/bugmail10");
+var gMsgFile1 = do_get_file("../../../data/bugmail10");
 const gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
-var gMsgFile2 = do_get_file("../../mailnews/data/image-attach-test");
+var gMsgFile2 = do_get_file("../../../data/image-attach-test");
 const gMsgId2 = "4A947F73.5030709@xxx.com";
-var gMsgFile3 = do_get_file("../../mailnews/data/external-attach-test");
+var gMsgFile3 = do_get_file("../../../data/external-attach-test");
 const gMsgId3 = "876TY.5030709@xxx.com";
 
 // We use this as a display consumer
 var streamListener =
 {
   _data: "",
 
   QueryInterface:
--- a/mailnews/imap/test/unit/test_imapUndo.js
+++ b/mailnews/imap/test/unit/test_imapUndo.js
@@ -21,21 +21,21 @@ var gMessages = Cc["@mozilla.org/array;1
 var gCopyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                 .getService(Ci.nsIMsgCopyService);
 var gMessenger;
 var gMsgWindow;
 var gCurTestNum;
 
 Components.utils.import("resource:///modules/iteratorUtils.jsm");
 
-const gMsgFile1 = do_get_file("../../mailnews/data/bugmail10");
-const gMsgFile2 = do_get_file("../../mailnews/data/bugmail11");
-const gMsgFile3 = do_get_file("../../mailnews/data/draft1");
-const gMsgFile4 = do_get_file("../../mailnews/data/bugmail7");
-const gMsgFile5 = do_get_file("../../mailnews/data/bugmail6");
+const gMsgFile1 = do_get_file("../../../data/bugmail10");
+const gMsgFile2 = do_get_file("../../../data/bugmail11");
+const gMsgFile3 = do_get_file("../../../data/draft1");
+const gMsgFile4 = do_get_file("../../../data/bugmail7");
+const gMsgFile5 = do_get_file("../../../data/bugmail6");
 
 // Copied straight from the example files
 const gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
 const gMsgId2 = "200804111417.m3BEHTk4030129@mrapp51.mozilla.org";
 const gMsgId3 = "4849BF7B.2030800@example.com";
 const gMsgId4 = "bugmail7.m47LtAEf007542@mrapp51.mozilla.org";
 const gMsgId5 = "bugmail6.m47LtAEf007542@mrapp51.mozilla.org";
 
--- a/mailnews/imap/test/unit/test_largeOfflineStore.js
+++ b/mailnews/imap/test/unit/test_largeOfflineStore.js
@@ -4,18 +4,18 @@
  * stores, i.e., > 4GB.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/mailTestUtils.js");
+load("../../../resources/messageGenerator.js");
 
 var gDownloadedOnce = false;
 var gIMAPInbox;
 var gOfflineStoreSize;
 
 function run_test()
 {
   loadLocalMailAccount();
--- a/mailnews/imap/test/unit/test_localToImapFilter.js
+++ b/mailnews/imap/test/unit/test_localToImapFilter.js
@@ -2,17 +2,17 @@
  * This file tests copies of multiple messages using filters
  * from incoming POP3, with filter actions copying and moving
  * messages to IMAP folders. This test is adapted from
  * test_imapFolderCopy.js
  *
  * Original author: Kent James <kent@caspia.com>
  */
 
-load("../../mailnews/resources/POP3pump.js");
+load("../../../resources/POP3pump.js");
 Components.utils.import("resource:///modules/folderUtils.jsm");
 Components.utils.import("resource:///modules/iteratorUtils.jsm");
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
@@ -21,18 +21,18 @@ var gRootFolder;
 var gIMAPInbox, gIMAPTrashFolder;
 var gEmptyLocal1, gEmptyLocal2;
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 var gLastKey;
 var gMessages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 var gCopyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                 .getService(Ci.nsIMsgCopyService);
 var gCurTestNum;
-const gFiles = ["../../mailnews/data/bugmail1",
-                "../../mailnews/data/draft1"];
+const gFiles = ["../../../data/bugmail1",
+                "../../../data/draft1"];
 
 const gTestArray =
 [
   function copyFolder1() {
     dump("gEmpty1 " + gEmptyLocal1.URI + "\n");
     let folders = new Array;
     folders.push(gEmptyLocal1.QueryInterface(Ci.nsIMsgFolder));
     let array = toXPCOMArray(folders, Ci.nsIMutableArray);
--- a/mailnews/imap/test/unit/test_localToImapFilterQuarantine.js
+++ b/mailnews/imap/test/unit/test_localToImapFilterQuarantine.js
@@ -37,25 +37,25 @@
 /*
  * This file tests copies of multiple messages using filters
  * from incoming POP3, with filter actions copying and moving
  * messages to an IMAP folder, when the POP3 message uses
  * quarantining to help antivirus software. See bug 387361.
  *
  */
 
-load("../../mailnews/resources/POP3pump.js");
+load("../../../resources/POP3pump.js");
 
 // async support
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/mailTestUtils.js");
+load("../../../resources/asyncTestUtils.js");
 
 // IMAP pump
-load("../../mailnews/resources/IMAPpump.js");
+load("../../../resources/IMAPpump.js");
 
 setupIMAPPump();
 
 // tests
 
 const gTests = [
   createSubfolder,
   getLocalMessages,
@@ -86,17 +86,17 @@ function getLocalMessages() {
   filter.appendTerm(searchTerm);
   let copyAction = filter.createAction();
   copyAction.type = Ci.nsMsgFilterAction.CopyToFolder;
   copyAction.targetFolderUri = gSubfolder.URI;
   filter.appendAction(copyAction);
   filter.enabled = true;
   filterList.insertFilterAt(0, filter);
 
-  gPOP3Pump.files = ["../../mailnews/data/bugmail1"];
+  gPOP3Pump.files = ["../../../data/bugmail1"];
   gPOP3Pump.onDone = function() {dump('POP3Pump done\n');async_driver();};
   gPOP3Pump.run();
   dl('waiting for POP3Pump done');
   yield false;
 }
 
 function updateSubfolderAndTest() {
   gSubfolder.updateFolderWithListener(null, urlListener);
@@ -111,18 +111,18 @@ function updateSubfolderAndTest() {
   listMessages(gSubfolder);
   listMessages(gLocalInboxFolder);
   do_check_eq(folderCount(gSubfolder), 1);
   do_check_eq(folderCount(gLocalInboxFolder), 1);
 }
 
 function get2Messages()
 {
-  gPOP3Pump.files = ["../../mailnews/data/bugmail10",
-                     "../../mailnews/data/draft1"]
+  gPOP3Pump.files = ["../../../data/bugmail10",
+                     "../../../data/draft1"]
   gPOP3Pump.onDone = function() {dump('POP3Pump done\n');async_driver();};
   gPOP3Pump.run();
   dl('waiting for POP3Pump done');
   yield false;
 }
 
 function updateSubfolderAndTest2() {
   gSubfolder.updateFolderWithListener(null, urlListener);
--- a/mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js
+++ b/mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js
@@ -10,27 +10,27 @@
 * Test suite for nsIMsgFolderListener events due to IMAP operations
 *
 * Currently tested
 * - Adding new folders
 * - Copying messages from files to mailboxes
 * - Adding new messages directly to mailboxes
 */
 
-load("../../mailnews/resources/msgFolderListenerSetup.js");
+load("../../../resources/msgFolderListenerSetup.js");
 
 // Globals
 var gRootFolder;
 var gIMAPInbox, gIMAPFolder2, gIMAPFolder3, gIMAPTrashFolder;
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
-const gMsgFile1 = do_get_file("../../mailnews/data/bugmail10");
-const gMsgFile2 = do_get_file("../../mailnews/data/bugmail11");
-const gMsgFile3 = do_get_file("../../mailnews/data/draft1");
-const gMsgFile4 = do_get_file("../../mailnews/data/bugmail7");
-const gMsgFile5 = do_get_file("../../mailnews/data/bugmail6");
+const gMsgFile1 = do_get_file("../../../data/bugmail10");
+const gMsgFile2 = do_get_file("../../../data/bugmail11");
+const gMsgFile3 = do_get_file("../../../data/draft1");
+const gMsgFile4 = do_get_file("../../../data/bugmail7");
+const gMsgFile5 = do_get_file("../../../data/bugmail6");
 
 // Copied straight from the example files
 const gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
 const gMsgId2 = "200804111417.m3BEHTk4030129@mrapp51.mozilla.org";
 const gMsgId3 = "4849BF7B.2030800@example.com";
 const gMsgId4 = "bugmail7.m47LtAEf007542@mrapp51.mozilla.org";
 const gMsgId5 = "bugmail6.m47LtAEf007542@mrapp51.mozilla.org";
 
--- a/mailnews/imap/test/unit/test_offlinePlayback.js
+++ b/mailnews/imap/test/unit/test_offlinePlayback.js
@@ -10,17 +10,17 @@ const gIMAPService = Cc["@mozilla.org/me
                        .getService(Ci.nsIMsgMessageService);
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
 const nsIIOService = Cc["@mozilla.org/network/io-service;1"]
                      .getService(Ci.nsIIOService);
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 var gIMAPInbox;
 var gTest;
 var gSecondFolder, gThirdFolder;
 var gSynthMessage1, gSynthMessage2;
 // the message id of bugmail10
 const gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
 var gOfflineManager;
@@ -56,17 +56,17 @@ const gTestArray =
     headers1.appendElement(msgHdr1, false);
     headers2.appendElement(msgHdr2, false);
     msgHdr1.folder.markMessagesFlagged(headers1, true);
     msgHdr2.folder.markMessagesFlagged(headers2, true);
     copyService.CopyMessages(gIMAPInbox, headers1, gSecondFolder, true, null,
                              null, true);
     copyService.CopyMessages(gIMAPInbox, headers2, gThirdFolder, true, null,
                              null, true);
-    var file = do_get_file("../../mailnews/data/bugmail10");
+    var file = do_get_file("../../../data/bugmail10");
     copyService.CopyFileMessage(file, gIMAPInbox, null, false, 0,
                                 "", CopyListener, null);
   },
   function goOffline() {
     gOfflineManager = Cc["@mozilla.org/messenger/offline-manager;1"]
                            .getService(Ci.nsIMsgOfflineManager);
     gIMAPDaemon.closing = false;
     nsIIOService.offline = false;
--- a/mailnews/imap/test/unit/test_preserveDataOnMove.js
+++ b/mailnews/imap/test/unit/test_preserveDataOnMove.js
@@ -33,22 +33,22 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // This tests that arbitrary message header properties are preserved
 //  during online move of an imap message.
 
 // async support 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/mailTestUtils.js");
+load("../../../resources/asyncTestUtils.js");
 
 // IMAP pump
-load("../../mailnews/resources/IMAPpump.js");
+load("../../../resources/IMAPpump.js");
 
 // Globals
 
 const gMessage = "bugmail10"; // message file used as the test message
 
 setupIMAPPump();
 
 // Definition of tests
@@ -188,17 +188,17 @@ function firstMsgHdr(folder) {
   if (enumerator.hasMoreElements())
     return enumerator.getNext().QueryInterface(Ci.nsIMsgDBHdr);
   return null;
 }
 
 // given a test file, return the file uri spec
 function specForFileName(aFileName)
 {
-  let file = do_get_file("../../mailnews/data/" + aFileName);
+  let file = do_get_file("../../../data/" + aFileName);
   let msgfileuri = Cc["@mozilla.org/network/io-service;1"]
                      .getService(Ci.nsIIOService)
                      .newFileURI(file)
                      .QueryInterface(Ci.nsIFileURL);
   return msgfileuri.spec;
 }
 
 // shorthand output of a line of text
--- a/mailnews/imap/test/unit/test_starttlsFailure.js
+++ b/mailnews/imap/test/unit/test_starttlsFailure.js
@@ -1,17 +1,17 @@
 /**
  * This test checks that we handle the server dropping the connection
  * on starttls. Since fakeserver doesn't support STARTTLS, I've made
  * it drop the connection when it's attempted.
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 var dummyDocShell =
 {
   getInterface: function (iid) {
     if (iid.equals(Ci.nsIAuthPrompt)) {
       return Cc["@mozilla.org/login-manager/prompter;1"]
                .getService(Ci.nsIAuthPrompt);
     }
--- a/mailnews/imap/test/unit/test_syncChanges.js
+++ b/mailnews/imap/test/unit/test_syncChanges.js
@@ -5,17 +5,17 @@
  * an imap folder on the server makes us delete all the headers from our db.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
                        .getService(Ci.nsIMsgMessageService);
 
-load("../../mailnews/resources/messageGenerator.js");
+load("../../../resources/messageGenerator.js");
 
 var gIMAPInbox;
 var gMessage;
 var gTest;
 var gSecondFolder;
 var gSynthMessage;
 
 const gTestArray =
--- a/mailnews/imap/test/unit/test_trustSpamAssassin.js
+++ b/mailnews/imap/test/unit/test_trustSpamAssassin.js
@@ -39,22 +39,22 @@
  *  SpamAssassin headers, and marking that as good
  *  without having the message return to the junk folder,
  *  as discussed in bug 540385.
  *
  * adapted from test_filterNeedsBody.js
  */
 
 // async support 
-load("../../mailnews/resources/logHelper.js");
-load("../../mailnews/resources/mailTestUtils.js");
-load("../../mailnews/resources/asyncTestUtils.js");
+load("../../../resources/logHelper.js");
+load("../../../resources/mailTestUtils.js");
+load("../../../resources/asyncTestUtils.js");
 
 // IMAP pump
-load("../../mailnews/resources/IMAPpump.js");
+load("../../../resources/IMAPpump.js");
 
 // Globals
 const gMessage = "SpamAssassinYes"; // message file used as the test message
 
 setupIMAPPump();
 
 // Definition of tests
 
@@ -229,17 +229,17 @@ mfnListener =
 
 /*
  * helper functions
  */
 
 // given a test file, return the file uri spec
 function specForFileName(aFileName)
 {
-  let file = do_get_file("../../mailnews/data/" + aFileName);
+  let file = do_get_file("../../../data/" + aFileName);
   let msgfileuri = Cc["@mozilla.org/network/io-service;1"]
                      .getService(Ci.nsIIOService)
                      .newFileURI(file)
                      .QueryInterface(Ci.nsIFileURL);
   return msgfileuri.spec;
 }
 
 // quick shorthand for output of a line of text.
--- a/mailnews/import/test/unit/head_import.js
+++ b/mailnews/import/test/unit/head_import.js
@@ -1,8 +1,8 @@
 // Set up the profile directory for verifying the success of imports
-load("../../mailnews/resources/mailDirService.js");
+load("../../../resources/mailDirService.js");
 
 // Import the required setup scripts.
-load("../../mailnews/resources/abSetup.js");
+load("../../../resources/abSetup.js");
 
 // Import the script with basic import functions
 load("resources/import_helper.js");
--- a/mailnews/import/test/unit/resources/AB_README
+++ b/mailnews/import/test/unit/resources/AB_README
@@ -21,19 +21,19 @@ array, as only the supported attributes 
 
 You will also need to give the AbImportHelper constructor two additional
 parameters: the name the imported address book will have (the filename without
 the extension) and the name you chose for the JSON object.
 
 Here is a sample LDIF unit test that doesn't check the results:
 function run_test()
 {
-  var file = do_get_file("../mailnews/import/test/resources/basic_ldif_addressbook.ldif");
+  var file = do_get_file("resources/basic_ldif_addressbook.ldif");
   new AbImportHelper(file, "LDIF").beginImport();
 }
 
 Here is a sample CSV unit test that checks the results:
 function run_test()
 {
-  var file = do_get_file("../mailnews/import/test/resources/basic_csv_addressbook.csv");
+  var file = do_get_file("resources/basic_csv_addressbook.csv");
   new AbImportHelper(file, "CSV", "basic_csv_addressbook",
                      "basic_addressbook").beginImport();
 }
--- a/mailnews/import/test/unit/tail_import.js
+++ b/mailnews/import/test/unit/tail_import.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../resources/mailShutdown.js");
--- a/mailnews/local/test/unit/head_maillocal.js
+++ b/mailnews/local/test/unit/head_maillocal.js
@@ -1,16 +1,18 @@
+gDEPTH = "../../../../";
+
 // Import the main scripts that mailnews tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../resources/mailDirService.js");
+load("../../../resources/mailTestUtils.js");
 
 // Import the pop3 server scripts
-load("../../mailnews/fakeserver/maild.js")
-load("../../mailnews/fakeserver/auth.js")
-load("../../mailnews/fakeserver/pop3d.js")
+load("../../../fakeserver/maild.js")
+load("../../../fakeserver/auth.js")
+load("../../../fakeserver/pop3d.js")
 
 const POP3_PORT = 1024+110;
 
 // Setup the daemon and server
 // If the debugOption is set, then it will be applied to the server.
 function setupServerDaemon(debugOption) {
   var daemon = new pop3Daemon();
   var handler = new POP3_RFC5034_handler(daemon);
--- a/mailnews/local/test/unit/tail_local.js
+++ b/mailnews/local/test/unit/tail_local.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../resources/mailShutdown.js");
--- a/mailnews/local/test/unit/test_fileName.js
+++ b/mailnews/local/test/unit/test_fileName.js
@@ -8,18 +8,18 @@ var server;
 
 function run_test() {
   // Currently, we're only doing a mac-specific test. If we extend
   // this test to include other platforms, we'd need to only do the
   // ':' file name test on the mac.
   if (! ("nsILocalFileMac" in Components.interfaces))
     return;
   // test file with ':' in the name (generated from Mozilla 1.8 branch).
-  let bugmail = do_get_file("../../mailnews/data/bugmail-1");
-  let bugmailmsf = do_get_file("../../mailnews/data/bugmail-1.msf");
+  let bugmail = do_get_file("../../../data/bugmail-1");
+  let bugmailmsf = do_get_file("../../../data/bugmail-1.msf");
   let localMailDir = gProfileDir.clone();
   localMailDir.append("Mail");
   localMailDir.append("Local Folders");
   let pop3dir = gProfileDir.clone();
   pop3dir.append("Mail");
   pop3dir.append("poptest");
   // Copy the file to the local mail directory
   bugmail.copyTo(localMailDir, "bugmail:1");
--- a/mailnews/local/test/unit/test_mailboxContentLength.js
+++ b/mailnews/local/test/unit/test_mailboxContentLength.js
@@ -7,17 +7,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * Test content length for the mailbox protocol. This focuses on necko URLs
  * that are run externally.
  */
 
 // Take a multipart message as we're testing attachment URLs as well
-var gFile = do_get_file("../../mailnews/data/multipart-complex2");
+var gFile = do_get_file("../../../data/multipart-complex2");
 var gMessageKey;
 
 function run_test()
 {
   // Set up local folders
   loadLocalMailAccount();
 
   // Copy a message into the local folder
--- a/mailnews/local/test/unit/test_msgCopy.js
+++ b/mailnews/local/test/unit/test_msgCopy.js
@@ -33,17 +33,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Test of setting keywords with CopyFileMessage
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
-const bugmail11 = do_get_file("../../mailnews/data/bugmail11");
+const bugmail11 = do_get_file("../../../data/bugmail11");
                      
 // main test
 
 var hdrs = [];
 
 // tag used with test messages
 var tag1 = "istag";
 
--- a/mailnews/local/test/unit/test_over2GBMailboxes.js
+++ b/mailnews/local/test/unit/test_over2GBMailboxes.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
 /* Test of accessing over 2GB local folder */
 
-load("../../mailnews/resources/messageGenerator.js");
-const bugmail10 = do_get_file("../../mailnews/data/bugmail10");
+load("../../../resources/messageGenerator.js");
+const bugmail10 = do_get_file("../../../data/bugmail10");
 
 var gLocalTrashFolder;
 var gCopyService;
 
 function run_test()
 {
   loadLocalMailAccount();
 
--- a/mailnews/local/test/unit/test_pop3Password.js
+++ b/mailnews/local/test/unit/test_pop3Password.js
@@ -115,17 +115,17 @@ function run_test() {
     .getService(Components.interfaces.nsIPrefBranch);
 
   prefSvc.setBoolPref("mail.biff.play_sound", false);
   prefSvc.setBoolPref("mail.biff.show_alert", false);
   prefSvc.setBoolPref("mail.biff.show_tray_icon", false);
   prefSvc.setBoolPref("mail.biff.animate_dock_icon", false);
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   // Set up the Server
   var serverArray = setupServerDaemon();
   daemon = serverArray[0];
   server = serverArray[1];
--- a/mailnews/local/test/unit/test_pop3Password2.js
+++ b/mailnews/local/test/unit/test_pop3Password2.js
@@ -144,17 +144,17 @@ function run_test() {
   prefSvc.setCharPref("mail.server.server2.name", "testpop3 on localhost");
   prefSvc.setIntPref("mail.server.server2.port", 1134);
   prefSvc.setCharPref("mail.server.server2.realhostname", "localhost");
   prefSvc.setCharPref("mail.server.server2.realuserName", "testpop3");
   prefSvc.setCharPref("mail.server.server2.type", "pop3");
   prefSvc.setCharPref("mail.server.server2.userName", "othername");
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8-alt.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8-alt.txt");
 
   // Copy the file to the profile directory
   signons.copyTo(gProfileDir, "signons.txt");
 
   // Set up the Server
   var serverArray = setupServerDaemon();
   daemon = serverArray[0];
   server = serverArray[1];
--- a/mailnews/local/test/unit/test_pop3Password3.js
+++ b/mailnews/local/test/unit/test_pop3Password3.js
@@ -10,17 +10,17 @@ const kHostname = "localhost";
 const kServerUrl = "mailbox://" + kHostname;
 
 function run_test()
 {
   // Login Manager
   var loginMgr = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8-multiple.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8-multiple.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   // Set up the basic accounts and folders.
   // We would use createPop3ServerAndLocalFolders() however we want to have
   // a different username and NO password for this test (as we expect to load
   // it from signons.txt).
--- a/mailnews/local/test/unit/test_pop3PasswordFailure.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure.js
@@ -6,17 +6,17 @@
  *   - Check retry does what it should do.
  *   - Check cancel does what it should do.
  *   - Re-initiate connection, this time select enter new password, check that
  *     we get a new password prompt and can enter the password.
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-load("../../mailnews/resources/alertTestUtils.js");
+load("../../../resources/alertTestUtils.js");
 
 var test = null;
 var server;
 var daemon;
 var incomingServer;
 var pop3Service;
 var attempt = 0;
 
@@ -182,17 +182,17 @@ function run_test()
 
   prefSvc.setBoolPref("mail.biff.play_sound", false);
   prefSvc.setBoolPref("mail.biff.show_alert", false);
   prefSvc.setBoolPref("mail.biff.show_tray_icon", false);
   prefSvc.setBoolPref("mail.biff.animate_dock_icon", false);
   prefSvc.setBoolPref("signon.debug", true);
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  let signons = do_get_file("../../mailnews/data/signons-mailnews1.8.txt");
+  let signons = do_get_file("../../../data/signons-mailnews1.8.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   registerAlertTestUtils();
 
   // Set up the Server
   var serverArray = setupServerDaemon();
--- a/mailnews/local/test/unit/test_pop3Pump.js
+++ b/mailnews/local/test/unit/test_pop3Pump.js
@@ -1,26 +1,26 @@
 /**
  * The intent of this file is to demonstrate a minimal
  * POP3 unit test using the testing file POP3Pump.js
  */
-load("../../mailnews/resources/POP3pump.js");
+load("../../../resources/POP3pump.js");
 
 var testSubjects = ["[Bug 397009] A filter will let me tag, but not untag",
                     "Hello, did you receive my bugmail?"];
 
 function run_test()
 {
   // demonstration of access to the local inbox folder
   dump("local inbox folder " + gLocalInboxFolder.URI + " is loaded\n");
   // demonstration of access to the fake server
   dump("Server " + gPOP3Pump.fakeServer.prettyName + " is loaded\n");
 
-  gPOP3Pump.files = ["../../mailnews/data/bugmail1",
-                      "../../mailnews/data/draft1"];
+  gPOP3Pump.files = ["../../../data/bugmail1",
+                      "../../../data/draft1"];
   gPOP3Pump.onDone = continueTest;
   do_test_pending();
   gPOP3Pump.run();
 }
 
 function continueTest()
 {
   // get message headers for the inbox folder
--- a/mailnews/local/test/unit/test_preview.js
+++ b/mailnews/local/test/unit/test_preview.js
@@ -1,10 +1,10 @@
-const bugmail10 = do_get_file("../../mailnews/data/bugmail10");
-const bugmail11 = do_get_file("../../mailnews/data/bugmail11");
+const bugmail10 = do_get_file("../../../data/bugmail10");
+const bugmail11 = do_get_file("../../../data/bugmail11");
 const bugmail10_preview = 'Do not reply to this email. You can add comments to this bug at https://bugzilla.mozilla.org/show_bug.cgi?id=436880 -- Configure bugmail: https://bugzilla.mozilla.org/userprefs.cgi?tab=email ------- You are receiving this mail because: -----';
 const bugmail11_preview = 'Bugzilla has received a request to create a user account using your email address (example@example.org). To confirm that you want to create an account using that email address, visit the following link: https://bugzilla.mozilla.org/token.cgi?t=xxx';
 
 const copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                       .getService(Ci.nsIMsgCopyService);
 
 var hdrs = [];
 
--- a/mailnews/mime/test/unit/head_mime.js
+++ b/mailnews/mime/test/unit/head_mime.js
@@ -1,2 +1,2 @@
 // Import the main scripts that mailnews tests need to set up and tear down
-load("../../mailnews/resources/mailDirService.js");
+load("../../../resources/mailDirService.js");
--- a/mailnews/mime/test/unit/tail_mime.js
+++ b/mailnews/mime/test/unit/tail_mime.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../resources/mailShutdown.js");
--- a/mailnews/mime/test/unit/test_mimeStreaming.js
+++ b/mailnews/mime/test/unit/test_mimeStreaming.js
@@ -34,22 +34,22 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /**
  * This test iterates over the test files in gTestFiles, and streams
  * each as a message and makes sure the streaming doesn't assert or crash.
  */
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../resources/mailTestUtils.js");
 Components.utils.import("resource:///modules/IOUtils.js");
 
 var gTestFiles =[ 
-  "../../mailnews/data/bug505221",
-  "../../mailnews/data/bug513543",
+  "../../../data/bug505221",
+  "../../../data/bug513543",
 ];
 
 var gMsgEnumerator;
 
 var gMessenger = Cc["@mozilla.org/messenger;1"].
                    createInstance(Ci.nsIMessenger);
 
 let gUrlListener = {
--- a/mailnews/news/test/unit/head_server_setup.js
+++ b/mailnews/news/test/unit/head_server_setup.js
@@ -1,14 +1,14 @@
 // Import the servers
-load("../../mailnews/fakeserver/maild.js");
-load("../../mailnews/fakeserver/nntpd.js");
+load("../../../fakeserver/maild.js");
+load("../../../fakeserver/nntpd.js");
 
 // Generic mailnews resource scripts
-load("../../mailnews/resources/mailDirService.js");
+load("../../../resources/mailDirService.js");
 
 const kSimpleNewsArticle =
   "From: John Doe <john.doe@example.com>\n"+
   "Date: Sat, 24 Mar 1990 10:59:24 -0500\n"+
   "Newsgroups: test.subscribe.simple\n"+
   "Subject: H2G2 -- What does it mean?\n"+
   "Message-ID: <TSS1@nntp.test>\n"+
   "\n"+
--- a/mailnews/news/test/unit/tail_news.js
+++ b/mailnews/news/test/unit/tail_news.js
@@ -1,1 +1,1 @@
-load("../../mailnews/resources/mailShutdown.js");
+load("../../../resources/mailShutdown.js");
--- a/mailnews/news/test/unit/test_biff.js
+++ b/mailnews/news/test/unit/test_biff.js
@@ -1,12 +1,12 @@
 // This tests that we can execute biff properly, specifically that filters are
 // run during biff, producing correct counts.
 
-load("../../mailnews/resources/filterTestUtils.js");
+load("../../../resources/filterTestUtils.js");
 
 function run_test() {
   // Set up the server and add in filters
   let daemon = setupNNTPDaemon();
   let localserver = setupLocalServer(NNTP_PORT);
   // Remove all but the test.filter folder
   let rootFolder = localserver.rootFolder;
   let enumerator = rootFolder.subFolders;
--- a/mailnews/news/test/unit/test_filter.js
+++ b/mailnews/news/test/unit/test_filter.js
@@ -13,17 +13,17 @@
 //   - From
 //   - Date
 //   - Size
 //   - Message-ID (header retrievable by XOVER)
 //   - User-Agent (header not retrievable by XHDR)
 // * Test all actions
 ////////////////////////////////////////////////////////////////////////////////
 
-load("../../mailnews/resources/filterTestUtils.js");
+load("../../../resources/filterTestUtils.js");
 
 // These are the expected results for testing filter triggers
 var attribResults = {
   "1@regular.invalid" : ["isRead", false],
   "2@regular.invalid" : ["isRead", true],
   "3@regular.invalid" : ["isRead", true],
   "4@regular.invalid" : ["isRead", true],
   "5@regular.invalid" : ["isRead", true],
--- a/mailnews/news/test/unit/test_nntpPassword.js
+++ b/mailnews/news/test/unit/test_nntpPassword.js
@@ -12,17 +12,17 @@ var daemon = setupNNTPDaemon();
 // Define these up here for checking with the transaction
 var type = null;
 var test = null;
 
 function run_test() {
   type = "RFC 4643";
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   var handler = new NNTP_RFC4643_extension(daemon);
 
   var server = new nsMailServer(handler);
   server.start(NNTP_PORT);
--- a/mailnews/news/test/unit/test_nntpPassword2.js
+++ b/mailnews/news/test/unit/test_nntpPassword2.js
@@ -41,17 +41,17 @@ function run_test() {
   prefSvc.setCharPref("mail.server.server2.name", "testnntp on localhost");
   prefSvc.setIntPref("mail.server.server2.port", NNTP_PORT);
   prefSvc.setCharPref("mail.server.server2.realhostname", "localhost");
   prefSvc.setCharPref("mail.server.server2.type", "nntp");
 
   type = "RFC 4643";
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8-alt.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8-alt.txt");
 
   // Copy the file to the profile directory
   signons.copyTo(gProfileDir, "signons.txt");
 
   var handler = new NNTP_RFC4643_extension(daemon);
 
   var server = new nsMailServer(handler);
   server.start(NNTP_PORT);
--- a/mailnews/news/test/unit/test_nntpPassword3.js
+++ b/mailnews/news/test/unit/test_nntpPassword3.js
@@ -1,28 +1,28 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /**
  * Extra tests for forgetting newsgroup usernames and passwords.
  */
 
-load("../../mailnews/resources/mailTestUtils.js");
+load("../../../resources/mailTestUtils.js");
 
 const kUsername = "testnews";
 const kPassword = "newstest";
 const kProtocol = "nntp";
 const kHostname = "localhost";
 const kServerUrl = "news://" + kHostname;
 
 function run_test()
 {
   // Login Manager
   var loginMgr = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
 
   // Passwords File (generated from Mozilla 1.8 branch).
-  var signons = do_get_file("../../mailnews/data/signons-mailnews1.8.txt");
+  var signons = do_get_file("../../../data/signons-mailnews1.8.txt");
 
   // Copy the file to the profile directory for a PAB
   signons.copyTo(gProfileDir, "signons.txt");
 
   // Set up the basic accounts and folders.
   loadLocalMailAccount();
 
   var acctMgr = Cc["@mozilla.org/messenger/account-manager;1"]
--- a/mailnews/test/resources/IMAPpump.js
+++ b/mailnews/test/resources/IMAPpump.js
@@ -42,24 +42,29 @@
  *  was test_imapFolderCopy.js  There have been several iterations since
  *  then.
  */
 
 // Make sure we execute this file exactly once
 if (typeof gIMAPpump_js__ == "undefined") {
 var gIMAPpump_js__ = true;
 
+// We can be executed from multiple depths
+// Provide understandable error message
+if (typeof gDEPTH == "undefined")
+  do_throw("gDEPTH must be defined when using IMAPpump.js");
+
 // add imap fake server methods if missing
 
 if (typeof gMaild_js__ == "undefined")
-  load("../../mailnews/fakeserver/maild.js");
+  load(gDEPTH + "mailnews/fakeserver/maild.js");
 if (typeof AuthPLAIN == "undefined")
-  load("../../mailnews/fakeserver/auth.js");
+  load(gDEPTH + "mailnews/fakeserver/auth.js");
 if (typeof imapDaemon == "undefined")
-  load("../../mailnews/fakeserver/imapd.js");
+  load(gDEPTH + "mailnews/fakeserver/imapd.js");
 
 // define globals
 var gIMAPDaemon;         // the imap fake server daemon
 var gIMAPServer;         // the imap fake server
 var gIMAPIncomingServer; // nsIMsgIncomingServer for the imap server
 var gIMAPInbox;          // nsIMsgFolder/nsIMsgImapMailFolder for imap inbox
 var gIMAPMailbox;        // imap fake server mailbox
 
--- a/mailnews/test/resources/POP3pump.js
+++ b/mailnews/test/resources/POP3pump.js
@@ -9,24 +9,28 @@
  *  gPOP3Pump.onDone: function to execute after completion
  *  gPOP3Pump.fakeServer:  (out) the POP3 incoming server
  *
  * adapted from test_pop3GetNewMail.js
  *
  * Original Author: Kent James <kent@caspia.com>
  *
  */
+// We can be executed from multiple depths
+// Provide understandable error message
+if (typeof gDEPTH == "undefined")
+  do_throw("gDEPTH must be defined when using IMAPpump.js");
 
 // Import the pop3 server scripts
 if (typeof nsMailServer == 'undefined')
-  load("../../mailnews/fakeserver/maild.js");
+  load(gDEPTH + "mailnews/fakeserver/maild.js");
 if (typeof AuthPLAIN == 'undefined')
-  load("../../mailnews/fakeserver/auth.js")
+  load(gDEPTH + "mailnews/fakeserver/auth.js")
 if (typeof pop3Daemon == 'undefined')
-  load("../../mailnews/fakeserver/pop3d.js");
+  load(gDEPTH + "mailnews/fakeserver/pop3d.js");
 
 function POP3Pump()
 {
   // public attributes
   this.fakeServer = null;
   this.onDone = null;
   this.files = null;
 
--- a/mailnews/test/resources/messageInjection.js
+++ b/mailnews/test/resources/messageInjection.js
@@ -32,16 +32,21 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * 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 ***** */
 
 var gMessageGenerator, gMessageScenarioFactory;
 
+// We can be executed from multiple depths
+// Provide understandable error message
+if (typeof gDEPTH == "undefined")
+  do_throw("gDEPTH must be defined when using messageInjection.js");
+
 /*
  * IMAP port is 1167
  */
 
 /**
  * @param aInjectionConfig.mode One of "local", "pop", "imap".
  * @param [aInjectionConfig.offline] Should the folder be marked offline (and
  *     fully downloaded)?  Only relevant for IMAP.
@@ -68,17 +73,17 @@ function configure_message_injection(aIn
                      .getService(Ci.nsIMsgFolderNotificationService);
 
 
   let acctMgr = Cc["@mozilla.org/messenger/account-manager;1"]
                   .getService(Ci.nsIMsgAccountManager);
 
   if (mis.injectionConfig.mode == "pop") {
     // -- Pull in the POP3 fake-server / local account helper code
-    load("../../test_mailnewslocal/unit/head_maillocal.js");
+    load(gDEPTH + "mailnews/local/test/unit/head_maillocal.js");
     // set up POP3 fakeserver to feed things in...
     [mis.daemon, mis.server] = setupServerDaemon();
     // (this will call loadLocalMailAccount())
     mis.incomingServer = createPop3ServerAndLocalFolders();
 
     // do not log transactions; it's just a memory leak to us
     mis.server._logTransactions = false;
 
@@ -136,17 +141,17 @@ function configure_message_injection(aIn
     //  download.  (Although I'm sure there are various ways we could do it.)
     gPrefs.setBoolPref("mail.server.default.autosync_offline_stores", false);
     // Set the offline property based on the configured setting.  This will
     //  affect newly created folders.
     gPrefs.setBoolPref("mail.server.default.offline_download",
                        mis.injectionConfig.offline);
 
     // Pull in the IMAP fake server code
-    load("../../test_imap/unit/head_server.js");
+    load(gDEPTH + "mailnews/imap/test/unit/head_server.js");
 
     // set up IMAP fakeserver and incoming server
     mis.daemon = new imapDaemon();
     mis.server = makeServer(mis.daemon, "");
     mis.incomingServer = createLocalIMAPServer();
     //mis.server._debug = 3;
 
     // do not log transactions; it's just a memory leak to us
--- a/suite/common/places/tests/unit/head_bookmarks.js
+++ b/suite/common/places/tests/unit/head_bookmarks.js
@@ -40,17 +40,17 @@
 const Ci = Components.interfaces;
 const Cc = Components.classes;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 
 // Import common head.
-let (commonFile = do_get_file("../../toolkit/components/places/tests/head_common.js", false)) {
+let (commonFile = do_get_file("../../../../../toolkit/components/places/tests/head_common.js", false)) {
   let uri = Services.io.newFileURI(commonFile);
   Services.scriptloader.loadSubScript(uri.spec, this);
 }
 
 // Put any other stuff relative to this test folder below.
 
 
 XPCOMUtils.defineLazyGetter(this, "PlacesUIUtils", function() {