Bug 728521. (Av1) Remove unused 'gIMAPService' const/var, Remove some duplicated vars. r=mbanner.
authorSerge Gautherie <sgautherie.bz@free.fr>
Tue, 21 Feb 2012 18:38:23 +0100
changeset 10897 c1a6a7f125833108f9a6d2a4fb970820c037fd2c
parent 10896 1882581fa8584d2a429eb26f76a542b634a71f4a
child 10898 19442a39d042eea3789839a1478b73196a8ff9ca
push id463
push userbugzilla@standard8.plus.com
push dateTue, 24 Apr 2012 17:34:51 +0000
treeherdercomm-beta@e53588e8f7b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbanner
bugs728521
Bug 728521. (Av1) Remove unused 'gIMAPService' const/var, Remove some duplicated vars. r=mbanner.
mailnews/base/test/unit/test_searchChaining.js
mailnews/imap/test/unit/test_autosync_date_constraints.js
mailnews/imap/test/unit/test_bccProperty.js
mailnews/imap/test/unit/test_compactOfflineStore.js
mailnews/imap/test/unit/test_copyThenMove.js
mailnews/imap/test/unit/test_downloadOffline.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_imapHdrStreaming.js
mailnews/imap/test/unit/test_imapID.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_offlinePlayback.js
mailnews/imap/test/unit/test_offlineStoreLocking.js
mailnews/imap/test/unit/test_syncChanges.js
--- a/mailnews/base/test/unit/test_searchChaining.js
+++ b/mailnews/base/test/unit/test_searchChaining.js
@@ -38,22 +38,16 @@
 //  Bug 541969 made us not search an imap folder if the search scope before it
 // there was an empty local folder.
 
 // main test
 
 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("../../../imap/test/unit/head_server.js");
 
   loadLocalMailAccount();
--- a/mailnews/imap/test/unit/test_autosync_date_constraints.js
+++ b/mailnews/imap/test/unit/test_autosync_date_constraints.js
@@ -1,21 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test autosync date constraints
  */
 
-var gIMAPDaemon, gServer, gIMAPIncomingServer;
-
 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;
 var gImapInboxOfflineStoreSize;
 var gCurTestNum;
 
 // Adds some messages directly to a mailbox (eg new mail)
 function addMessagesToServer(messages, mailbox, localFolder)
--- a/mailnews/imap/test/unit/test_bccProperty.js
+++ b/mailnews/imap/test/unit/test_bccProperty.js
@@ -4,19 +4,16 @@
  *
  * adapted from test_downloadOffline.js
  *
  * original author Kent James <kent@caspia.com>
  */
 
 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("../../../data/" + gFileName);
 
 var gDownloadedOnce = false;
 var gIMAPInbox;
 
 function run_test()
 {
--- a/mailnews/imap/test/unit/test_compactOfflineStore.js
+++ b/mailnews/imap/test/unit/test_compactOfflineStore.js
@@ -2,21 +2,16 @@
 /*
  * Test to ensure that compacting offline stores works correctly with imap folders
  * and returns success.
  */
 
 Services.prefs.setCharPref("mail.serverDefaultStoreContractID",
                            "@mozilla.org/msgstore/berkeleystore;1");
 
-var gIMAPDaemon, gServer, gIMAPIncomingServer;
-
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
-
 load("../../../resources/messageGenerator.js");
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 load("../../../resources/alertTestUtils.js");
 
 // Globals
 var gRootFolder;
--- a/mailnews/imap/test/unit/test_copyThenMove.js
+++ b/mailnews/imap/test/unit/test_copyThenMove.js
@@ -1,20 +1,14 @@
 // This file extends test_imapFolderCopy.js to test message
 // moves from a local folder to an IMAP folder.
 //
 // Original Author: Kent James <kent@caspia.com>
 
 
-var gIMAPDaemon, gServer, gIMAPIncomingServer;
-
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
-
-// Globals
 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);
--- a/mailnews/imap/test/unit/test_downloadOffline.js
+++ b/mailnews/imap/test/unit/test_downloadOffline.js
@@ -1,19 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test to ensure that downloadAllForOffline works correctly with imap folders
  * and returns success.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
-
 load("../../../resources/messageGenerator.js");
 
 const gFileName = "bug460636";
 const gMsgFile = do_get_file("../../../data/" + gFileName);
 
 var gDownloadedOnce = false;
 var gIMAPInbox;
 
--- a/mailnews/imap/test/unit/test_imapFilterActions.js
+++ b/mailnews/imap/test/unit/test_imapFilterActions.js
@@ -49,18 +49,16 @@ const gMessageSubject = "Hello, did you 
 // a string in the body of the test message
 const gMessageInBody = "an HTML message";
 
 // various object references
 const gCopyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                        .getService(Ci.nsIMsgCopyService);
 const gDbService = Components.classes["@mozilla.org/msgDatabase/msgDBService;1"]
                              .getService(Components.interfaces.nsIMsgDBService);
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
 const gMailSession = Cc["@mozilla.org/messenger/services/session;1"]
                      .getService(Ci.nsIMsgMailSession);
 const kFiltersAppliedAtom = Cc["@mozilla.org/atom-service;1"]
                               .getService(Ci.nsIAtomService)
                               .getAtom("FiltersApplied");
 const kDeleteOrMoveMsgCompleted = Cc["@mozilla.org/atom-service;1"]
                                     .getService(Ci.nsIAtomService)
                                     .getAtom("DeleteOrMoveMsgCompleted");
