Bug 876503 - Cleanup headers of TB mozmill tests - shared-modules. r=mconley
authoraceman <acelists@atlas.sk>
Wed, 17 Jul 2013 11:57:10 -0400
changeset 12769 c88e23a09a07aa3340c5f81945559f46102ec4c8
parent 12768 a333b9c43801605ab79f485a4bbb3c232ed7a907
child 12770 7b8ec6ee5d7081da0ae760d143c356432ad4f6e9
push id9344
push userryanvm@gmail.com
push dateWed, 17 Jul 2013 15:57:34 +0000
treeherdercomm-central@3efb0311a21c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs876503
Bug 876503 - Cleanup headers of TB mozmill tests - shared-modules. r=mconley
mail/test/mozmill/folder-widget/test-message-filters.js
mail/test/mozmill/shared-modules/test-account-manager-helpers.js
mail/test/mozmill/shared-modules/test-address-book-helpers.js
mail/test/mozmill/shared-modules/test-attachment-helpers.js
mail/test/mozmill/shared-modules/test-cloudfile-backend-helpers.js
mail/test/mozmill/shared-modules/test-cloudfile-helpers.js
mail/test/mozmill/shared-modules/test-cloudfile-ubuntuone-helpers.js
mail/test/mozmill/shared-modules/test-cloudfile-yousendit-helpers.js
mail/test/mozmill/shared-modules/test-compose-helpers.js
mail/test/mozmill/shared-modules/test-content-tab-helpers.js
mail/test/mozmill/shared-modules/test-customization-helpers.js
mail/test/mozmill/shared-modules/test-dom-helpers.js
mail/test/mozmill/shared-modules/test-folder-display-helpers.js
mail/test/mozmill/shared-modules/test-junk-helpers.js
mail/test/mozmill/shared-modules/test-keyboard-helpers.js
mail/test/mozmill/shared-modules/test-message-helpers.js
mail/test/mozmill/shared-modules/test-mock-object-helpers.js
mail/test/mozmill/shared-modules/test-mouse-event-helpers.js
mail/test/mozmill/shared-modules/test-newmailaccount-helpers.js
mail/test/mozmill/shared-modules/test-nntp-helpers.js
mail/test/mozmill/shared-modules/test-observer-helpers.js
mail/test/mozmill/shared-modules/test-pref-window-helpers.js
mail/test/mozmill/shared-modules/test-prompt-helpers.js
mail/test/mozmill/shared-modules/test-quick-filter-bar-helper.js
mail/test/mozmill/shared-modules/test-search-window-helpers.js
mail/test/mozmill/shared-modules/test-window-helpers.js
--- a/mail/test/mozmill/folder-widget/test-message-filters.js
+++ b/mail/test/mozmill/folder-widget/test-message-filters.js
@@ -33,24 +33,16 @@ function setupModule(module)
   // Note, the uri is for hostname "invalid" which is the original uri. See
   // setupProtocolTest parameters.
   var prefix = "news://invalid:"+NNTP_PORT+"/";
 
   // Test - group subscribe listing
   test = "news:*";
 }
 