--- a/mailnews/imap/test/unit/test_imapFlagChange.js
+++ b/mailnews/imap/test/unit/test_imapFlagChange.js
@@ -1,19 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test to ensure that imap flag changes made from a different profile/machine
  * are stored in db.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
-
 load("../../../resources/messageGenerator.js");
 
 var gIMAPInbox;
 var gMessage;
 var gTest;
 var gSecondFolder;
 var gSynthMessage;
 
--- a/mailnews/imap/test/unit/test_imapFolderCopy.js
+++ b/mailnews/imap/test/unit/test_imapFolderCopy.js
@@ -1,20 +1,14 @@
 // 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("../../../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;
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 var gCopyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                 .getService(Ci.nsIMsgCopyService);
 var gCurTestNum;
 
--- a/mailnews/imap/test/unit/test_imapHdrStreaming.js
+++ b/mailnews/imap/test/unit/test_imapHdrStreaming.js
@@ -80,18 +80,16 @@ function run_test() {
   // Add a couple of messages to the INBOX
   // this is synchronous, afaik
   addMessagesToServer([{file: gMsgFile1, messageId: gMsgId1}],
                         gIMAPDaemon.getMailbox("INBOX"));
   Services.prefs.setBoolPref("mail.server.server1.autosync_offline_stores", false);
   async_run_tests(tests);
  }
 
-var gIMAPService;
-
 var tests = [
   test_updateFolder,
   test_downloadForOffline,
   test_streamHeaders,
   endTest
 ]
 
 function test_updateFolder() {
--- a/mailnews/imap/test/unit/test_imapID.js
+++ b/mailnews/imap/test/unit/test_imapID.js
@@ -2,19 +2,16 @@
 /*
  * Test to ensure that we handle the RFC2197 ID command.
  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
-
 const kIDResponse = "(\"name\" \"GImap\" \"vendor\" \"Google, Inc.\" \"support-url\" \"http://mail.google.com/support\")";
 var gIMAPInbox;
 var gTest;
 
 const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
 const XULAPPINFO_CID = Components.ID("{7e10a36e-1085-4302-9e3f-9571fc003ee0}");
 
 var gAppInfo = null;
--- a/mailnews/imap/test/unit/test_imapUndo.js
+++ b/mailnews/imap/test/unit/test_imapUndo.js
@@ -2,22 +2,16 @@
 // There are three main cases:
 // 1. Normal undo
 // 2. Undo after the source folder has been compacted.
 // 2.1 Same, but the server doesn't support COPYUID (GMail case)
 //
 // Original Author: David Bienvenu <bienvenu@nventure.com>
 
 
-var gIMAPDaemon, gServer, gIMAPIncomingServer;
-
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
-
-// Globals
 var gRootFolder;
 var gIMAPInbox, gIMAPTrashFolder;
 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 gMessenger;
--- a/mailnews/imap/test/unit/test_largeOfflineStore.js
+++ b/mailnews/imap/test/unit/test_largeOfflineStore.js
@@ -4,19 +4,16 @@
  * stores, i.e., > 4GB.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
 Services.prefs.setCharPref("mail.serverDefaultStoreContractID",
                            "@mozilla.org/msgstore/berkeleystore;1");
 
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
-
 load("../../../resources/mailTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
 var gDownloadedOnce = false;
 var gIMAPInbox;
 var gOfflineStoreSize;
 
 function run_test()
--- a/mailnews/imap/test/unit/test_localToImapFilter.js
+++ b/mailnews/imap/test/unit/test_localToImapFilter.js
@@ -6,22 +6,16 @@
  *
  * Original author: Kent James <kent@caspia.com>
  */
 
 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);
-
-// Globals
 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);
--- a/mailnews/imap/test/unit/test_offlinePlayback.js
+++ b/mailnews/imap/test/unit/test_offlinePlayback.js
@@ -1,19 +1,16 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test to ensure that changes made while offline are played back when we
  * go back online.
  */
 
 var gIMAPDaemon, gServer, gIMAPIncomingServer;
 
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .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("../../../resources/messageGenerator.js");
 
--- a/mailnews/imap/test/unit/test_offlineStoreLocking.js
+++ b/mailnews/imap/test/unit/test_offlineStoreLocking.js
@@ -1,19 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test to ensure that code that writes to the imap offline store deals
  * with offline store locking correctly.
  */
 
-var gIMAPDaemon, gServer, gIMAPIncomingServer;
-
-const gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                       .getService(Ci.nsIMsgMessageService);
-
 const nsIIOService = Cc["@mozilla.org/network/io-service;1"]
                        .getService(Ci.nsIIOService);
 
 load("../../../resources/messageGenerator.js");
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 load("../../../resources/alertTestUtils.js");
--- a/mailnews/imap/test/unit/test_syncChanges.js
+++ b/mailnews/imap/test/unit/test_syncChanges.js
@@ -2,19 +2,16 @@
 /*
  * Test to ensure that changes made from a different profile/machine
  * are synced correctly. In particular, we're checking that emptying out
  * 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("../../../resources/messageGenerator.js");
 
 var gIMAPInbox;
 var gMessage;
 var gTest;
 var gSecondFolder;
 var gSynthMessage;