-function assert_equals(a, b, comment)
-{
-  if (!comment)
-    comment = "a != b";
-  if (a != b)
-    throw new Error(comment + ": '"+ a + "' != '" + b + "'.");
-}
-
 /*
  * Test that the message filter list shows newsgroup servers.
  */
 function test_message_filter_shows_newsgroup_server()
 {
   be_in_folder(folderA);
 
   // Open the "Tools » Message Filters…" window,
--- a/mail/test/mozmill/shared-modules/test-account-manager-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-account-manager-helpers.js
@@ -1,31 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "account-manager-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+// we need this for the main controller
+const MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var EventUtils = {};
 Cu.import('resource://mozmill/stdlib/EventUtils.js', EventUtils);
 var utils = {};
 Cu.import('resource://mozmill/modules/utils.js', utils);
 
-const MODULE_NAME = 'account-manager-helpers';
-const RELATIVE_ROOT = '../shared-modules';
-
-// we need this for the main controller
-const MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
-
 var wh, fdh, mc;
 
 function setupModule() {
   fdh = collector.getModule('folder-display-helpers');
   mc = fdh.mc;
   wh = collector.getModule('window-helpers');
 }
 
--- a/mail/test/mozmill/shared-modules/test-address-book-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-address-book-helpers.js
@@ -1,26 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "address-book-helpers";
 
-const MODULE_NAME = "address-book-helpers";
 const RELATIVE_ROOT = "../shared-modules";
-const MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+const MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
+
+Cu.import("resource:///modules/mailServices.js");
+Cu.import("resource:///modules/Services.jsm");
 
 const ABMDB_PREFIX = "moz-abmdbdirectory://";
 const ABLDAP_PREFIX = "moz-abldapdirectory://";
 
-Cu.import("resource:///modules/mailServices.js");
-Cu.import("resource:///modules/Services.jsm");
-
 var collectedAddresses;
 
 var abController;
 
 var folderDisplayHelper;
 var mc;
 var windowHelper;
 
--- a/mail/test/mozmill/shared-modules/test-attachment-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-attachment-helpers.js
@@ -1,19 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "attachment-helpers";
 
-const MODULE_NAME = "attachment-helpers";
 const RELATIVE_ROOT = "../shared-modules";
-const MODULE_REQUIRES = ['mock-object-helpers'];
+const MODULE_REQUIRES = ["mock-object-helpers"];
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 let gMockFilePickReg;
 
 function setupModule(module) {
   let moh = collector.getModule('mock-object-helpers');
--- a/mail/test/mozmill/shared-modules/test-cloudfile-backend-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-cloudfile-backend-helpers.js
@@ -1,50 +1,42 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-let Cu = Components.utils;
-let Cc = Components.classes;
-let Ci = Components.interfaces;
+const MODULE_NAME = "cloudfile-backend-helpers";
 
-const MODULE_NAME = 'cloudfile-backend-helpers';
+const RELATIVE_ROOT = "../shared-modules";
+const MODULE_REQUIRES = ["window-helpers"];
 
-const RELATIVE_ROOT = '../shared-modules';
-const MODULE_REQUIRES = ['folder-display-helpers',
-                         'window-helpers'];
+Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 
 const kUserAuthRequested = "cloudfile:auth";
 const kUserDataRequested = "cloudfile:user";
 const kUploadFile = "cloudfile:uploadFile";
 const kGetFileURL = "cloudfile:getFileURL";
 const kDeleteFile = "cloudfile:deleteFile";
 const kLogout = "cloudfile:logout";
 
-var os = {};
-Cu.import('resource://mozmill/stdlib/os.js', os);
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-
-var fdh, wh;
+var wh;
 
 function installInto(module) {
   setupModule(module);
   module.kUserAuthRequested = kUserAuthRequested;
   module.kUserDataRequested = kUserDataRequested;
   module.kUploadFile = kUploadFile;
   module.kGetFileURL = kGetFileURL;
   module.kDeleteFile = kDeleteFile;
   module.kLogout = kLogout;
   module.SimpleRequestObserverManager = SimpleRequestObserverManager;
   module.SimpleRequestObserver = SimpleRequestObserver;
   module.assert_can_cancel_uploads = assert_can_cancel_uploads;
 }
 
 function setupModule(module) {
-  fdh = collector.getModule('folder-display-helpers');
   wh = collector.getModule('window-helpers');
 }
 
 function SimpleRequestObserverManager() {
   this._observers = [];
 }
 
 SimpleRequestObserverManager.prototype = {
--- a/mail/test/mozmill/shared-modules/test-cloudfile-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-cloudfile-helpers.js
@@ -1,43 +1,39 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
   * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-let Cu = Components.utils;
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-let Cr = Components.results;
+const MODULE_NAME = "cloudfile-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+const MODULE_REQUIRES = ["folder-display-helpers", "mock-object-helpers"];
 
-const MODULE_NAME = 'cloudfile-helpers';
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+var os = {};
+Cu.import('resource://mozmill/stdlib/os.js', os);
 
-const RELATIVE_ROOT = '../shared-modules';
-const MODULE_REQUIRES = ['folder-display-helpers'];
+let Cr = Components.results;
 
 const kMockContractIDPrefix = "@mozilla.org/mail/mockCloudFile;1?id=";
 
 const kDefaults = {
   iconClass: "chrome://messenger/skin/icons/dropbox.png",
   accountKey: null,
   settingsURL: "",
   managementURL: "",
   authErr: Ci.nsIMsgCloudFileProvider.authErr,
   offlineErr: Ci.nsIMsgCloudFileProvider.offlineErr,
   uploadErr: Ci.nsIMsgCloudFileProvider.uploadErr,
   uploadWouldExceedQuota: Ci.nsIMsgCloudFileProvider.uploadWouldExceedQuota,
   uploadExceedsFileLimit: Ci.nsIMsgCloudFileProvider.uploadExceedsFileLimit,
   uploadCanceled: Ci.nsIMsgCloudFileProvider.uploadCanceled,
 };
 
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var os = {};
-Cu.import('resource://mozmill/stdlib/os.js', os);
-
 var fdh, moh;
 
 function setupModule(module) {
   fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
 
   moh = collector.getModule("mock-object-helpers");
   moh.installInto(module);
--- a/mail/test/mozmill/shared-modules/test-cloudfile-ubuntuone-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-cloudfile-ubuntuone-helpers.js
@@ -1,20 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-let Cu = Components.utils;
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-
-const MODULE_NAME = 'cloudfile-ubuntuone-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-const MODULE_REQUIRES = [];
+const MODULE_NAME = "cloudfile-ubuntuone-helpers";
 
 Cu.import('resource://mozmill/stdlib/httpd.js');
 Cu.import('resource://gre/modules/Services.jsm');
 Cu.import('resource:///modules/cloudFileAccounts.js');
 
 const kDefaultServerPort = 4444;
 const kServerRoot = "http://localhost:" + kDefaultServerPort;
 const kServerPath = "/server";
--- a/mail/test/mozmill/shared-modules/test-cloudfile-yousendit-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-cloudfile-yousendit-helpers.js
@@ -1,20 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-let Cu = Components.utils;
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-
-const MODULE_NAME = 'cloudfile-yousendit-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-const MODULE_REQUIRES = [];
+const MODULE_NAME = "cloudfile-yousendit-helpers";
 
 Cu.import('resource://mozmill/stdlib/httpd.js');
 Cu.import('resource://gre/modules/Services.jsm');
 Cu.import('resource:///modules/cloudFileAccounts.js');
 
 const kDefaultServerPort = 4444;
 const kServerRoot = "http://localhost:" + kDefaultServerPort;
 const kServerPath = "";
--- a/mail/test/mozmill/shared-modules/test-compose-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-compose-helpers.js
@@ -1,31 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "compose-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+// we need this for the main controller
+const MODULE_REQUIRES = ["folder-display-helpers",
+                         "window-helpers",
+                         "dom-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var utils = {};
 Cu.import('resource://mozmill/modules/utils.js', utils);
 
-const MODULE_NAME = 'compose-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-
-// we need this for the main controller
-const MODULE_REQUIRES = ['folder-display-helpers',
-                         'window-helpers',
-                         'dom-helpers'];
 const kTextNodeType = 3;
 
 var folderDisplayHelper;
 var mc;
 var windowHelper, domHelper;
 
 function setupModule() {
   folderDisplayHelper = collector.getModule('folder-display-helpers');
--- a/mail/test/mozmill/shared-modules/test-content-tab-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-content-tab-helpers.js
@@ -1,34 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "content-tab-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+// we need this for the main controller
+const MODULE_REQUIRES = ["folder-display-helpers",
+                         "window-helpers",
+                         "mock-object-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var utils = {};
 Cu.import('resource://mozmill/modules/utils.js', utils);
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 
-const MODULE_NAME = 'content-tab-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-
-// we need this for the main controller
-const MODULE_REQUIRES = ['folder-display-helpers',
-                         'window-helpers',
-                         'mock-object-helpers'];
-
 const NORMAL_TIMEOUT = 6000;
 const FAST_TIMEOUT = 1000;
 const FAST_INTERVAL = 100;
 const EXT_PROTOCOL_SVC_CID = "@mozilla.org/uriloader/external-protocol-service;1";
 
 var folderDisplayHelper;
 var mc;
 var wh;
@@ -376,18 +371,17 @@ function get_notification_bar_for_tab(aT
   return notificationBoxEls;
 }
 
 /**
  * Returns the nsIPluginTag for the test plug-in, if it is available.
  * Returns null otherwise.
  */
 function get_test_plugin() {
-  var ph = Components.classes["@mozilla.org/plugin/host;1"]
-           .getService(Components.interfaces.nsIPluginHost);
+  let ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
   var tags = ph.getPluginTags();
 
   // Find the test plugin
   for (var i = 0; i < tags.length; i++) {
     if (tags[i].name == "Test Plug-in")
       return tags[i];
   }
   return null;
--- a/mail/test/mozmill/shared-modules/test-customization-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-customization-helpers.js
@@ -1,27 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+const MODULE_NAME = "customization-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+const MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
+
 Cu.import("resource://gre/modules/Services.jsm");
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var EventUtils = {};
 Cu.import('resource://mozmill/stdlib/EventUtils.js', EventUtils);
 var controller = {};
 Cu.import('resource://mozmill/modules/controller.js', controller);
 
-const MODULE_NAME = 'customization-helpers';
 const USE_SHEET_PREF = "toolbar.customization.usesheet";
 
-const MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
-
 var wh, fdh;
 
 function setupModule() {
   fdh = collector.getModule('folder-display-helpers');
   wh = collector.getModule('window-helpers');
 }
 
 function installInto(module) {
--- a/mail/test/mozmill/shared-modules/test-dom-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-dom-helpers.js
@@ -1,32 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "dom-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+// we need this for the main controller
+const MODULE_REQUIRES = ["folder-display-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var controller = {};
 Cu.import('resource://mozmill/modules/controller.js', controller);
 var utils = {};
 Cu.import('resource://mozmill/modules/utils.js', utils);
 
-const MODULE_NAME = 'dom-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-
-// we need this for the main controller
-const MODULE_REQUIRES = ['folder-display-helpers'];
-
 const NORMAL_TIMEOUT = 6000;
 const FAST_TIMEOUT = 1000;
 const FAST_INTERVAL = 100;
 
 var folderDisplayHelper;
 var mc;
 
 // logHelper (and therefore folderDisplayHelper) exports
--- a/mail/test/mozmill/shared-modules/test-folder-display-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-folder-display-helpers.js
@@ -1,15 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "folder-display-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+// we need window-helpers for augment_controller
+const MODULE_REQUIRES = ["window-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var EventUtils = {};
 Cu.import('resource://mozmill/stdlib/EventUtils.js', EventUtils);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var controller = {};
@@ -18,22 +20,16 @@ var frame = {};
 Cu.import('resource://mozmill/modules/frame.js', frame);
 var os = {};
 Cu.import('resource://mozmill/stdlib/os.js', os);
 var utils = {};
 Cu.import('resource://mozmill/modules/utils.js', utils);
 
 Cu.import("resource:///modules/gloda/log4moz.js");
 
-const MODULE_NAME = 'folder-display-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-// we need window-helpers for augment_controller
-const MODULE_REQUIRES = ['window-helpers'];
-
 const nsMsgViewIndex_None = 0xffffffff;
 Cu.import('resource:///modules/MailConsts.js');
 Cu.import("resource:///modules/mailServices.js");
 Cu.import('resource:///modules/MailUtils.js');
 Cu.import('resource:///modules/mailViewManager.js');
 Cu.import("resource://gre/modules/Services.jsm");
 
 const FILE_LOAD_PATHS = [
@@ -47,18 +43,16 @@ const FILE_LOAD_PATHS = [
  * List of keys not to export via installInto; values do not matter, we just
  *  use true.
  */
 const DO_NOT_EXPORT = {
   // magic globals
   MODULE_NAME: true, DO_NOT_EXPORT: true, installInto: true,
   // imported modules
   elib: true, mozmill: true, controller: true, frame: true, os: true,
-  // convenience constants
-  Ci: true, Cc: true, Cu: true, Cr: true,
   // useful constants (we do export MailViewConstants)
   nsMsgViewIndex_None: true, MailConsts: true,
   // utility functions
   MailUtils: true, MailViewManager: true,
   // internal setup functions
   setupModule: true, setupAccountStuff: true,
   // we export this separately
   teardownImporter: true,
@@ -643,17 +637,17 @@ function display_message_in_folder_tab(a
  *
  * @param file an nsIFile for the message
  * @return The MozmillController-wrapped new window.
  */
 function open_message_from_file(file) {
   mark_action("fdh", "open_message_from_file", ["file", file.nativePath]);
 
   let fileURL = Services.io.newFileURI(file)
-                        .QueryInterface(Components.interfaces.nsIFileURL);
+                        .QueryInterface(Ci.nsIFileURL);
   fileURL.query = "type=application/x-message-display";
 
   windowHelper.plan_for_new_window("mail:messageWindow");
   mc.window.openDialog("chrome://messenger/content/messageWindow.xul", "_blank",
                        "all,chrome,dialog=no,status,toolbar", fileURL);
   let msgc = windowHelper.wait_for_new_window("mail:messageWindow");
   wait_for_message_display_completion(msgc, true);
 
@@ -1578,17 +1572,17 @@ function wait_for_message_display_comple
     if (aLoadDemanded && !aController.messageDisplay.messageLoaded)
       return false;
 
     let docShell = contentPane.docShell;
     if (!docShell)
       return false;
     let uri = docShell.currentURI;
     // the URL will tell us if it is running, saves us from potential error
-    if (uri && (uri instanceof Components.interfaces.nsIMsgMailNewsUrl)) {
+    if (uri && (uri instanceof Ci.nsIMsgMailNewsUrl)) {
       let urlRunningObj = {};
       uri.GetUrlState(urlRunningObj);
       // GetUrlState returns true if the url is still running
       return !urlRunningObj.value;
     }
     // not a mailnews URL, just check the busy flags...
     return !docShell.busyFlags;
   };
--- a/mail/test/mozmill/shared-modules/test-junk-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-junk-helpers.js
@@ -1,30 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "junk-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+// we need this for the main controller
+const MODULE_REQUIRES = ["folder-display-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var utils = {};
 Cu.import("resource://mozmill/modules/utils.js", utils);
 
-const MODULE_NAME = 'junk-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-
-// we need this for the main controller
-const MODULE_REQUIRES = ['folder-display-helpers'];
-
 var folderDisplayHelper;
 var mc;
 
 // logHelper (and therefore folderDisplayHelper) exports
 var mark_failure;
 
 function setupModule() {
   folderDisplayHelper = collector.getModule('folder-display-helpers');
--- a/mail/test/mozmill/shared-modules/test-keyboard-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-keyboard-helpers.js
@@ -1,28 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "keyboard-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+// we need this for the main controller
+const MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 
-const MODULE_NAME = 'keyboard-helpers';
-const RELATIVE_ROOT = '../shared-modules';
-
-// we need this for the main controller
-const MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
-                         'keyboard-helpers'];
-
 var wh, fdh, mc;
 
 function setupModule() {
   fdh = collector.getModule('folder-display-helpers');
   mc = fdh.mc;
   wh = collector.getModule('window-helpers');
 }
 
--- a/mail/test/mozmill/shared-modules/test-message-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-message-helpers.js
@@ -1,38 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Helpers to deal with message (nsIMsgDBHdr) parsing.
  */
-var MODULE_NAME = 'message-helpers';
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "message-helpers";
 
 var frame = {};
 Cu.import('resource://mozmill/modules/frame.js', frame);
 var utils = {};
 Cu.import('resource://mozmill/modules/utils.js', utils);
 
 Cu.import("resource://app/modules/gloda/mimemsg.js");
 
-// we need this for the main controller
-const MODULE_REQUIRES = ['folder-display-helpers'];
-
-function setupModule() {
-  // do nothing
-}
-
 function installInto(module) {
-  setupModule();
-
   module.to_mime_message = to_mime_message;
 }
 
 /**
  * Given a message header, converts it to a MimeMessage. If aCallback throws,
  * the test will be marked failed. See the documentation for MsgHdrToMimeMessage
  * for more details.
  */
--- a/mail/test/mozmill/shared-modules/test-mock-object-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-mock-object-helpers.js
@@ -1,18 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
   * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-const MODULE_NAME = 'mock-object-helpers';
-const RELATIVE_ROOT = '../shared-modules';
-const MODULE_REQUIRES = [];
+const MODULE_NAME = "mock-object-helpers";
 
 let Cm = Components.manager;
-let Ci = Components.interfaces;
 
 function installInto(module) {
   module.MockObjectReplacer = MockObjectReplacer;
   module.MockObjectRegisterer = MockObjectRegisterer;
 }
 
 function MockObjectRegisterer(aContractID, aCID, aComponent) {
   this._contractID = aContractID;
@@ -35,20 +32,18 @@ MockObjectRegisterer.prototype = {
 
    componentRegistrar.registerFactory(this._cid,
         "",
         this._contractID,
         this._mockFactory);
   },
 
   unregister: function MOR_unregister() {
-
     let componentRegistrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
 
- 
     componentRegistrar.unregisterFactory(this._cid,
         this._mockFactory);
   },
 }
 
 /**
  * Allows registering a mock XPCOM component, that temporarily replaces the
  *  original one when an object implementing a given ContractID is requested
@@ -135,28 +130,25 @@ MockObjectReplacer.prototype = {
    */
   _mockFactory: null
 }
 
 /**
  * Swiped from mozilla/testing/mochitest/tests/SimpleTest/specialpowersAPI.js
  */
 function swapFactoryRegistration(cid, contractID, newFactory, oldFactory) {
-  var componentRegistrar = Components
-                           .manager
-                           .QueryInterface(Components.interfaces.nsIComponentRegistrar);
+  let componentRegistrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
 
   var unregisterFactory = newFactory;
   var registerFactory = oldFactory;
 
   if (cid == null) {
     if (contractID != null) {
       cid = componentRegistrar.contractIDToCID(contractID);
-      oldFactory = Components.manager.getClassObject(Components.classes[contractID],
-          Components.interfaces.nsIFactory);
+      oldFactory = Cm.getClassObject(Cc[contractID], Ci.nsIFactory);
     } else {
       return {'error': "trying to register a new contract ID: Missing contractID"};
     }
 
     unregisterFactory = oldFactory;
     registerFactory = newFactory;
   }
 
--- a/mail/test/mozmill/shared-modules/test-mouse-event-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-mouse-event-helpers.js
@@ -1,26 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "mouse-event-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+const MODULE_REQUIRES = ["folder-display-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var EventUtils = {};
 Cu.import('resource://mozmill/stdlib/EventUtils.js', EventUtils);
 
-const MODULE_NAME = 'mouse-event-helpers';
-const MODULE_REQUIRES = ['folder-display-helpers'];
-
 var fdh;
 
 function setupModule() {
   fdh = collector.getModule('folder-display-helpers');
 }
 
 function installInto(module) {
   setupModule();
--- a/mail/test/mozmill/shared-modules/test-newmailaccount-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-newmailaccount-helpers.js
@@ -1,29 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
-
 const MODULE_NAME = "newmailaccount-helpers";
 const RELATIVE_ROOT = "../shared-modules";
-const MODULE_REQUIRES = ['folder-display-helpers'];
+const MODULE_REQUIRES = ["folder-display-helpers"];
 
 var elib = {};
-var mc, fdh, kbh;
-
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 Cu.import('resource://gre/modules/Services.jsm');
 Cu.import('resource:///modules/iteratorUtils.jsm');
 Cu.import('resource:///modules/mailServices.js');
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 
+var mc, fdh, kbh;
+
 function setupModule(module) {
   fdh = collector.getModule('folder-display-helpers');
   fdh.installInto(module);
   kbh = collector.getModule('keyboard-helpers');
   mc = fdh.mc;
 }
 
 function installInto(module) {
--- a/mail/test/mozmill/shared-modules/test-nntp-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-nntp-helpers.js
@@ -1,30 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "nntp-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+const MODULES_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource:///modules/mailServices.js");
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 
-const MODULE_NAME = 'nntp-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-
-const MODULES_REQUIRES = ['folder-display-helpers', 'window-helpers'];
-
 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.invalid>\n"+
   "\n"+
   "What does the acronym H2G2 stand for? I've seen it before...\n";
--- a/mail/test/mozmill/shared-modules/test-observer-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-observer-helpers.js
@@ -1,16 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const MODULE_NAME = "observer-helpers";
 
-const RELATIVE_ROOT = "../shared-modules";
-
 function installInto(module) {
   module.ObservationRecorder = ObservationRecorder;
 }
 
 /**
  * ObservationRecorder observes events, and records its observations for
  * later analysis.
  */
--- a/mail/test/mozmill/shared-modules/test-pref-window-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-pref-window-helpers.js
@@ -2,29 +2,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Helpers to deal with the preferences window.
  */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "pref-window-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+const MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var utils = {};
 Cu.import("resource://mozmill/modules/utils.js", utils);
 
-const MODULE_NAME = "pref-window-helpers";
-
-const RELATIVE_ROOT = "../shared-modules";
-
-const MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
-
 var fdh;
 var wh;
 
 function setupModule() {
   fdh = collector.getModule("folder-display-helpers");
   wh = collector.getModule("window-helpers");
 }
 
--- a/mail/test/mozmill/shared-modules/test-prompt-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-prompt-helpers.js
@@ -1,25 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "prompt-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+// we need this for the main controller
+const MODULE_REQUIRES = ["mock-object-helpers"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
-const MODULE_NAME = 'prompt-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-
-// we need this for the main controller
-const MODULE_REQUIRES = ['mock-object-helpers'];
 const kMockPromptServiceName = "Mock Prompt Service";
 const kPromptServiceContractID = "@mozilla.org/embedcomp/prompt-service;1";
 const kPromptServiceName = "Prompt Service";
 
 let gMockAuthPromptReg;
 
 function setupModule() {
   let moh = collector.getModule('mock-object-helpers');
@@ -241,10 +237,8 @@ var gMockPromptServiceFactory = {
       throw Cr.NS_ERROR_NO_AGGREGATION;
 
     if (!aIID.equals(Ci.nsIPromptService))
       throw Cr.NS_ERROR_NO_INTERFACE;
 
     return gMockPromptService;
   }
 };
-
-
--- a/mail/test/mozmill/shared-modules/test-quick-filter-bar-helper.js
+++ b/mail/test/mozmill/shared-modules/test-quick-filter-bar-helper.js
@@ -1,17 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var MODULE_NAME = 'quick-filter-bar-helper';
+const MODULE_NAME = "quick-filter-bar-helper";
 
-const RELATIVE_ROOT = '../shared-modules';
-
-var MODULE_REQUIRES = ['folder-display-helpers'];
+const RELATIVE_ROOT = "../shared-modules";
+const MODULE_REQUIRES = ["folder-display-helpers"];
 
 var initialized = false;
 function setupModule(module) {
   if (initialized)
     return;
 
   let fdh = collector.getModule('folder-display-helpers');
   fdh.installInto(module);
--- a/mail/test/mozmill/shared-modules/test-search-window-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-search-window-helpers.js
@@ -1,27 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "search-window-helpers";
+
+const RELATIVE_ROOT = "../shared-modules";
+const MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 
-const MODULE_NAME = 'search-window-helpers';
-
-const RELATIVE_ROOT = '../shared-modules';
-
-const MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
-
 var folderDisplayHelper;
 var mc;
 var windowHelper;
 
 function setupModule() {
   folderDisplayHelper = collector.getModule('folder-display-helpers');
   mc = folderDisplayHelper.mc;
   windowHelper = collector.getModule('window-helpers');
--- a/mail/test/mozmill/shared-modules/test-window-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-window-helpers.js
@@ -1,33 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
+const MODULE_NAME = "window-helpers";
+
+Cu.import('resource:///modules/iteratorUtils.jsm');
+Cu.import('resource://gre/modules/NetUtil.jsm');
+Cu.import("resource://gre/modules/Services.jsm");
 
 var mozmill = {};
 Cu.import('resource://mozmill/modules/mozmill.js', mozmill);
 var controller = {};
 Cu.import('resource://mozmill/modules/controller.js', controller);
 var elib = {};
 Cu.import('resource://mozmill/modules/elementslib.js', elib);
 var frame = {};
 Cu.import('resource://mozmill/modules/frame.js', frame);
 var utils = {};
 Cu.import('resource://mozmill/modules/utils.js', utils);
 
-Cu.import('resource:///modules/iteratorUtils.jsm');
-Cu.import('resource://gre/modules/NetUtil.jsm');
-Cu.import("resource://gre/modules/Services.jsm");
-
-const MODULE_NAME = 'window-helpers';
-
 /**
  * Timeout to use when waiting for the first window ever to load.  This is
  *  long because we are basically waiting for the entire app startup process.
  */
 const FIRST_WINDOW_EVER_TIMEOUT_MS = 30000;
 /**
  * Interval to check if the window has shown up for the first window ever to
  *  load.  The check interval is longer because it's less likely the window
@@ -71,20 +67,16 @@ var normalize_for_json = function dummy_
  */
 function hereIsMarkAction(mark_action_impl, mark_failure_impl,
                           normalize_for_json_impl) {
   mark_action = mark_action_impl;
   mark_failure = mark_failure_impl;
   normalize_for_json = normalize_for_json_impl;
 }
 
-function setupModule() {
-  // do nothing
-}
-
 function installInto(module) {
   module.plan_for_new_window = plan_for_new_window;
   module.wait_for_new_window = wait_for_new_window;
   module.plan_for_modal_dialog = plan_for_modal_dialog;
   module.wait_for_modal_dialog = wait_for_modal_dialog;
   module.plan_for_window_close = plan_for_window_close;
   module.wait_for_window_close = wait_for_window_close;
   module.close_window = close_window;