Bug 1550674 - Turn on ESLint in mail/test/mozmill; r=aceman
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 20 May 2019 17:41:23 +1200
changeset 34557 0ff27072766a335dc5aa53b746e168845fbf5089
parent 34556 67542c5ca9f20d811e9683a5fa2390ab30828f9d
child 34558 b800b4a19b7f83c14800bbdb8471975be80a0aed
push id2407
push userclokep@gmail.com
push dateMon, 20 May 2019 17:11:26 +0000
treeherdercomm-beta@193428fd6fd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1550674
Bug 1550674 - Turn on ESLint in mail/test/mozmill; r=aceman
.eslintignore
mail/test/mozmill/.eslintrc.js
mail/test/mozmill/account/test-ab-whitelist.js
mail/test/mozmill/account/test-account-actions.js
mail/test/mozmill/account/test-account-deletion.js
mail/test/mozmill/account/test-account-port-setting.js
mail/test/mozmill/account/test-account-settings-infrastructure.js
mail/test/mozmill/account/test-account-tree.js
mail/test/mozmill/account/test-account-values.js
mail/test/mozmill/account/test-archive-options.js
mail/test/mozmill/account/test-mail-account-setup-wizard.js
mail/test/mozmill/account/test-retest-config.js
mail/test/mozmill/addrbook/test-address-book-panes.js
mail/test/mozmill/addrbook/test-address-book.js
mail/test/mozmill/addrbook/test-update-mailing-list.js
mail/test/mozmill/attachment/test-attachment-events.js
mail/test/mozmill/attachment/test-attachment-in-plain-msg.js
mail/test/mozmill/attachment/test-attachment-menus.js
mail/test/mozmill/attachment/test-attachment-size.js
mail/test/mozmill/attachment/test-attachment.js
mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js
mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
mail/test/mozmill/cloudfile/test-cloudfile-manager.js
mail/test/mozmill/cloudfile/test-cloudfile-notifications.js
mail/test/mozmill/composition/test-address-widgets.js
mail/test/mozmill/composition/test-attachment-reminder.js
mail/test/mozmill/composition/test-attachment.js
mail/test/mozmill/composition/test-base64-display.js
mail/test/mozmill/composition/test-blocked-content.js
mail/test/mozmill/composition/test-charset-edit.js
mail/test/mozmill/composition/test-charset-upgrade.js
mail/test/mozmill/composition/test-cp932-display.js
mail/test/mozmill/composition/test-draft-identity.js
mail/test/mozmill/composition/test-drafts.js
mail/test/mozmill/composition/test-eml-actions.js
mail/test/mozmill/composition/test-focus.js
mail/test/mozmill/composition/test-forward-headers.js
mail/test/mozmill/composition/test-forward-rfc822-attach.js
mail/test/mozmill/composition/test-forward-utf8.js
mail/test/mozmill/composition/test-forwarded-content.js
mail/test/mozmill/composition/test-forwarded-eml-actions.js
mail/test/mozmill/composition/test-image-display.js
mail/test/mozmill/composition/test-image-insertion-dialog.js
mail/test/mozmill/composition/test-multipart-related.js
mail/test/mozmill/composition/test-newmsg-compose-identity.js
mail/test/mozmill/composition/test-reply-addresses.js
mail/test/mozmill/composition/test-reply-format-flowed.js
mail/test/mozmill/composition/test-reply-multipart-charset.js
mail/test/mozmill/composition/test-reply-signature.js
mail/test/mozmill/composition/test-save-changes-on-quit.js
mail/test/mozmill/composition/test-send-button.js
mail/test/mozmill/composition/test-send-format.js
mail/test/mozmill/composition/test-signature-init.js
mail/test/mozmill/composition/test-signature-updating.js
mail/test/mozmill/content-policy/test-compose-mailto.js
mail/test/mozmill/content-policy/test-dns-prefetch.js
mail/test/mozmill/content-policy/test-exposed-in-content-tabs.js
mail/test/mozmill/content-policy/test-general-content-policy.js
mail/test/mozmill/content-policy/test-js-content-policy.js
mail/test/mozmill/content-policy/test-plugins-policy.js
mail/test/mozmill/content-policy/test-view-source.js
mail/test/mozmill/content-tabs/html/test-lwthemes.html
mail/test/mozmill/content-tabs/test-about-support.js
mail/test/mozmill/content-tabs/test-addons-mgr.js
mail/test/mozmill/content-tabs/test-content-tab.js
mail/test/mozmill/content-tabs/test-install-xpi.js
mail/test/mozmill/cookies/test-cookies.js
mail/test/mozmill/downloads/test-about-downloads.js
mail/test/mozmill/folder-display/test-archive-messages.js
mail/test/mozmill/folder-display/test-close-window-on-delete.js
mail/test/mozmill/folder-display/test-columns.js
mail/test/mozmill/folder-display/test-deletion-from-virtual-folders.js
mail/test/mozmill/folder-display/test-deletion-with-multiple-displays.js
mail/test/mozmill/folder-display/test-display-name.js
mail/test/mozmill/folder-display/test-displaying-messages-in-folder-tabs.js
mail/test/mozmill/folder-display/test-folder-pane-visibility.js
mail/test/mozmill/folder-display/test-folder-toolbar.js
mail/test/mozmill/folder-display/test-invalid-db-folder-load.js
mail/test/mozmill/folder-display/test-mail-views.js
mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
mail/test/mozmill/folder-display/test-message-commands.js
mail/test/mozmill/folder-display/test-message-pane-visibility.js
mail/test/mozmill/folder-display/test-message-reloads.js
mail/test/mozmill/folder-display/test-message-size.js
mail/test/mozmill/folder-display/test-message-window.js
mail/test/mozmill/folder-display/test-opening-messages-without-a-backing-view.js
mail/test/mozmill/folder-display/test-opening-messages.js
mail/test/mozmill/folder-display/test-pane-focus.js
mail/test/mozmill/folder-display/test-recent-menu.js
mail/test/mozmill/folder-display/test-right-click-middle-click-folders.js
mail/test/mozmill/folder-display/test-right-click-middle-click-messages.js
mail/test/mozmill/folder-display/test-savedsearch-reload-after-compact.js
mail/test/mozmill/folder-display/test-selection.js
mail/test/mozmill/folder-display/test-summarization.js
mail/test/mozmill/folder-display/test-tabs-simple.js
mail/test/mozmill/folder-display/test-virtual-folder-commands.js
mail/test/mozmill/folder-display/test-watch-ignore-thread.js
mail/test/mozmill/folder-pane/test-display-message-with-folder-modes.js
mail/test/mozmill/folder-pane/test-folder-names-in-recent-mode.js
mail/test/mozmill/folder-pane/test-folder-pane-consumers.js
mail/test/mozmill/folder-pane/test-folder-pane.js
mail/test/mozmill/folder-tree-modes/test-custom-folder-tree-mode.js
mail/test/mozmill/folder-tree-modes/test-custom-smart-folder.js
mail/test/mozmill/folder-tree-modes/test-extension/bootstrap.js
mail/test/mozmill/folder-tree-modes/test-mode-switching.js
mail/test/mozmill/folder-tree-modes/test-smart-folders.js
mail/test/mozmill/folder-tree-modes/test-unread-folders.js
mail/test/mozmill/folder-widget/test-message-filters.js
mail/test/mozmill/im/test-chat-tab-restore.js
mail/test/mozmill/im/test-toolbar-buttons.js
mail/test/mozmill/instrumentation/test-instrument-setup.js
mail/test/mozmill/junk-commands/test-junk-commands.js
mail/test/mozmill/keyboard/test-spacehit.js
mail/test/mozmill/message-header/test-message-header.js
mail/test/mozmill/message-header/test-phishing-bar.js
mail/test/mozmill/message-header/test-reply-identity.js
mail/test/mozmill/message-header/test-reply-to-list-from-address-selection.js
mail/test/mozmill/message-header/test-return-receipt.js
mail/test/mozmill/message-reader/test-bug594646.js
mail/test/mozmill/message-window/test-autohide-menubar.js
mail/test/mozmill/message-window/test-commands.js
mail/test/mozmill/message-window/test-eml-subject.js
mail/test/mozmill/message-window/test-message-sidebar.js
mail/test/mozmill/message-window/test-vcard-actions.js
mail/test/mozmill/message-window/test-view-plaintext.js
mail/test/mozmill/multiple-identities/test-display-names.js
mail/test/mozmill/newmailaccount/test-newmailaccount.js
mail/test/mozmill/notification/test-notification.js
mail/test/mozmill/override-main-menu-collapse/test-override-mainmenu-collapse.js
mail/test/mozmill/pref-window/test-attachments-pane.js
mail/test/mozmill/pref-window/test-font-chooser.js
mail/test/mozmill/quick-filter-bar/test-display-issues.js
mail/test/mozmill/quick-filter-bar/test-filter-logic.js
mail/test/mozmill/quick-filter-bar/test-keyboard-interface.js
mail/test/mozmill/quick-filter-bar/test-sticky-filter-logic.js
mail/test/mozmill/quick-filter-bar/test-toggle-bar.js
mail/test/mozmill/search-window/test-multiple-search-windows.js
mail/test/mozmill/search-window/test-right-click-to-open-search-window.js
mail/test/mozmill/search-window/test-search-window.js
mail/test/mozmill/session-store/test-session-store.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-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-notificationbox-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-quick-filter-bar-helpers.js
mail/test/mozmill/shared-modules/test-search-window-helpers.js
mail/test/mozmill/shared-modules/test-subscribe-window-helper.js
mail/test/mozmill/shared-modules/test-subscribe-window-helpers.js
mail/test/mozmill/shared-modules/test-window-helpers.js
mail/test/mozmill/startup-firstrun/test-menubar-collapsed.js
mail/test/mozmill/subscribe/test-subscribe-news-filter.js
mail/test/mozmill/tabmail/test-tabmail-closing.js
mail/test/mozmill/tabmail/test-tabmail-customize.js
mail/test/mozmill/tabmail/test-tabmail-dragndrop.js
mail/test/mozmill/utils/html/collections.html
mail/test/mozmill/utils/test-extensionSupport.js
mail/test/mozmill/utils/test-iteratorUtils.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -73,17 +73,16 @@ mail/base/content/protovis-r2.6-modded.j
 mail/branding/nightly/thunderbird-branding.js
 mail/branding/thunderbird/thunderbird-branding.js
 # This file is split into two in order to keep it as a valid json file
 # for documentation purposes (policies.json) but to be accessed by the
 # code as a .jsm (schema.jsm)
 mail/components/enterprisepolicies/schemas/schema.jsm
 mail/components/im/all-im.js
 mail/locales/en-US/all-l10n.js
-mail/test/mozmill/**
 
 # calendar/ exclusions
 
 # prefs files
 calendar/lightning/content/lightning.js
 calendar/providers/gdata/defaults/preferences.js
 calendar/timezones/preferences.js
 
new file mode 100644
--- /dev/null
+++ b/mail/test/mozmill/.eslintrc.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = {
+  globals: {
+    __file__: true,
+    collector: true,
+    elementslib: true,
+    mozmill: true,
+  },
+  rules: {
+    "func-names": "off",
+  },
+};
--- a/mail/test/mozmill/account/test-ab-whitelist.js
+++ b/mail/test/mozmill/account/test-ab-whitelist.js
@@ -1,19 +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/. */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-ab-whitelist";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "account-manager-helpers", "keyboard-helpers" ];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "window-helpers",
+  "account-manager-helpers",
+  "keyboard-helpers",
+];
 
 var mozmill = ChromeUtils.import("chrome://mozmill/content/modules/mozmill.jsm");
 var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var gOldWhiteList = null;
 var gKeyString = null;
 
@@ -108,17 +116,17 @@ function subtest_check_whitelist_load_cl
   let whiteListURIs = "";
 
   try {
     whiteListURIs = Services.prefs.getCharPref(gKeyString);
     // We should have failed here, because the pref should have been cleared
     // out.
     throw Error("The whitelist preference for this server wasn't properly "
                 + "cleared.");
-  } catch(e) {
+  } catch (e) {
   }
 
   for (let i = 0; i < list.getRowCount(); i++) {
     let abNode = list.getItemAtIndex(i);
     assert_equals("false", abNode.firstChild.getAttribute("checked"),
                   "Should not have been checked");
     // Also ensure that the address book URI was properly cleared in the
     // prefs
--- a/mail/test/mozmill/account/test-account-actions.js
+++ b/mail/test/mozmill/account/test-account-actions.js
@@ -1,19 +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/. */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-account-actions";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                         "account-manager-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
 
 var imapAccount, nntpAccount, originalAccountCount;
 
 function setupModule(module) {
   collector.getModule("window-helpers").installInto(module);
   collector.getModule("folder-display-helpers").installInto(module);
   collector.getModule("account-manager-helpers").installInto(module);
 
@@ -64,18 +66,17 @@ function teardownModule(module) {
  * @param amc          the account options controller
  * @param aAccountKey  the key of the account to select
  * @param aIsSetAsDefaultEnabled  true if the menuitem should be enabled, false otherwise
  * @param aIsRemoveEnabled        true if the menuitem should be enabled, false otherwise
  * @param aIsAddAccountEnabled    true if the menuitems (Add Mail Account+Add Other Account)
  *                                should be enabled, false otherwise
  */
 function subtest_check_account_actions(amc, aAccountKey, aIsSetAsDefaultEnabled,
-                                       aIsRemoveEnabled, aIsAddAccountEnabled)
-{
+                                       aIsRemoveEnabled, aIsAddAccountEnabled) {
   let accountRow = get_account_tree_row(aAccountKey, null, amc);
   click_account_tree_row(amc, accountRow);
 
   // click the Actions Button to bring up the popup with menuitems to test
   amc.click(amc.eid("accountActionsButton"), 5, 5);
   wait_for_popup_to_open(amc.e("accountActionsDropdown"));
 
   let actionAddMailAccount = amc.e("accountActionsAddMailAccount");
--- a/mail/test/mozmill/account/test-account-deletion.js
+++ b/mail/test/mozmill/account/test-account-deletion.js
@@ -3,21 +3,23 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * This test checks proper deletion of an account from the Account manager.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-account-deletion";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "account-manager-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
 
 var gPopAccount, gImapAccount, gNntpAccount, gOriginalAccountCount;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
@@ -67,18 +69,17 @@ function test_account_data_deletion() {
 }
 
 /**
  * Bug 274452
  * Check if files of an account are preserved.
  *
  * @param amc  The account options controller.
  */
-function subtest_account_data_deletion1(amc)
-{
+function subtest_account_data_deletion1(amc) {
   let accountDir = gPopAccount.incomingServer.localPath;
   assert_true(accountDir.isDirectory());
 
   // Get some existing file in the POP3 account data dir.
   let inboxFile = accountDir.clone();
   inboxFile.append("Inbox.msf");
   assert_true(inboxFile.isFile());
 
@@ -87,18 +88,17 @@ function subtest_account_data_deletion1(
 }
 
 /**
  * Bug 274452
  * Check if files of an account can be deleted.
  *
  * @param amc  The account options controller.
  */
-function subtest_account_data_deletion2(amc)
-{
+function subtest_account_data_deletion2(amc) {
   let accountDir = gImapAccount.incomingServer.localPath;
   assert_true(accountDir.isDirectory());
 
   // Get some file in the IMAP account data dir.
   let inboxFile = accountDir.clone();
   inboxFile.append("INBOX.msf");
   assert_true(inboxFile.isFile());
 
--- a/mail/test/mozmill/account/test-account-port-setting.js
+++ b/mail/test/mozmill/account/test-account-port-setting.js
@@ -1,28 +1,36 @@
 /* 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/. */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-account-port-setting";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "account-manager-helpers", "keyboard-helpers" ];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "window-helpers",
+  "account-manager-helpers",
+  "keyboard-helpers",
+];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var PORT_NUMBERS_TO_TEST =
   [
     "110", // The original port number. We don't input this though.
     "456", // Random port number.
     "995", // The SSL port number.
-    "110"  // Back to the original.
+    "110", // Back to the original.
   ];
 
 var gTestNumber;
 
 function subtest_check_set_port_number(amc, aDontSet) {
   // This test expects the following POP account to exist by default
   // with port number 110 and no security.
   let server = MailServices.accounts
--- a/mail/test/mozmill/account/test-account-settings-infrastructure.js
+++ b/mail/test/mozmill/account/test-account-settings-infrastructure.js
@@ -7,21 +7,23 @@
  * in the Account manager. E.g. if the values of elements are properly stored when
  * panes are switched.
  *
  * New checks can be added to it as needed.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-account-settings-infrastructure";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                         "account-manager-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var gPopAccount, gImapAccount, gOriginalAccountCount;
 
 function setupModule(module) {
   collector.getModule("window-helpers").installInto(module);
   collector.getModule("folder-display-helpers").installInto(module);
@@ -80,18 +82,17 @@ function test_account_dot_IDs() {
 
 /**
  * Check that the options in the server pane are stored even if the id
  * of the element contains multiple dots (not used in standard TB yet
  * but extensions may want it).
  *
  * @param amc  the account options controller
  */
-function subtest_check_account_dot_IDs(amc)
-{
+function subtest_check_account_dot_IDs(amc) {
   let accountRow = get_account_tree_row(gPopAccount.key, "am-server.xul", amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.e("contentFrame").contentDocument;
   // Check whether a standard element with "server.loginAtStartUp" stores its
   // value properly.
   let loginCheck = iframe.getElementById("server.loginAtStartUp");
   assert_false(loginCheck.checked);
@@ -161,18 +162,17 @@ function test_account_locked_prefs() {
 }
 
 /**
  * Check that the LDAP server selection elements (radio group) are properly
  * disabled when their attached pref (prefstring attribute) is locked.
  *
  * @param amc  the account options controller
  */
-function subtest_check_locked_prefs_addressing(amc)
-{
+function subtest_check_locked_prefs_addressing(amc) {
   let accountRow = get_account_tree_row(gPopAccount.key, "am-addressing.xul", amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.e("contentFrame").contentDocument;
 
   // By default, 'use global LDAP server preferences' is set, not the
   // 'different LDAP server'.
   let useLDAPdirectory = iframe.getElementById("directories");
@@ -229,18 +229,17 @@ function subtest_check_locked_prefs_addr
 
 /**
  * Check that the POP3 'keep on server' settings elements (2-level
  * checkboxes + textbox) are properly disabled when their attached pref
  * (prefstring attribute) is locked.
  *
  * @param amc  the account options controller
  */
-function subtest_check_locked_prefs_server(amc)
-{
+function subtest_check_locked_prefs_server(amc) {
   let accountRow = get_account_tree_row(gPopAccount.key, "am-server.xul", amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.e("contentFrame").contentDocument;
 
   // Top level leaveOnServer checkbox, disabled by default.
   let leaveOnServer = iframe.getElementById("pop3.leaveMessagesOnServer");
   assert_false(leaveOnServer.disabled);
@@ -322,18 +321,17 @@ function test_replyTo_leak() {
   open_advanced_settings(function(amc) {
     subtest_check_replyTo_leak(amc);
   });
 }
 
 /**
  * @param amc  the account options controller
  */
-function subtest_check_replyTo_leak(amc)
-{
+function subtest_check_replyTo_leak(amc) {
   let accountRow = get_account_tree_row(gPopAccount.key, null, amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.window.document.getElementById("contentFrame");
 
   // The Reply-To field should be empty.
   let replyAddress = iframe.contentDocument.getElementById("identity.replyTo");
   assert_equals(replyAddress.value, "");
@@ -365,18 +363,17 @@ function test_account_onchange_handler()
   });
 }
 
 /**
  * Check if onchange handlers are properly executed when panes are switched.
  *
  * @param amc  the account options controller
  */
-function subtest_check_onchange_handler(amc)
-{
+function subtest_check_onchange_handler(amc) {
   let accountRow = get_account_tree_row(gImapAccount.key, "am-offline.xul", amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.e("contentFrame").contentDocument;
 
   let autoSync = iframe.getElementById("autosyncValue");
   // 30 is the default value so check if we are in clean state.
   assert_equals(autoSync.value, 30);
--- a/mail/test/mozmill/account/test-account-tree.js
+++ b/mail/test/mozmill/account/test-account-tree.js
@@ -3,21 +3,23 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * This test checks proper operation of the account tree in the Account manager.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-account-tree";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                         "account-manager-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
 
 var gPopAccount, gOriginalAccountCount;
 
 function setupModule(module) {
   collector.getModule("window-helpers").installInto(module);
   collector.getModule("folder-display-helpers").installInto(module);
   collector.getModule("account-manager-helpers").installInto(module);
 
@@ -62,18 +64,17 @@ function test_account_open_state() {
 }
 
 /**
  * Check if the open state of accounts is in the wished state.
  *
  * @param amc           The account options controller.
  * @param aWishedState  The open state in which the account row should be found (bool).
  */
-function subtest_check_account_open_state(amc, aWishedState)
-{
+function subtest_check_account_open_state(amc, aWishedState) {
   let accountRow = get_account_tree_row(gPopAccount.key, null, amc);
   click_account_tree_row(amc, accountRow);
 
   // See if the account row is in the wished open state.
   let accountTree = amc.e("accounttree");
   assert_equals(accountRow, accountTree.view.selection.currentIndex);
   assert_equals(accountTree.view.isContainerOpen(accountRow), aWishedState);
 
@@ -101,18 +102,17 @@ function test_default_account_highlight(
   });
 }
 
 /**
  * Check if the default account is styled in bold and another account is not.
  *
  * @param amc           The account options controller.
  */
-function subtest_check_default_account_highlight(amc)
-{
+function subtest_check_default_account_highlight(amc) {
   // Select the default account.
   let accountRow = get_account_tree_row(MailServices.accounts.defaultAccount.key, null, amc);
   click_account_tree_row(amc, accountRow);
 
   let accountTree = amc.e("accounttree");
   assert_equals(accountRow, accountTree.view.selection.currentIndex);
   let cell = accountTree.view.getItemAtIndex(accountRow).firstChild.firstChild;
   assert_equals(cell.tagName, "treecell");
@@ -146,18 +146,17 @@ function test_selection_after_account_de
   });
 }
 
 /**
  * Check if after deleting an account the next one is selected.
  *
  * @param amc           The account options controller.
  */
-function subtest_check_selection_after_account_deletion(amc)
-{
+function subtest_check_selection_after_account_deletion(amc) {
   let accountList = [];
   let accountTreeNode = amc.e("account-tree-children");
   // Build the list of accounts in the account tree (order is important).
   for (let i = 0; i < accountTreeNode.childNodes.length; i++) {
     if ("_account" in accountTreeNode.childNodes[i]) {
       let curAccount = accountTreeNode.childNodes[i]._account;
       if (!accountList.includes(curAccount))
         accountList.push(curAccount);
--- a/mail/test/mozmill/account/test-account-values.js
+++ b/mail/test/mozmill/account/test-account-values.js
@@ -4,21 +4,29 @@
 
 /**
  * This test checks proper operation of the account settings panes
  * when certain special or invalid values are entered into the fields.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-account-values";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "account-manager-helpers", "keyboard-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "window-helpers",
+  "account-manager-helpers",
+  "keyboard-helpers",
+];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var gPopAccount, gOriginalAccountCount;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
@@ -62,18 +70,17 @@ function test_default_CC_address() {
 }
 
 /**
  * Check that if the CC field is empty, enabling CC will automatically
  * prefill the currently default email address.
  *
  * @param amc  the account options controller
  */
-function subtest_check_default_CC_address(amc)
-{
+function subtest_check_default_CC_address(amc) {
   let accountRow = get_account_tree_row(gPopAccount.key, "am-copies.xul", amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.window.document.getElementById("contentFrame");
 
   let defaultAddress = iframe.contentDocument.getElementById("identity.email").value;
   let ccCheck = iframe.contentDocument.getElementById("identity.doCc");
   let ccAddress = iframe.contentDocument.getElementById("identity.doCcList");
@@ -179,18 +186,17 @@ function test_account_name() {
 /**
  * Changes the user name and hostname to the supplied values.
  *
  * @param aAccount      the account to change
  * @param aNewHostname  the hostname value to set
  * @param aNewUsername  the username value to set
  * @param amc           the account options controller
  */
-function subtest_check_account_name(aAccount, aNewHostname, aNewUsername, amc)
-{
+function subtest_check_account_name(aAccount, aNewHostname, aNewUsername, amc) {
   let accountRow = get_account_tree_row(aAccount.key, "am-server.xul", amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.window.document.getElementById("contentFrame");
 
   if (aNewHostname) {
     let hostname = iframe.contentDocument.getElementById("server.realHostName");
     assert_equals(hostname.value, aAccount.incomingServer.realHostName);
@@ -231,36 +237,31 @@ function test_invalid_junk_target() {
   branch.setCharPref("spamActionTargetFolder", "some random non-existent URI");
   let moveOnSpam = true;
   branch.setBoolPref("moveOnSpam", moveOnSpam);
   open_advanced_settings(function(amc) {
     subtest_check_invalid_junk_target(amc);
   });
 
   // The pref has no default so its non-existence means it was cleared.
-  try {
-    moveOnSpam = branch.getBoolPref("moveOnSpam");
-  } catch (e) {
-    moveOnSpam = false;
-  }
+  moveOnSpam = branch.getBoolPref("moveOnSpam", false);
   assert_false(moveOnSpam);
   // The targets should point to the same pop account now.
   let targetAccount = branch.getCharPref("spamActionTargetAccount");
   assert_equals(targetAccount, gPopAccount.incomingServer.serverURI);
   let targetFolder = branch.getCharPref("spamActionTargetFolder");
   assert_equals(targetFolder, gPopAccount.incomingServer.serverURI + "/Junk");
 }
 
 /**
  * Just show the Junk settings pane and let it fix the values.
  *
  * @param amc  the account options controller
  */
-function subtest_check_invalid_junk_target(amc)
-{
+function subtest_check_invalid_junk_target(amc) {
   let accountRow = get_account_tree_row(gPopAccount.key, "am-junk.xul", amc);
   click_account_tree_row(amc, accountRow);
 
   // We need to save the new fixed values so click OK on the Account settings.
   amc.window.document.documentElement.acceptDialog();
 }
 
 /**
@@ -285,18 +286,17 @@ function test_invalid_hostname() {
 
 /**
  * Set the hostname to an invalid value and check if it gets fixed.
  *
  * @param amc                the account options controller
  * @param aExitSettings      Attempt to close the Account settings dialog.
  * @param aOriginalHostname  Original hostname of this server.
  */
-function subtest_check_invalid_hostname(amc, aExitSettings, aOriginalHostname)
-{
+function subtest_check_invalid_hostname(amc, aExitSettings, aOriginalHostname) {
   let accountRow = get_account_tree_row(gPopAccount.key, "am-server.xul", amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.window.document.getElementById("contentFrame");
   let hostname = iframe.contentDocument.getElementById("server.realHostName");
   assert_equals(hostname.value, aOriginalHostname);
 
   hostname.value = "some_invalid+host&domain*in>invalid";
@@ -343,18 +343,17 @@ function test_trailing_spaces() {
 }
 
 /**
  * Check that the AM will trim user added spaces around text values
  * when storing them into the account.
  *
  * @param amc  the account options controller
  */
-function subtest_check_trailing_spaces(amc)
-{
+function subtest_check_trailing_spaces(amc) {
   let accountRow = get_account_tree_row(gPopAccount.key, null, amc);
   click_account_tree_row(amc, accountRow);
 
   let iframe = amc.window.document.getElementById("contentFrame");
 
   let accountName = iframe.contentDocument.getElementById("server.prettyName");
   let defaultAddress = iframe.contentDocument.getElementById("identity.email");
   delete_all_existing(amc, new elib.Elem(accountName));
--- a/mail/test/mozmill/account/test-archive-options.js
+++ b/mail/test/mozmill/account/test-archive-options.js
@@ -1,19 +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/. */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-archive-options";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "account-manager-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
 
 var mozmill = ChromeUtils.import("chrome://mozmill/content/modules/mozmill.jsm");
 var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var defaultIdentity;
 
 function setupModule(module) {
@@ -168,9 +170,9 @@ function subtest_disable_archive(amc) {
   assert_false(defaultIdentity.archiveEnabled);
 }
 
 function test_disable_archive() {
   open_advanced_settings(subtest_disable_archive);
 }
 // Disable test on Windows since for some yet unknown reason clicking the checkbox
 // doesn't have the desired result. See bug 1461173 for details.
-test_disable_archive.EXCLUDED_PLATFORMS = ['winnt'];
+test_disable_archive.EXCLUDED_PLATFORMS = ["winnt"];
--- a/mail/test/mozmill/account/test-mail-account-setup-wizard.js
+++ b/mail/test/mozmill/account/test-mail-account-setup-wizard.js
@@ -1,19 +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/. */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-mail-account-setup-wizard";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "account-manager-helpers", "keyboard-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "window-helpers",
+  "account-manager-helpers",
+  "keyboard-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var user = {
   name: "Yamato Nadeshiko",
@@ -53,17 +61,17 @@ function test_mail_account_setup() {
   // Set the pref to load a local autoconfig file.
   let pref_name = "mailnews.auto_config_url";
   let url = collector.addHttpResource("../account/xml", "autoconfig");
   Services.prefs.setCharPref(pref_name, url);
 
   // Force .com MIME-Type to text/xml
   collector.httpd.registerContentType("com", "text/xml");
 
-  open_mail_account_setup_wizard(function (awc) {
+  open_mail_account_setup_wizard(function(awc) {
     // Input user's account information
     awc.click(awc.eid("realname"));
     if (awc.e("realname").value) {
       // If any realname is already filled, clear it out, we have our own.
       delete_all_existing(awc, awc.eid("realname"));
     }
     input_value(awc, user.name);
     awc.keypress(null, "VK_TAB", {});
@@ -94,31 +102,31 @@ function subtest_verify_account(amc) {
               "Timeout waiting for currentAccount to become non-null");
   let account = amc.window.currentAccount;
   let identity = account.defaultIdentity;
   let incoming = account.incomingServer;
   let outgoing = MailServices.smtp.getServerByKey(identity.smtpServerKey);
 
   let config = {
     "incoming server username": {
-      actual: incoming.username, expected: user.email.split("@")[0]
+      actual: incoming.username, expected: user.email.split("@")[0],
     },
     "outgoing server username": {
-      actual: outgoing.username, expected: user.email
+      actual: outgoing.username, expected: user.email,
     },
     "incoming server hostname": {
       // Note: N in the hostName is uppercase
-      actual: incoming.hostName, expected: user.incomingHost
+      actual: incoming.hostName, expected: user.incomingHost,
     },
     "outgoing server hostname": {
       // And this is lowercase
-      actual: outgoing.hostname, expected: user.outgoingHost
+      actual: outgoing.hostname, expected: user.outgoingHost,
     },
     "user real name": { actual: identity.fullName, expected: user.name },
-    "user email address": { actual: identity.email, expected: user.email }
+    "user email address": { actual: identity.email, expected: user.email },
   };
 
   try {
     for (let i in config) {
       if (config[i].actual != config[i].expected) {
         throw new Error("Configured " + i + " is " + config[i].actual +
                         ". It should be " + config[i].expected + ".");
       }
@@ -139,41 +147,39 @@ function test_bad_password_uses_old_sett
   let pref_name = "mailnews.auto_config_url";
   let url = collector.addHttpResource("../account/xml", "autoconfig");
   Services.prefs.setCharPref(pref_name, url);
 
   // Force .com MIME-Type to text/xml
   collector.httpd.registerContentType("com", "text/xml");
 
   mc.sleep(0);
-  open_mail_account_setup_wizard(function (awc) {
+  open_mail_account_setup_wizard(function(awc) {
     try {
       // Input user's account information
       awc.click(awc.eid("realname"));
       if (awc.e("realname").value) {
         // If any realname is already filled, clear it out, we have our own.
         delete_all_existing(awc, awc.eid("realname"));
       }
       input_value(awc, user.name);
       awc.keypress(null, "VK_TAB", {});
       input_value(awc, user.email);
       awc.keypress(null, "VK_TAB", {});
       input_value(awc, user.password);
 
       // Load the autoconfig file from http://localhost:433**/autoconfig/example.com
       awc.e("next_button").click();
 
-      let config = null;
-
-      awc.waitFor(function() { return this.disabled == false && this.hidden == false; },
+      awc.waitFor(function() { return !this.disabled && !this.hidden; },
                   "Timeout waiting for create button to be visible and active",
                   8000, 600, awc.e("create_button"));
       awc.e("create_button").click();
 
-      awc.waitFor(function() { return this.disabled == false; },
+      awc.waitFor(function() { return !this.disabled; },
                   "Timeout waiting for create button to be visible and active",
                   8000, 600, awc.e("create_button"));
       awc.e("create_button").click();
       awc.e("manual-edit_button").click();
 
       // Make sure all the values are the same as in the user object.
       awc.sleep(1000);
       assert_equals(awc.e("outgoing_hostname").value, user.outgoingHost,
@@ -201,31 +207,30 @@ function remember_password_test(aPrefVal
   // save the pref for backup purpose
   let rememberSignons_pref_save =
       Services.prefs.getBoolPref("signon.rememberSignons", true);
 
   Services.prefs.setBoolPref("signon.rememberSignons", aPrefValue);
 
   // without this, it breaks the test, don't know why
   mc.sleep(0);
-  open_mail_account_setup_wizard(function (awc) {
+  open_mail_account_setup_wizard(function(awc) {
     try {
       let password = new elementslib.ID(awc.window.document, "password");
       let rememberPassword =
           new elementslib.ID(awc.window.document, "remember_password");
 
       // type something in the password field
       awc.e("password").focus();
       input_value(awc, "testing");
 
       awc.assertProperty(rememberPassword, "disabled", !aPrefValue);
       if (aPrefValue) {
         awc.assertChecked(rememberPassword);
-      }
-      else {
+      } else {
         awc.assertNotChecked(rememberPassword);
       }
 
       // empty the password field
       delete_all_existing(awc, password);
 
       // restore the saved signon.rememberSignons value
       Services.prefs.setBoolPref("signon.rememberSignons", rememberSignons_pref_save);
--- a/mail/test/mozmill/account/test-retest-config.js
+++ b/mail/test/mozmill/account/test-retest-config.js
@@ -1,27 +1,35 @@
 /* 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/. */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-retest-config";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "keyboard-helpers", "account-manager-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "window-helpers",
+  "keyboard-helpers",
+  "account-manager-helpers",
+];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var user = {
   name: "test",
   email: "test@momo.invalid",
-  altEmail: "test2@momo.invalid"
+  altEmail: "test2@momo.invalid",
 };
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
   Services.prefs.setCharPref("mail.wizard.logging.dump", "All");
 
@@ -34,54 +42,54 @@ function tearDownModule(module) {
   Services.prefs.clearUserPref("mailnews.auto_config_url");
   Services.prefs.clearUserPref("mail.wizard.logging.dump");
 }
 
 function test_re_test_config() {
   // Opening multiple windows in the same run seems to require letting the stack
   // unwind before opening the next one, so do that here.
   mc.sleep(0);
-  open_mail_account_setup_wizard(function (awc) {
+  open_mail_account_setup_wizard(function(awc) {
     // Input user's account information
     awc.click(awc.eid("realname"));
     if (awc.e("realname").value) {
       // If any realname is already filled, clear it out, we have our own.
       delete_all_existing(awc, awc.eid("realname"));
     }
     input_value(awc, user.name);
     awc.keypress(null, "VK_TAB", {});
     input_value(awc, user.email);
 
     // Click "continue" button
     awc.e("next_button").click();
 
     // Wait for 'edit' button to be enabled
-    awc.waitFor(function() { return this.disabled == false && this.hidden == false; },
+    awc.waitFor(function() { return !this.disabled && !this.hidden; },
                 "Timeout waiting for edit button to be enabled",
                 8000, 600, awc.e("create_button"));
 
     awc.e("manual-edit_button").click();
 
     // Click "re-test" button
     awc.e("half-manual-test_button").click();
 
-    awc.waitFor(function () { return this.disabled == false; },
+    awc.waitFor(function() { return !this.disabled; },
                 "Timeout waiting for re-test button to be enabled",
                 20000, 600, awc.e("half-manual-test_button"));
 
     // There used to be a "start over" button (line commented out below). Now just
     // changing the value of the email field does the trick.
     awc.e("realname").focus();
     awc.keypress(null, "VK_TAB", {});
     input_value(awc, user.altEmail);
     awc.keypress(null, "VK_TAB", {});
 
     // Wait for the "continue" button to be back, which means we're back to the
     // original state.
-    awc.waitFor(function() { return this.hidden == false; },
+    awc.waitFor(function() { return !this.hidden; },
                 "Timeout waiting for continue button to be visible",
                 20000, 600, awc.e("next_button"));
 
     awc.e("next_button").click();
 
     // Previously, we'd switched to the manual editing state. Now we've started
     // over, we should make sure the information is presented back in its original
     // "automatic" mode.
--- a/mail/test/mozmill/addrbook/test-address-book-panes.js
+++ b/mail/test/mozmill/addrbook/test-address-book-panes.js
@@ -3,18 +3,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Tests for the address book.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-address-book-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+
 var MODULE_NAME = "test-address-book-panes";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["address-book-helpers", "folder-display-helpers"];
 
 var abController;
 
 function setupModule(module) {
   // We need this to get mc which is needed in open_address_book_window.
   let fdh = collector.getModule("folder-display-helpers");
@@ -56,17 +58,16 @@ function _help_assert_pane_visibility(pa
   if (abController.e(paneId).collapsed == visible)
     throw new Error(paneId + " pane should be " +
                     (visible ? "visible" : "hidden"));
 
   abController.window.InitViewLayoutMenuPopup();
   if ((abController.e(menuitemId).getAttribute("checked") == "true") != visible)
     throw new Error(menuitemId + " menuitem should be " +
                     (visible ? "checked" : "unchecked"));
-
 }
 
 /**
  * Toggle the directory pane.
  */
 function toggle_directory_pane() {
   _help_toggle_pane("dirTree-splitter");
 }
--- a/mail/test/mozmill/addrbook/test-address-book.js
+++ b/mail/test/mozmill/addrbook/test-address-book.js
@@ -3,33 +3,41 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Tests for the address book.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-address-book';
+/* import-globals-from ../shared-modules/test-address-book-helpers.js */
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-prompt-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ["folder-display-helpers", "address-book-helpers",
-                       'compose-helpers', 'window-helpers',
-                       'prompt-helpers'];
+var MODULE_NAME = "test-address-book";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "address-book-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "prompt-helpers",
+];
 
 var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var abController = null;
 var addrBook1, addrBook2, addrBook3, addrBook4, ldapBook;
 var mListA, mListB, mListC, mListD, mListE;
 
-function setupModule(module)
-{
+function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
   // Open the address book main window
   abController = open_address_book_window();
 
   // Let's add some new address books.  I'll add them
@@ -83,111 +91,107 @@ function setupModule(module)
  *    ML B
  * AB 3
  *    ML C
  *    ML D
  * AB 4
  * LDAP Book
  * Collected Address Book
  **/
-function test_order_of_address_books()
-{
+function test_order_of_address_books() {
   const EXPECTED_AB_ORDER = ["All Address Books",
                              "Personal Address Book", "AB 1", "AB 2",
                              "AB 3", "AB 4", "LDAP Book",
                              "Collected Addresses"];
 
-  for (let i = 0; i < EXPECTED_AB_ORDER.length; i++)
-  {
+  for (let i = 0; i < EXPECTED_AB_ORDER.length; i++) {
     let abName = get_name_of_address_book_element_at(i);
     assert_equals(abName, EXPECTED_AB_ORDER[i],
                   "The address books are out of order.");
   }
 }
 
 /* Test that the expanded and collapsed states of address books
  * in the tree persist state when closing and re-opening the
  * address book manager
  */
-function test_persist_collapsed_and_expanded_states()
-{
+function test_persist_collapsed_and_expanded_states() {
   // Set the state of address books 1 and 3 to expanded
   set_address_books_expanded([addrBook1, addrBook3]);
 
   // Set address book 2 to be collapsed
-  set_address_book_collapsed(addrBook2);
+  set_address_books_collapsed(addrBook2);
 
   // Now close and re-open the address book
   close_address_book_window(abController);
   abController = open_address_book_window();
 
   assert_true(is_address_book_collapsed(addrBook2));
   assert_true(!is_address_book_collapsed(addrBook1));
   assert_true(!is_address_book_collapsed(addrBook3));
 
   // Now set the state of address books 1 and 3 to collapsed
   // and make sure 2 is expanded
   set_address_books_collapsed([addrBook1, addrBook3]);
-  set_address_book_expanded(addrBook2);
+  set_address_books_expanded(addrBook2);
 
   // Now close and re-open the address book
   close_address_book_window(abController);
   abController = open_address_book_window();
 
   assert_true(!is_address_book_collapsed(addrBook2));
   assert_true(is_address_book_collapsed(addrBook1));
   assert_true(is_address_book_collapsed(addrBook3));
 }
 
 /* Test that if we try to delete a contact, that we are given
  * a confirm prompt.
  */
-function test_deleting_contact_causes_confirm_prompt()
-{
+function test_deleting_contact_causes_confirm_prompt() {
   // Register the Mock Prompt Service
   gMockPromptService.register();
 
   // Create a contact that we'll try to delete
   let contact1 = create_contact("test@example.com", "Sammy Jenkis", true);
   let toDelete = [contact1];
 
   let bundle = Services.strings
-                       .createBundle("chrome://messenger/locale/addressbook/addressBook.properties")
+                       .createBundle("chrome://messenger/locale/addressbook/addressBook.properties");
   let confirmSingle = bundle.GetStringFromName("confirmDeleteThisContact");
   confirmSingle = confirmSingle.replace("#1", "Sammy Jenkis");
 
   // Add some contacts to the address book
   load_contacts_into_address_book(addrBook1, toDelete);
   select_address_book(addrBook1);
 
   let totalEntries = abController.window.gAbView.rowCount;
 
   // Set the mock prompt to return false, so that the
   // contact should not be deleted.
   gMockPromptService.returnValue = false;
 
   // Now attempt to delete the contact
-  select_contact(toDelete);
+  select_contacts(toDelete);
   abController.keypress(null, "VK_DELETE", {});
 
   let promptState = gMockPromptService.promptState;
   assert_not_equals(null, promptState, "Expected a prompt state");
   // Was a confirm displayed?
   assert_equals("confirm", promptState.method);
   // Was the right message displayed?
   assert_equals(confirmSingle, promptState.text);
   // The contact should not have been deleted.
   assert_equals(abController.window.gAbView.rowCount, totalEntries);
 
   gMockPromptService.reset();
 
   // Now we'll return true on confirm so that
   // the contact is deleted.
   gMockPromptService.returnValue = true;
-  select_contact(toDelete);
+  select_contacts(toDelete);
   abController.keypress(null, "VK_DELETE", {});
 
   promptState = gMockPromptService.promptState;
   assert_not_equals(null, promptState, "Expected a prompt state");
   // Was a confirm displayed?
   assert_equals("confirm", promptState.method);
   // Was the right message displayed?
   assert_equals(confirmSingle, promptState.text);
@@ -196,30 +200,29 @@ function test_deleting_contact_causes_co
                 totalEntries - toDelete.length);
 
   gMockPromptService.unregister();
 }
 
 /* Test that if we try to delete multiple contacts, that we are give
  * a confirm prompt.
  */
-function test_deleting_contacts_causes_confirm_prompt()
-{
+function test_deleting_contacts_causes_confirm_prompt() {
   // Register the Mock Prompt Service
   gMockPromptService.register();
 
   // Create some contacts that we'll try to delete.
   let contact2 = create_contact("test2@example.com", "Leonard Shelby", true);
   let contact3 = create_contact("test3@example.com", "John Edward Gammell", true);
   let contact4 = create_contact("test4@example.com", "Natalie", true);
 
   let toDelete = [contact2, contact3, contact4];
 
   let bundle = Services.strings
-                       .createBundle("chrome://messenger/locale/addressbook/addressBook.properties")
+                       .createBundle("chrome://messenger/locale/addressbook/addressBook.properties");
   let confirmMultiple = bundle.GetStringFromName("confirmDelete2orMoreContacts");
   confirmMultiple = confirmMultiple.replace(/.*;/, "").replace("#1", "3");
 
   // Add some contacts to the address book
   load_contacts_into_address_book(addrBook1, toDelete);
   select_address_book(addrBook1);
 
   let totalEntries = abController.window.gAbView.rowCount;
@@ -269,17 +272,16 @@ function test_deleting_contacts_causes_c
 function test_deleting_mailing_lists() {
   // Register our Mock Prompt Service
   gMockPromptService.register();
 
   // Create a new mailing list, and add it to one of our
   // address books
   let newList = create_mailing_list("Delete Me!");
   let addedList = addrBook1.addMailList(newList);
-  let mlURI = addedList.URI;
 
   // Make sure it got added.
   assert_true(addrBook1.hasDirectory(addedList));
 
   // Let's click "cancel" on the confirm dialog box
   // first.
   gMockPromptService.returnValue = false;
 
@@ -311,33 +313,30 @@ function test_deleting_mailing_lists() {
   gMockPromptService.unregister();
 }
 
 
 /* Tests that we can send mail to a mailing list by selecting the
  * mailing list in the tree, and clicking "Write"
  */
 function test_writing_to_mailing_list() {
-
   // Create a new mailing list, and add it to one of our
   // address books
   let newList = create_mailing_list("Some Mailing List");
   let addedList = addrBook1.addMailList(newList);
-  let mlURI = addedList.URI;
 
   // Create some contacts that we'll try to contact
   let contacts = [create_contact("test2@example.com", "Leonard Shelby", true),
-                  create_contact("test3@example.com", "John Edward Gammell",
-                                 true),
-                  create_contact("test4@example.com", "Natalie", true),];
+                  create_contact("test3@example.com", "John Edward Gammell", true),
+                  create_contact("test4@example.com", "Natalie", true)];
 
   load_contacts_into_mailing_list(addedList, contacts);
 
   // Ensure that addrBook1 is expanded
-  set_address_book_expanded(addrBook1);
+  set_address_books_expanded(addrBook1);
 
   // Now select the mailing list in the tree...
   select_address_book(addedList);
 
   // Focus it...
   abController.window.gDirTree.focus();
 
   // Assuming we've made it this far, now we just plan for the compose
--- a/mail/test/mozmill/addrbook/test-update-mailing-list.js
+++ b/mail/test/mozmill/addrbook/test-update-mailing-list.js
@@ -4,27 +4,28 @@
 
 /**
  * Tests that if a contact's address is updated, then the address is also
  * updated in mailing lists that that contact belongs to.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-update-mailing-list';
+/* import-globals-from ../shared-modules/test-address-book-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['address-book-helpers',
-                       'folder-display-helpers',];
+var MODULE_NAME = "test-update-mailing-list";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["address-book-helpers", "folder-display-helpers"];
 
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 function setupModule(module) {
-  collector.getModule('folder-display-helpers').installInto(module);
-  collector.getModule('address-book-helpers').installInto(module);
+  collector.getModule("folder-display-helpers").installInto(module);
+  collector.getModule("address-book-helpers").installInto(module);
 }
 
 function test_contact_in_mailing_list_updated() {
   const kOldAddress = "before@example.com";
   const kNewAddress = "after@example.com";
 
   // Create some address book to work with...
   let ab = create_mork_address_book("Some Address Book");
@@ -38,17 +39,17 @@ function test_contact_in_mailing_list_up
   ml.addressLists.appendElement(contact);
   ml = ab.addMailList(ml);
 
   contact = ml.addressLists.queryElementAt(0, Ci.nsIAbCard);
 
   // Open the address book, select our contact...
   let abw = open_address_book_window(mc);
   select_address_book(ab);
-  select_contact(contact);
+  select_contacts(contact);
 
   // Change the primary email address of the contact...
   edit_selected_contact(abw, function(ecw) {
     ecw.e("PrimaryEmail").value = kNewAddress;
     accept_contact_changes(ecw);
   });
 
   // Because the current address book is kind of lame, in order
--- a/mail/test/mozmill/attachment/test-attachment-events.js
+++ b/mail/test/mozmill/attachment/test-attachment-events.js
@@ -3,25 +3,33 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Ensures that attachment events are fired properly
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-attachment-events';
+/* import-globals-from ../shared-modules/test-attachment-helpers.js */
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-observer-helpers.js */
+/* import-globals-from ../shared-modules/test-prompt-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers',
-                       'compose-helpers',
-                       'window-helpers',
-                       'attachment-helpers',
-                       'observer-helpers',
-                       'prompt-helpers'];
+var MODULE_NAME = "test-attachment-events";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "attachment-helpers",
+  "observer-helpers",
+  "prompt-helpers",
+];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {fixIterator} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 
 var kAttachmentsAdded = "attachments-added";
 var kAttachmentsRemoved = "attachments-removed";
@@ -43,46 +51,46 @@ function setupModule(module) {
  */
 function test_attachments_added_on_single() {
   // Prepare to listen for attachments-added
   let eventCount = 0;
   let lastEvent;
   let listener = function(event) {
     eventCount++;
     lastEvent = event;
-  }
+  };
 
   // Open up the compose window
   let cw = open_compose_new_mail(mc);
   cw.e("attachmentBucket").addEventListener(kAttachmentsAdded, listener);
 
   // Attach a single file
-  add_attachment(cw, "http://www.example.com/1", 0, false);
+  add_attachments(cw, "http://www.example.com/1", 0, false);
 
   // Make sure we only saw the event once
   assert_equals(1, eventCount);
 
   // Make sure that we were passed the right subject
   let subjects = lastEvent.detail;
   assert_true(subjects instanceof Ci.nsIMutableArray);
   assert_equals("http://www.example.com/1",
                 subjects.queryElementAt(0, Ci.nsIMsgAttachment).url);
 
   // Make sure that we can get that event again if we
   // attach more files.
-  add_attachment(cw, "http://www.example.com/2", 0, false);
+  add_attachments(cw, "http://www.example.com/2", 0, false);
   assert_equals(2, eventCount);
   subjects = lastEvent.detail;
   assert_true(subjects instanceof Ci.nsIMutableArray);
   assert_equals("http://www.example.com/2",
                 subjects.queryElementAt(0, Ci.nsIMsgAttachment).url);
 
   // And check that we don't receive the event if we try to attach a file
   // that's already attached.
-  add_attachment(cw, "http://www.example.com/2", null, false);
+  add_attachments(cw, "http://www.example.com/2", null, false);
   assert_equals(2, eventCount);
 
   cw.e("attachmentBucket").removeEventListener(kAttachmentsAdded, listener);
   close_compose_window(cw);
 }
 
 /**
  * Test that the attachments-added event is fired when we add a series
@@ -90,17 +98,17 @@ function test_attachments_added_on_singl
  */
 function test_attachments_added_on_multiple() {
   // Prepare to listen for attachments-added
   let eventCount = 0;
   let lastEvent;
   let listener = function(event) {
     eventCount++;
     lastEvent = event;
-  }
+  };
 
   // Prepare the attachments - we store the names in attachmentNames to
   // make sure that we observed the right event subjects later on.
   let attachmentUrls = ["http://www.example.com/1",
                         "http://www.example.com/2"];
 
   // Open the compose window and add the attachments
   let cw = open_compose_new_mail(mc);
@@ -161,46 +169,44 @@ function test_attachments_added_on_multi
  */
 function test_attachments_removed_on_single() {
   // Prepare to listen for attachments-removed
   let eventCount = 0;
   let lastEvent;
   let listener = function(event) {
     eventCount++;
     lastEvent = event;
-  }
+  };
 
 
   // Open up the compose window, attach a file...
   let cw = open_compose_new_mail(mc);
   cw.e("attachmentBucket").addEventListener(kAttachmentsRemoved, listener);
 
-  add_attachment(cw, "http://www.example.com/1");
+  add_attachments(cw, "http://www.example.com/1");
 
   // Now select that attachment and delete it
-  let removedAttachmentItem = select_attachments(cw, 0);
+  select_attachments(cw, 0);
   // We need to hold a reference to removedAttachment here because
   // the delete routine nulls it out from the attachmentitem.
-  let removedAttachment = removedAttachmentItem[0].attachment;
   cw.window.goDoCommand("cmd_delete");
   // Make sure we saw the event
   assert_equals(1, eventCount);
   // And make sure we were passed the right attachment item as the
   // subject.
   let subjects = lastEvent.detail;
   assert_true(subjects instanceof Ci.nsIMutableArray);
   assert_equals(1, subjects.length);
   assert_equals(subjects.queryElementAt(0, Ci.nsIMsgAttachment).url,
                 "http://www.example.com/1");
 
   // Ok, let's attach it again, and remove it again to ensure that
   // we still see the event.
-  add_attachment(cw, "http://www.example.com/2");
-  removedAttachmentItem = select_attachments(cw, 0);
-  removedAttachment = removedAttachmentItem[0].attachment;
+  add_attachments(cw, "http://www.example.com/2");
+  select_attachments(cw, 0);
   cw.window.goDoCommand("cmd_delete");
 
   assert_equals(2, eventCount);
   subjects = lastEvent.detail;
   assert_true(subjects instanceof Ci.nsIMutableArray);
   assert_equals(1, subjects.length);
   assert_equals(subjects.queryElementAt(0, Ci.nsIMsgAttachment).url,
                 "http://www.example.com/2");
@@ -215,17 +221,17 @@ function test_attachments_removed_on_sin
  */
 function test_attachments_removed_on_multiple() {
   // Prepare to listen for attachments-removed
   let eventCount = 0;
   let lastEvent;
   let listener = function(event) {
     eventCount++;
     lastEvent = event;
-  }
+  };
 
   // Open up the compose window and attach some files...
   let cw = open_compose_new_mail(mc);
   cw.e("attachmentBucket").addEventListener(kAttachmentsRemoved, listener);
 
   add_attachments(cw, ["http://www.example.com/1",
                        "http://www.example.com/2",
                        "http://www.example.com/3"]);
@@ -266,21 +272,19 @@ function test_attachments_removed_on_mul
 
 /**
  * Test that we don't see the attachments-removed event if no attachments
  * are selected when hitting "Delete"
  */
 function test_no_attachments_removed_on_none() {
   // Prepare to listen for attachments-removed
   let eventCount = 0;
-  let lastEvent;
   let listener = function(event) {
     eventCount++;
-    lastEvent = event;
-  }
+  };
 
   // Open the compose window and add some attachments.
   let cw = open_compose_new_mail(mc);
   cw.e("attachmentBucket").addEventListener(kAttachmentsRemoved, listener);
 
   add_attachments(cw, ["http://www.example.com/1",
                        "http://www.example.com/2",
                        "http://www.example.com/3"]);
@@ -307,17 +311,17 @@ function test_attachment_renamed() {
   const kRenameTo3 = "Renamed-3";
 
   // Prepare to listen for attachment-renamed
   let eventCount = 0;
   let lastEvent;
   let listener = function(event) {
     eventCount++;
     lastEvent = event;
-  }
+  };
 
   // Renaming a file brings up a Prompt, so we'll mock the Prompt Service
   gMockPromptService.reset();
   gMockPromptService.register();
   // The inoutValue is used to set the attachment name
   gMockPromptService.inoutValue = kRenameTo1;
   gMockPromptService.returnValue = true;
 
@@ -387,21 +391,19 @@ function test_attachment_renamed() {
 
 /**
  * Test that the attachment-renamed event is not fired if we set the
  * filename to be blank.
  */
 function test_no_attachment_renamed_on_blank() {
   // Prepare to listen for attachment-renamed
   let eventCount = 0;
-  let lastEvent;
   let listener = function(event) {
     eventCount++;
-    lastEvent = event;
-  }
+  };
 
   // Register the Mock Prompt Service to return the empty string when
   // prompted.
   gMockPromptService.reset();
   gMockPromptService.register();
   gMockPromptService.inoutValue = "";
   gMockPromptService.returnValue = true;
 
--- a/mail/test/mozmill/attachment/test-attachment-in-plain-msg.js
+++ b/mail/test/mozmill/attachment/test-attachment-in-plain-msg.js
@@ -1,21 +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/. */
 
-// make SOLO_TEST=attachment/test-attachment-in-plain-msg.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-dom-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-attachment-in-plain-msg";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "dom-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "dom-helpers"];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 }
--- a/mail/test/mozmill/attachment/test-attachment-menus.js
+++ b/mail/test/mozmill/attachment/test-attachment-menus.js
@@ -1,19 +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/. */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-attachment-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-attachment-menus";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "attachment-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "attachment-helpers"];
 
 var folder;
 var messenger;
 var epsilon;
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
@@ -291,68 +293,62 @@ function assert_enabled(id, enabled) {
  * Check that the menu states in the "save" toolbar button are correct.
  *
  * @param expected a dictionary containing the expected states
  */
 function check_toolbar_menu_states_single(expected) {
   assert_shown("attachmentSaveAllSingle", true);
   assert_shown("attachmentSaveAllMultiple", false);
 
-  if (expected.save == false) {
+  if (expected.save === false) {
     assert_enabled("attachmentSaveAllSingle", false);
-  }
-  else {
+  } else {
     assert_enabled("attachmentSaveAllSingle", true);
     mc.click(mc.aid("attachmentSaveAllSingle",
                     {"class": "toolbarbutton-menubutton-dropmarker"}));
     wait_for_popup_to_open(mc.e("attachmentSaveAllSingleMenu"));
 
     try {
-      assert_enabled("button-openAttachment",   expected.open);
-      assert_enabled("button-saveAttachment",   expected.save);
+      assert_enabled("button-openAttachment", expected.open);
+      assert_enabled("button-saveAttachment", expected.save);
       assert_enabled("button-detachAttachment", expected.detach);
       assert_enabled("button-deleteAttachment", expected.delete_);
-    }
-    catch(e) {
+    } catch (e) {
       throw e;
-    }
-    finally {
+    } finally {
       close_popup(mc, mc.eid("attachmentSaveAllSingleMenu"));
     }
   }
 }
 
 /**
  * Check that the menu states in the "save all" toolbar button are correct.
  *
  * @param expected a dictionary containing the expected states
  */
 function check_toolbar_menu_states_multiple(expected) {
   assert_shown("attachmentSaveAllSingle", false);
   assert_shown("attachmentSaveAllMultiple", true);
 
-  if (expected.save == false) {
+  if (expected.save === false) {
     assert_enabled("attachmentSaveAllMultiple", false);
-  }
-  else {
+  } else {
     assert_enabled("attachmentSaveAllMultiple", true);
     mc.click(mc.aid("attachmentSaveAllMultiple",
                     {"class": "toolbarbutton-menubutton-dropmarker"}));
     wait_for_popup_to_open(mc.e("attachmentSaveAllMultipleMenu"));
 
     try {
-      assert_enabled("button-openAllAttachments",   expected.open);
-      assert_enabled("button-saveAllAttachments",   expected.save);
+      assert_enabled("button-openAllAttachments", expected.open);
+      assert_enabled("button-saveAllAttachments", expected.save);
       assert_enabled("button-detachAllAttachments", expected.detach);
       assert_enabled("button-deleteAllAttachments", expected.delete_);
-    }
-    catch(e) {
+    } catch (e) {
       throw e;
-    }
-    finally {
+    } finally {
       close_popup(mc, mc.eid("attachmentSaveAllMultipleMenu"));
     }
   }
 }
 
 /**
  * Check that the menu states in the single item context menu are correct
  *
@@ -372,31 +368,29 @@ function check_menu_states_single(index,
                                                     "attachmentcell-nameselection");
 
   attachmentList.selectItem(node);
   let menu = mc.getMenu("#attachmentItemContext");
   menu.open(new elib.Elem(clickable));
   wait_for_popup_to_open(mc.e("attachmentItemContext"));
 
   try {
-    assert_shown("context-openAttachment",   true);
-    assert_shown("context-saveAttachment",   true);
-    assert_shown("context-menu-separator",   true);
+    assert_shown("context-openAttachment", true);
+    assert_shown("context-saveAttachment", true);
+    assert_shown("context-menu-separator", true);
     assert_shown("context-detachAttachment", true);
     assert_shown("context-deleteAttachment", true);
 
-    assert_enabled("context-openAttachment",   expected.open);
-    assert_enabled("context-saveAttachment",   expected.save);
+    assert_enabled("context-openAttachment", expected.open);
+    assert_enabled("context-saveAttachment", expected.save);
     assert_enabled("context-detachAttachment", expected.detach);
     assert_enabled("context-deleteAttachment", expected.delete_);
-  }
-  catch(e) {
+  } catch (e) {
     throw e;
-  }
-  finally {
+  } finally {
     menu.close();
   }
 }
 
 /**
  * Check that the menu states in the all items context menu are correct
  *
  * @param expected a dictionary containing the expected states
@@ -404,38 +398,36 @@ function check_menu_states_single(index,
 function check_menu_states_all(expected) {
   // Using a rightClick here is unsafe, because we need to hit the empty area
   // beside the attachment items and that seems to be different per platform.
   // Using DOM methods to open the popup works fine.
   mc.e("attachmentListContext").openPopup(mc.e("attachmentList"));
   wait_for_popup_to_open(mc.e("attachmentListContext"));
 
   try {
-    assert_shown("context-openAllAttachments",   true);
-    assert_shown("context-saveAllAttachments",   true);
-    assert_shown("context-menu-separator-all",   true);
+    assert_shown("context-openAllAttachments", true);
+    assert_shown("context-saveAllAttachments", true);
+    assert_shown("context-menu-separator-all", true);
     assert_shown("context-detachAllAttachments", true);
     assert_shown("context-deleteAllAttachments", true);
 
-    assert_enabled("context-openAllAttachments",   expected.open);
-    assert_enabled("context-saveAllAttachments",   expected.save);
+    assert_enabled("context-openAllAttachments", expected.open);
+    assert_enabled("context-saveAllAttachments", expected.save);
     assert_enabled("context-detachAllAttachments", expected.detach);
     assert_enabled("context-deleteAllAttachments", expected.delete_);
-  }
-  catch(e) {
+  } catch (e) {
     throw e;
-  }
-  finally {
+  } finally {
     close_popup(mc, mc.eid("attachmentListContext"));
   }
 }
 
 function help_test_attachment_menus(index) {
   be_in_folder(folder);
-  let curMessage = select_click_row(index);
+  select_click_row(index);
   let expectedStates = messages[index].menuStates;
 
   mc.window.toggleAttachmentList(true);
 
   for (let attachment of mc.window.currentAttachments) {
     // Ensure all attachments are resolved; other than external they already
     // should be.
     attachment.isEmpty();
--- a/mail/test/mozmill/attachment/test-attachment-size.js
+++ b/mail/test/mozmill/attachment/test-attachment-size.js
@@ -1,19 +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/. */
 
 "use strict";
 
-var MODULE_NAME = 'test-attachment-size';
+/* import-globals-from ../shared-modules/test-attachment-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
-                       'attachment-helpers'];
+var MODULE_NAME = "test-attachment-size";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "attachment-helpers"];
 
 var folder;
 var messenger;
 var epsilon;
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
 
@@ -21,206 +23,206 @@ var textAttachment =
   "Can't make the frug contest, Helen; stomach's upset. I'll fix you, " +
   "Ubik! Ubik drops you back in the thick of things fast. Taken as " +
   "directed, Ubik speeds relief to head and stomach. Remember: Ubik is " +
   "only seconds away. Avoid prolonged use.";
 
 var binaryAttachment = textAttachment;
 
 var imageAttachment =
-  'iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS' +
-  'FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA' +
-  'A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe' +
-  'SNQAAlmAY+71EgFoAAAAASUVORK5CYII=';
+  "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS" +
+  "FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA" +
+  "A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe" +
+  "SNQAAlmAY+71EgFoAAAAASUVORK5CYII=";
 var imageSize = 188;
 
 var vcardAttachment =
-  'YmVnaW46dmNhcmQNCmZuOkppbSBCb2INCm46Qm9iO0ppbQ0KZW1haWw7aW50ZXJuZXQ6Zm9v' +
-  'QGJhci5jb20NCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K';
+  "YmVnaW46dmNhcmQNCmZuOkppbSBCb2INCm46Qm9iO0ppbQ0KZW1haWw7aW50ZXJuZXQ6Zm9v" +
+  "QGJhci5jb20NCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K";
 
-var detachedName = './attachment.txt';
-var missingName = './nonexistent.txt';
-var deletedName = 'deleted.txt';
+var detachedName = "./attachment.txt";
+var missingName = "./nonexistent.txt";
+var deletedName = "deleted.txt";
 
 // create some messages that have various types of attachments
 var messages = [
-  { name: 'text_attachment',
+  { name: "text_attachment",
     attachments: [{ body: textAttachment,
-                    filename: 'ubik.txt',
-                    format: '' }],
+                    filename: "ubik.txt",
+                    format: "" }],
     attachmentSizes: [textAttachment.length],
     attachmentTotalSize: { size: textAttachment.length, exact: true },
   },
-  { name: 'binary_attachment',
+  { name: "binary_attachment",
     attachments: [{ body: binaryAttachment,
-                    contentType: 'application/x-ubik',
-                    filename: 'ubik',
-                    format: '' }],
+                    contentType: "application/x-ubik",
+                    filename: "ubik",
+                    format: "" }],
     attachmentSizes: [binaryAttachment.length],
     attachmentTotalSize: { size: binaryAttachment.length, exact: true },
   },
-  { name: 'image_attachment',
+  { name: "image_attachment",
     attachments: [{ body: imageAttachment,
-                    contentType: 'image/png',
-                    filename: 'lines.png',
-                    encoding: 'base64',
-                    format: '' }],
+                    contentType: "image/png",
+                    filename: "lines.png",
+                    encoding: "base64",
+                    format: "" }],
     attachmentSizes: [imageSize],
     attachmentTotalSize: { size: imageSize, exact: true },
   },
-  { name: 'detached_attachment',
+  { name: "detached_attachment",
     bodyPart: null,
     // Sizes filled in on message creation.
     attachmentSizes: [null],
     attachmentTotalSize: { size: 0, exact: true },
   },
-  { name: 'detached_attachment_with_missing_file',
+  { name: "detached_attachment_with_missing_file",
     bodyPart: null,
     attachmentSizes: [-1],
     attachmentTotalSize: { size: 0, exact: false },
   },
-  { name: 'deleted_attachment',
+  { name: "deleted_attachment",
     bodyPart: null,
     attachmentSizes: [-1],
     attachmentTotalSize: { size: 0, exact: true },
   },
-  { name: 'multiple_attachments',
+  { name: "multiple_attachments",
     attachments: [{ body: textAttachment,
-                    filename: 'ubik.txt',
-                    format: '' },
+                    filename: "ubik.txt",
+                    format: "" },
                   { body: binaryAttachment,
-                    contentType: 'application/x-ubik',
-                    filename: 'ubik',
-                    format: '' }],
+                    contentType: "application/x-ubik",
+                    filename: "ubik",
+                    format: "" }],
     attachmentSizes: [textAttachment.length, binaryAttachment.length],
     attachmentTotalSize: { size: textAttachment.length +
                                  binaryAttachment.length,
                            exact: true },
   },
   // vCards should be ignored in the attachment list; make sure we do so
   // properly.
-  { name: 'multiple_attachments_one_vcard',
+  { name: "multiple_attachments_one_vcard",
     attachments: [{ body: textAttachment,
-                    filename: 'ubik.txt',
-                    format: '' },
+                    filename: "ubik.txt",
+                    format: "" },
                   { body: vcardAttachment,
-                    contentType: 'text/x-vcard',
-                    filename: 'ubik.vcf',
-                    encoding: 'base64',
-                    format: '' }],
+                    contentType: "text/x-vcard",
+                    filename: "ubik.vcf",
+                    encoding: "base64",
+                    format: "" }],
     attachmentSizes: [textAttachment.length],
     attachmentTotalSize: { size: textAttachment.length,
                            exact: true },
   },
-  { name: 'multiple_attachments_one_detached',
+  { name: "multiple_attachments_one_detached",
     bodyPart: null,
     attachments: [{ body: textAttachment,
-                    filename: 'ubik.txt',
-                    format: '' }],
+                    filename: "ubik.txt",
+                    format: "" }],
     attachmentSizes: [null, textAttachment.length],
     attachmentTotalSize: { size: textAttachment.length, exact: true },
   },
-  { name: 'multiple_attachments_one_detached_with_missing_file',
+  { name: "multiple_attachments_one_detached_with_missing_file",
     bodyPart: null,
     attachments: [{ body: textAttachment,
-                    filename: 'ubik.txt',
-                    format: '' }],
+                    filename: "ubik.txt",
+                    format: "" }],
     attachmentSizes: [-1, textAttachment.length],
     attachmentTotalSize: { size: textAttachment.length, exact: false },
   },
-  { name: 'multiple_attachments_one_deleted',
+  { name: "multiple_attachments_one_deleted",
     bodyPart: null,
     attachments: [{ body: textAttachment,
-                    filename: 'ubik.txt',
-                    format: '' }],
+                    filename: "ubik.txt",
+                    format: "" }],
     attachmentSizes: [-1, textAttachment.length],
     attachmentTotalSize: { size: textAttachment.length, exact: true },
   },
   // this is an attached message that itself has an attachment
   {
-    name: 'attached_message_with_attachment',
+    name: "attached_message_with_attachment",
     bodyPart: null,
     attachmentSizes: [-1, textAttachment.length],
     attachmentTotalSize: { size: 0, exact: true },
   },
 ];
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
-  messenger = Cc['@mozilla.org/messenger;1'].createInstance(Ci.nsIMessenger);
+  messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
 
   /* Today's gory details (thanks to Jonathan Protzenko): libmime somehow
    * counts the trailing newline for an attachment MIME part. Most of the time,
    * assuming attachment has N bytes (no matter what's inside, newlines or
    * not), libmime will return N + 1 bytes. On Linux and Mac, this always
    * holds. However, on Windows, if the attachment is not encoded (that is, is
    * inline text), libmime will return N + 2 bytes.
    */
-  epsilon = ('@mozilla.org/windows-registry-key;1' in Cc) ? 4 : 2;
+  epsilon = ("@mozilla.org/windows-registry-key;1" in Cc) ? 4 : 2;
 
   // set up our detached/deleted attachments
   var thisFilePath = os.getFileForPath(__file__);
 
   var detachedFile = os.getFileForPath(os.abspath(detachedName, thisFilePath));
   var detached = create_body_part(
-    'Here is a file',
-    [create_detached_attachment(detachedFile, 'text/plain')]
+    "Here is a file",
+    [create_detached_attachment(detachedFile, "text/plain")]
   );
 
   var missingFile = os.getFileForPath(os.abspath(missingName, thisFilePath));
   var missing = create_body_part(
-    'Here is a file (but you deleted the external file, you silly oaf!)',
-    [create_detached_attachment(missingFile, 'text/plain')]
+    "Here is a file (but you deleted the external file, you silly oaf!)",
+    [create_detached_attachment(missingFile, "text/plain")]
   );
 
   var deleted = create_body_part(
-    'Here is a file that you deleted',
-    [create_deleted_attachment(deletedName, 'text/plain')]
+    "Here is a file that you deleted",
+    [create_deleted_attachment(deletedName, "text/plain")]
   );
 
   var attachedMessage = msgGen.makeMessage({
     body: { body: textAttachment },
     attachments: [{ body: textAttachment,
-                    filename: 'ubik.txt',
-                    format: '' }],
+                    filename: "ubik.txt",
+                    format: "" }],
   });
 
   /* Much like the above comment, libmime counts bytes differently on Windows,
    * where it counts newlines (\r\n) as 2 bytes. Mac and Linux treats them as
    * 1 byte.
    */
   var attachedMessageLength;
   if (epsilon == 4) // Windows
     attachedMessageLength = attachedMessage.toMessageString().length;
   else // Mac/Linux
     attachedMessageLength = attachedMessage.toMessageString()
                                            .replace(/\r\n/g, "\n").length;
 
-  folder = create_folder('AttachmentSizeA');
+  folder = create_folder("AttachmentSizeA");
   for (let i = 0; i < messages.length; i++) {
     // First, add any missing info to the message object.
-    switch(messages[i].name) {
-      case 'detached_attachment':
-      case 'multiple_attachments_one_detached':
+    switch (messages[i].name) {
+      case "detached_attachment":
+      case "multiple_attachments_one_detached":
         messages[i].bodyPart = detached;
         messages[i].attachmentSizes[0] = detachedFile.fileSize;
         messages[i].attachmentTotalSize.size += detachedFile.fileSize;
         break;
-      case 'detached_attachment_with_missing_file':
-      case 'multiple_attachments_one_detached_with_missing_file':
+      case "detached_attachment_with_missing_file":
+      case "multiple_attachments_one_detached_with_missing_file":
         messages[i].bodyPart = missing;
         break;
-      case 'deleted_attachment':
-      case 'multiple_attachments_one_deleted':
+      case "deleted_attachment":
+      case "multiple_attachments_one_deleted":
         messages[i].bodyPart = deleted;
         break;
-      case 'attached_message_with_attachment':
+      case "attached_message_with_attachment":
         messages[i].bodyPart = new SyntheticPartMultiMixed([
           new SyntheticPartLeaf("I am text!", { contentType: "text/plain" }),
           attachedMessage,
         ]);
         messages[i].attachmentSizes[0] = attachedMessageLength;
         messages[i].attachmentTotalSize.size += attachedMessageLength;
         break;
     }
@@ -230,108 +232,108 @@ function setupModule(module) {
 }
 
 /**
  * Make sure that the attachment's size is what we expect
  * @param index the attachment's index, starting at 0
  * @param expectedSize the expected size of the attachment, in bytes
  */
 function check_attachment_size(index, expectedSize) {
-  let list = mc.e('attachmentList');
+  let list = mc.e("attachmentList");
   let node = list.querySelectorAll("richlistitem.attachmentItem")[index];
 
   // First, let's check that the attachment size is correct
   let size = node.attachment.size;
   if (Math.abs(size - expectedSize) > epsilon)
-    throw new Error('Reported attachment size ('+size+') not within epsilon ' +
-                    'of actual attachment size ('+expectedSize+')');
+    throw new Error("Reported attachment size (" + size + ") not within epsilon " +
+                    "of actual attachment size (" + expectedSize + ")");
 
   // Next, make sure that the formatted size in the label is correct
-  let formattedSize = node.getAttribute('size');
+  let formattedSize = node.getAttribute("size");
   let expectedFormattedSize = messenger.formatFileSize(size);
   if (formattedSize != expectedFormattedSize)
-    throw new Error('Formatted attachment size ('+formattedSize+') does not ' +
-                    'match expected value ('+expectedFormattedSize+')');
+    throw new Error("Formatted attachment size (" + formattedSize + ") does not " +
+                    "match expected value (" + expectedFormattedSize + ")");
 }
 
 /**
  * Make sure that the attachment's size is not displayed
  * @param index the attachment's index, starting at 0
  */
 function check_no_attachment_size(index) {
-  let list = mc.e('attachmentList');
+  let list = mc.e("attachmentList");
   let node = list.querySelectorAll("richlistitem.attachmentItem")[index];
 
   if (node.attachment.size != -1)
-    throw new Error('attachmentSize attribute of deleted attachment should ' +
-                    'be -1!');
+    throw new Error("attachmentSize attribute of deleted attachment should " +
+                    "be -1!");
 
   // If there's no size, the size attribute is the zero-width space.
-  let nodeSize = node.getAttribute('size');
-  mc.window.console.log("check_no_attachment_size: node.size->"+nodeSize+"<-");
-  if (nodeSize != '\u200b' && nodeSize != '')
-    throw new Error('Attachment size should not be displayed!');
+  let nodeSize = node.getAttribute("size");
+  mc.window.console.log("check_no_attachment_size: node.size->" + nodeSize + "<-");
+  if (nodeSize != "\u200b" && nodeSize != "")
+    throw new Error("Attachment size should not be displayed!");
 }
 
 /**
  * Make sure that the total size of all attachments is what we expect.
  * @param count the expected number of attachments
  * @param expectedSize the expected size in bytes of all the attachments
  * @param exact true if the size of all attachments is known, false otherwise
  */
 function check_total_attachment_size(count, expectedSize, exact) {
-  let list = mc.e('attachmentList');
+  let list = mc.e("attachmentList");
   let nodes = list.querySelectorAll("richlistitem.attachmentItem");
-  let sizeNode = mc.e('attachmentSize');
+  let sizeNode = mc.e("attachmentSize");
 
   if (nodes.length != count)
-    throw new Error('Saw '+nodes.length+' attachments, but expected '+count);
+    throw new Error("Saw " + nodes.length + " attachments, but expected " + count);
 
   let lastPartID;
   let size = 0;
   for (let i = 0; i < nodes.length; i++) {
     let attachment = nodes[i].attachment;
     if (!lastPartID || attachment.partID.indexOf(lastPartID) != 0) {
       lastPartID = attachment.partID;
       let currSize = attachment.size;
       if (currSize > 0 && !isNaN(currSize))
         size += Number(currSize);
     }
   }
 
-  if (Math.abs(size - expectedSize) > epsilon*count)
-    throw new Error('Reported attachment size ('+size+') not within epsilon ' +
-                    'of actual attachment size ('+expectedSize+')');
+  if (Math.abs(size - expectedSize) > epsilon * count)
+    throw new Error("Reported attachment size (" + size + ") not within epsilon " +
+                    "of actual attachment size (" + expectedSize + ")");
 
   // Next, make sure that the formatted size in the label is correct
-  let formattedSize = sizeNode.getAttribute('value');
+  let formattedSize = sizeNode.getAttribute("value");
   let expectedFormattedSize = messenger.formatFileSize(size);
-  let messengerBundle = mc.window.document.getElementById('bundle_messenger');
+  let messengerBundle = mc.window.document.getElementById("bundle_messenger");
 
   if (!exact) {
     if (size == 0)
       expectedFormattedSize = messengerBundle.getString(
-        'attachmentSizeUnknown');
+        "attachmentSizeUnknown");
     else
       expectedFormattedSize = messengerBundle.getFormattedString(
-        'attachmentSizeAtLeast', [expectedFormattedSize]);
+        "attachmentSizeAtLeast", [expectedFormattedSize]);
   }
   if (formattedSize != expectedFormattedSize)
-    throw new Error('Formatted attachment size ('+formattedSize+') does not ' +
-                    'match expected value ('+expectedFormattedSize+')');
+    throw new Error("Formatted attachment size (" + formattedSize + ") does not " +
+                    "match expected value (" + expectedFormattedSize + ")");
 }
 
 /**
  * Make sure that the individual and total attachment sizes for this message
  * are as expected
  * @param index the index of the message to check in the thread pane
  */
 function help_test_attachment_size(index) {
   be_in_folder(folder);
-  let curMessage = select_click_row(index);
+  select_click_row(index);
   let expectedSizes = messages[index].attachmentSizes;
 
   mc.window.toggleAttachmentList(true);
 
   // Test funcs are generated in the global scope, and there isn't a way to
   // do this async (like within an async add_task in xpcshell) so await can
   // force serial execution of each test. Wait here for the fetch() to complete.
   controller.sleep(2000);
--- a/mail/test/mozmill/attachment/test-attachment.js
+++ b/mail/test/mozmill/attachment/test-attachment.js
@@ -3,21 +3,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Checks various attachments display correctly
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-attachment';
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
-                       'window-helpers'];
+var MODULE_NAME = "test-attachment";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var EventUtils = ChromeUtils.import("chrome://mozmill/content/stdlib/EventUtils.jsm");
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder;
 var messages;
 
@@ -27,111 +29,111 @@ var textAttachment =
   "of human values and compassion and simple warmth will return, and when " +
   "that happens someone like myself who has gone through an ordeal and who " +
   "genuinely needs hot coffee to pick him up and keep him functioning when " +
   "he has to function will get the hot coffee whether he happens to have a " +
   "poscred readily available or not.";
 
 var binaryAttachment = textAttachment;
 
-var setupModule = function (module) {
-  let fdh = collector.getModule('folder-display-helpers');
+function setupModule(module) {
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
-  let composeHelper = collector.getModule('compose-helpers');
+  let composeHelper = collector.getModule("compose-helpers");
   composeHelper.installInto(module);
 
   folder = create_folder("AttachmentA");
 
   var attachedMessage = msgGen.makeMessage({
     body: { body: "I'm an attached email!" },
     attachments: [{ body: textAttachment,
-                    filename: 'inner attachment.txt',
-                    format: '' }],
+                    filename: "inner attachment.txt",
+                    format: "" }],
   });
 
   // create some messages that have various types of attachments
   messages = [
     // no attachment
     {},
     // text attachment
     { attachments: [{ body: textAttachment,
-                      filename: 'ubik.txt',
-                      format: '' }],
+                      filename: "ubik.txt",
+                      format: "" }],
     },
     // binary attachment; filename has 9 "1"s, which should be just within the
     // limit for showing the original name
     { attachments: [{ body: binaryAttachment,
-                      contentType: 'application/octet-stream',
-                      filename: 'ubik-111111111.xxyyzz',
-                      format: '' }],
+                      contentType: "application/octet-stream",
+                      filename: "ubik-111111111.xxyyzz",
+                      format: "" }],
     },
     // multiple attachments
     { attachments: [{ body: textAttachment,
-                      filename: 'ubik.txt',
-                      format: '' },
+                      filename: "ubik.txt",
+                      format: "" },
                     { body: binaryAttachment,
-                      contentType: 'application/octet-stream',
-                      filename: 'ubik.xxyyzz',
-                      format: '' }],
+                      contentType: "application/octet-stream",
+                      filename: "ubik.xxyyzz",
+                      format: "" }],
     },
     // attachment with a long name; the attachment bar should crop this
     { attachments: [{ body: textAttachment,
-                      filename: 'this-is-a-file-with-an-extremely-long-name-' +
-                                'that-seems-to-go-on-forever-seriously-you-' +
-                                'would-not-believe-how-long-this-name-is-it-' +
-                                'surely-exceeds-the-maximum-filename-length-' +
-                                'for-most-filesystems.txt',
-                      format: '' }],
+                      filename: "this-is-a-file-with-an-extremely-long-name-" +
+                                "that-seems-to-go-on-forever-seriously-you-" +
+                                "would-not-believe-how-long-this-name-is-it-" +
+                                "surely-exceeds-the-maximum-filename-length-" +
+                                "for-most-filesystems.txt",
+                      format: "" }],
     },
     // a message with a text attachment and an email attachment, which in turn
     // has its own text attachment
     {
       bodyPart: new SyntheticPartMultiMixed([
         new SyntheticPartLeaf("I'm a message!"),
         new SyntheticPartLeaf(textAttachment,
-                              { filename: 'outer attachment.txt',
-                                contentType: 'text/plain',
-                                format: '' }),
+                              { filename: "outer attachment.txt",
+                                contentType: "text/plain",
+                                format: "" }),
         attachedMessage,
       ]),
     },
     // evilly-named attachment; spaces should be collapsed and trimmed on the
     // ends
     { attachments: [{ body: textAttachment,
-                      contentType: 'application/octet-stream',
-                      filename: ' ubik  .txt                            .evil ',
-                      sanitizedFilename: 'ubik .txt .evil',
-                      format: '' }],
+                      contentType: "application/octet-stream",
+                      filename: " ubik  .txt                            .evil ",
+                      sanitizedFilename: "ubik .txt .evil",
+                      format: "" }],
     },
     // another evilly-named attachment; filename has 10 "_"s, which should be
     // just enough to trigger the sanitizer
     { attachments: [{ body: textAttachment,
-                      contentType: 'application/octet-stream',
-                      filename: 'ubik.txt__________.evil',
-                      sanitizedFilename: 'ubik.txt_…_.evil',
-                      format: '' }],
+                      contentType: "application/octet-stream",
+                      filename: "ubik.txt__________.evil",
+                      sanitizedFilename: "ubik.txt_…_.evil",
+                      format: "" }],
     },
   ];
 
   // Add another evilly-named attachment for Windows tests, to ensure that
   // trailing periods are stripped.
-  if ('@mozilla.org/windows-registry-key;1' in Cc) {
+  if ("@mozilla.org/windows-registry-key;1" in Cc) {
     messages.push({ attachments: [{ body: textAttachment,
-                                    contentType: 'application/octet-stream',
-                                    filename: 'ubik.evil. . . . . . . . . ....',
-                                    sanitizedFilename: 'ubik.evil',
-                                    format: '' }],
+                                    contentType: "application/octet-stream",
+                                    filename: "ubik.evil. . . . . . . . . ....",
+                                    sanitizedFilename: "ubik.evil",
+                                    format: "" }],
                   });
   }
 
   for (let i = 0; i < messages.length; i++)
     add_message_to_folder(folder, create_message(messages[i]));
-};
+}
 
 /**
  * Set the pref to ensure that the attachments pane starts out (un)expanded
  *
  * @param expand true if the attachment pane should start out expanded,
  *        false otherwise
  */
 function ensure_starts_expanded(expand) {
@@ -151,17 +153,17 @@ function test_attachment_view_collapsed(
 function test_attachment_view_expanded() {
   be_in_folder(folder);
 
   for (let i = 1; i < messages.length; i++) {
     select_click_row(i);
     assert_selected_and_displayed(i);
 
     if (mc.e("attachmentView").collapsed)
-      throw new Error("Attachment pane collapsed (on message #"+i+
+      throw new Error("Attachment pane collapsed (on message #" + i +
                       " when it shouldn't be!");
   }
 }
 
 function test_attachment_name_sanitization() {
   be_in_folder(folder);
 
   let attachmentList = mc.e("attachmentList");
@@ -273,17 +275,17 @@ function test_attachment_right_click_sin
   subtest_attachment_right_click("attachmentToggle",
                                  "attachment-toolbar-context-menu");
   subtest_attachment_right_click("attachmentSaveAllSingle",
                                  "attachment-toolbar-context-menu");
   subtest_attachment_right_click("attachmentBar",
                                  "attachment-toolbar-context-menu");
 }
 // Re-enable this test once Bug 617311 is fixed.
-test_attachment_right_click_single.EXCLUDED_PLATFORMS = ['linux'];
+test_attachment_right_click_single.EXCLUDED_PLATFORMS = ["linux"];
 
 function test_attachment_right_click_multiple() {
   be_in_folder(folder);
 
   select_click_row(3);
   assert_selected_and_displayed(3);
 
   subtest_attachment_right_click("attachmentIcon", "attachmentListContext");
@@ -293,36 +295,36 @@ function test_attachment_right_click_mul
   subtest_attachment_right_click("attachmentToggle",
                                  "attachment-toolbar-context-menu");
   subtest_attachment_right_click("attachmentSaveAllMultiple",
                                  "attachment-toolbar-context-menu");
   subtest_attachment_right_click("attachmentBar",
                                  "attachment-toolbar-context-menu");
 }
 // Re-enable this test once Bug 617311 is fixed.
-test_attachment_right_click_multiple.EXCLUDED_PLATFORMS = ['linux'];
+test_attachment_right_click_multiple.EXCLUDED_PLATFORMS = ["linux"];
 
 /**
  * Test that clicking on various elements in the attachment bar toggles the
  * attachment list.
  *
  * @param elementId the id of the element to click
  */
 function subtest_attachment_list_toggle(elementId) {
   let attachmentList = mc.e("attachmentList");
   let element = mc.eid(elementId);
 
   mc.click(element);
   assert_true(!attachmentList.collapsed, "Attachment list should be expanded " +
-              "after clicking "+elementId+"!");
+              "after clicking " + elementId + "!");
   assert_attachment_list_focused();
 
   mc.click(element);
   assert_true(attachmentList.collapsed, "Attachment list should be collapsed " +
-              "after clicking "+elementId+" again!");
+              "after clicking " + elementId + " again!");
   assert_message_pane_focused();
 }
 
 function test_attachment_list_expansion() {
   be_in_folder(folder);
 
   select_click_row(1);
   assert_selected_and_displayed(1);
--- a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js
@@ -3,23 +3,29 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests Filelink attachment item behaviour.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
+/* import-globals-from ../shared-modules/test-attachment-helpers.js */
+
 var MODULE_NAME = "test-cloudfile-attachment-item";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                       "compose-helpers",
-                       "cloudfile-helpers",
-                       "attachment-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "cloudfile-helpers",
+  "attachment-helpers",
+];
 
 var kAttachmentItemContextID = "msgComposeAttachmentItemContext";
 
 var {cloudFileAccounts} = ChromeUtils.import("resource:///modules/cloudFileAccounts.jsm");
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
@@ -61,25 +67,22 @@ function test_upload_cancel_repeat() {
   provider.uploadFile = function(aFile) {
     return new Promise((resolve, reject) => {
       promise = { resolve, reject };
       started = true;
     });
   };
 
   const kAttempts = 3;
-  let cmd = cw.e("cmd_cancelUpload");
-  let menu = cw.getMenu("#" + kAttachmentItemContextID);
-
   for (let i = 0; i < kAttempts; i++) {
     promise = null;
     started = false;
 
     // Select the attachment, and choose to convert it to a Filelink
-    let attachmentitem = select_attachments(cw, 0)[0];
+    select_attachments(cw, 0)[0];
     cw.window.convertSelectedToCloudAttachment(provider);
     cw.waitFor(() => started);
 
     assert_can_cancel_upload(cw, provider, promise, file);
   }
 
   close_compose_window(cw);
 }
@@ -140,21 +143,20 @@ function assert_can_cancel_upload(aContr
     }
   };
 
   // Retrieve the attachment bucket index for the target file...
   let index = get_attachmentitem_index_for_file(aController,
                                                 aTargetFile);
 
   // Select that attachmentitem in the bucket
-  let attachmentitem = select_attachments(aController, index)[0];
+  select_attachments(aController, index)[0];
 
   // Bring up the context menu, and click cancel.
   let cmd = aController.e("cmd_cancelUpload");
-  let menu = aController.getMenu("#" + kAttachmentItemContextID);
   aController.window.updateAttachmentItems();
 
   assert_false(cmd.hidden);
   assert_false(cmd.disabled);
   let cancelItem = aController.eid("composeAttachmentContext_cancelUploadItem");
   aController.click(cancelItem);
 
   // Close the popup, and wait for the cancellation to be complete.
--- a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
@@ -3,25 +3,33 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests Filelink URL insertion behaviours in compose windows.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
+/* import-globals-from ../shared-modules/test-attachment-helpers.js */
+/* import-globals-from ../shared-modules/test-dom-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-cloudfile-attachment-urls";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                       "compose-helpers",
-                       "cloudfile-helpers",
-                       "attachment-helpers",
-                       "dom-helpers",
-                       "window-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "cloudfile-helpers",
+  "attachment-helpers",
+  "dom-helpers",
+  "window-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kUploadedFile = "attachment-uploaded";
 var kHtmlPrefKey = "mail.identity.default.compose_html";
 var kReplyOnTopKey = "mail.identity.default.reply_on_top";
 var kReplyOnTop = 1;
@@ -239,17 +247,17 @@ function test_inserts_linebreak_on_empty
  */
 function subtest_inserts_linebreak_on_empty_compose() {
   gMockFilePicker.returnFiles = collectFiles(kFiles, __file__);
   let provider = new MockCloudfileAccount();
   provider.init("someKey");
   let cw = open_compose_new_mail();
   add_cloud_attachments(cw, provider);
 
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   let br = root.previousSibling;
   assert_equals(br.localName, "br",
                 "The attachment URL containment node should be preceded by " +
                 "a linebreak");
 
   let mailBody = get_compose_body(cw);
 
@@ -270,17 +278,17 @@ function test_inserts_linebreak_on_empty
   gMockFilePicker.returnFiles = collectFiles(kFiles, __file__);
   let provider = new MockCloudfileAccount();
   provider.init("someKey");
   let cw = open_compose_new_mail();
   add_cloud_attachments(cw, provider);
   // wait_for_attachment_urls ensures that the attachment URL containment
   // node is an immediate child of the body of the message, so if this
   // succeeds, then we were not in the signature node.
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   let br = assert_previous_nodes("br", root, 1);
 
   let mailBody = get_compose_body(cw);
   assert_equals(mailBody.firstChild, br,
                 "The linebreak should be the first child of the compose body");
 
   // Now ensure that the node after the attachments is a br, and following
@@ -295,17 +303,17 @@ function test_inserts_linebreak_on_empty
 
   close_window(cw);
 
   Services.prefs.setBoolPref(kHtmlPrefKey, false);
 
   // Now let's try with plaintext mail.
   cw = open_compose_new_mail();
   add_cloud_attachments(cw, provider);
-  [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   br = assert_previous_nodes("br", root, 1);
 
   mailBody = get_compose_body(cw);
   assert_equals(mailBody.firstChild, br,
                 "The linebreak should be the first child of the compose body");
 
   // Now ensure that the node after the attachments is a br, and following
@@ -331,17 +339,17 @@ function test_removing_filelinks_removes
 }
 
 /**
  * Test for test_removing_filelinks_removes_root_node - can be executed
  * on both plaintext and HTML compose windows.
  */
 function subtest_removing_filelinks_removes_root_node() {
   let cw = prepare_some_attachments_and_reply([], kFiles);
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   // Now select the attachments in the attachment bucket, and remove them.
   select_attachments(cw, 0, 1);
   cw.window.goDoCommand("cmd_delete");
 
   // Wait for the root to be removed.
   let mailBody = get_compose_body(cw);
   cw.waitFor(function() {
@@ -370,17 +378,17 @@ function subtest_adding_filelinks_to_wri
   gMockFilePicker.returnFiles = collectFiles(kFiles, __file__);
   let provider = new MockCloudfileAccount();
   provider.init("someKey");
   let cw = open_compose_new_mail();
 
   type_in_composer(cw, kLines);
   add_cloud_attachments(cw, provider);
 
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   let br = root.previousSibling;
   assert_equals(br.localName, "br",
                 "The attachment URL containment node should be preceded by " +
                 "a linebreak");
   br = br.previousSibling;
   assert_equals(br.localName, "br",
                 "The attachment URL containment node should be preceded by " +
@@ -426,17 +434,17 @@ function test_adding_filelinks_to_nonemp
 
 /**
  * Subtest for test_adding_filelinks_to_reply_above for the plaintext composer.
  * Does some special casing for the weird br insertions that happens in
  * various cases.
  */
 function subtest_adding_filelinks_to_reply_above_plaintext(aText, aWithSig) {
   let cw = prepare_some_attachments_and_reply(aText, kFiles);
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   let br;
   if (aText.length)
     br = assert_next_nodes("br", root, 2);
   else
     br = assert_next_nodes("br", root, 1);
 
   let div = br.nextSibling;
@@ -467,17 +475,17 @@ function subtest_adding_filelinks_to_rep
   close_window(cw);
 }
 
 /**
  * Subtest for test_adding_filelinks_to_reply_above for the HTML composer.
  */
 function subtest_adding_filelinks_to_reply_above(aText) {
   let cw = prepare_some_attachments_and_reply(aText, kFiles);
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   // If there's any text written, then there's only a single break between the
   // end of the text and the reply. Otherwise, there are two breaks.
   let br = aText.length > 1 ? assert_next_nodes("br", root, 2)
                             : assert_next_nodes("br", root, 1);
 
   // ... which is followed by a div with a class of "moz-cite-prefix".
   let div = br.nextSibling;
@@ -526,17 +534,17 @@ function test_adding_filelinks_to_nonemp
   Services.prefs.setIntPref(kReplyOnTopKey, oldReplyOnTop);
 }
 
 /**
  * Subtest for test_adding_filelinks_to_reply_below for the HTML composer.
  */
 function subtest_adding_filelinks_to_reply_below(aText, aWithSig) {
   let cw = prepare_some_attachments_and_reply(aText, kFiles);
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
   // So, we should have the root, followed by a br
   let br = root.nextSibling;
   assert_equals(br.localName, "br",
                 "The attachment URL containment node should be followed by " +
                 " a br");
 
   let blockquote;
   if (aText.length) {
@@ -564,17 +572,17 @@ function subtest_adding_filelinks_to_rep
   close_window(cw);
 }
 
 /**
  * Subtest for test_adding_filelinks_to_reply_below for the plaintext composer.
  */
 function subtest_adding_filelinks_to_plaintext_reply_below(aText, aWithSig) {
   let cw = prepare_some_attachments_and_reply(aText, kFiles);
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   let br, span;
 
   assert_next_nodes("br", root, 1);
 
   if (aText.length) {
     br = assert_previous_nodes("br", root, 2);
     // If text was entered, make sure it matches what we expect...
@@ -632,28 +640,28 @@ function test_adding_filelinks_to_forwar
 
 /**
  * Subtest for both test_adding_filelinks_to_empty_forward and
  * test_adding_filelinks_to_forward - ensures that the inserted Filelinks
  * are positioned correctly.
  */
 function subtest_adding_filelinks_to_forward(aText, aWithSig) {
   let cw = prepare_some_attachments_and_forward(aText, kFiles);
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   let br = assert_next_nodes("br", root, 1);
   let forwardDiv = br.nextSibling;
   assert_equals(forwardDiv.localName, "div");
   assert_true(forwardDiv.classList.contains("moz-forward-container"));
 
   if (aText.length) {
     // If there was text typed in, it should be separated from the root by two
     // br's
     let br = assert_previous_nodes("br", root, 2);
-    let textNode = assert_previous_text(br.previousSibling, aText);
+    assert_previous_text(br.previousSibling, aText);
   } else {
     // Otherwise, there's only 1 br, and that br should be the first element
     // of the message body.
     let br = assert_previous_nodes("br", root, 1);
     let mailBody = get_compose_body(cw);
     assert_equals(br, mailBody.firstChild);
   }
 
@@ -680,24 +688,24 @@ function subtest_converting_filelink_upd
   let providerA = new MockCloudfileAccount();
   let providerB = new MockCloudfileAccount();
   providerA.init("providerA");
   providerB.init("providerB");
 
   let cw = open_compose_new_mail();
   add_cloud_attachments(cw, providerA);
 
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [, , urls] = wait_for_attachment_urls(cw, kFiles.length);
 
   // Convert each Filelink to providerB, ensuring that the URLs are replaced.
   for (let i = 0; i < kFiles.length; ++i) {
     let url = urls[i];
     select_attachments(cw, i);
     cw.window.convertSelectedToCloudAttachment(providerB);
-    [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+    [, , urls] = wait_for_attachment_urls(cw, kFiles.length);
 
     let newUrl = urls[i];
 
     assert_not_equals(url, newUrl,
                       "The original URL should have been replaced");
   }
 
   close_window(cw);
@@ -721,17 +729,17 @@ function test_converting_filelink_to_nor
 function subtest_converting_filelink_to_normal_removes_url() {
   gMockFilePicker.returnFiles = collectFiles(kFiles, __file__);
   let provider = new MockCloudfileAccount();
   provider.init("someKey");
 
   let cw = open_compose_new_mail();
   add_cloud_attachments(cw, provider);
 
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root, list] = wait_for_attachment_urls(cw, kFiles.length);
 
   for (let i = 0; i < kFiles.length; ++i) {
     select_attachments(cw, i);
     cw.window.convertSelectedToRegularAttachment();
 
     let urls = list.querySelectorAll(".cloudAttachmentItem");
     assert_equals(urls.length, kFiles.length - (i + 1));
   }
@@ -762,24 +770,24 @@ function test_filelinks_work_after_manua
 function subtest_filelinks_work_after_manual_removal() {
   // Insert some Filelinks...
   gMockFilePicker.returnFiles = collectFiles(kFiles, __file__);
   let provider = new MockCloudfileAccount();
   provider.init("someKey");
   let cw = open_compose_new_mail();
   add_cloud_attachments(cw, provider);
 
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   // Now remove the root node from the document body
   root.remove();
 
   gMockFilePicker.returnFiles = collectFiles(["./data/testFile3"], __file__);
   add_cloud_attachments(cw, provider);
-  [root, list, urls] = wait_for_attachment_urls(cw, 1);
+  [root] = wait_for_attachment_urls(cw, 1);
 
   close_window(cw);
 }
 
 /**
  * Test that if the users selection caret is on a newline when the URL
  * insertion occurs, that the caret does not move when the insertion is
  * complete. Tests both HTML and plaintext composers.
@@ -805,19 +813,19 @@ function subtest_insertion_restores_care
   let editor = cw.window.GetCurrentEditor();
   editor.beginningOfDocument();
 
   // Do any necessary typing, ending with two linebreaks.
   type_in_composer(cw, ["Line 1", "Line 2", "", ""]);
 
   // Attach some Filelinks.
   add_cloud_attachments(cw, provider);
-  let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
+  let [root] = wait_for_attachment_urls(cw, kFiles.length);
 
   // Type some text.
   const kTypedIn = "Test";
   type_in_composer(cw, [kTypedIn]);
 
   // That text should be inserted just above the root attachment URL node.
-  let textNode = assert_previous_text(root.previousSibling, [kTypedIn]);
+  assert_previous_text(root.previousSibling, [kTypedIn]);
 
   close_window(cw);
 }
--- a/mail/test/mozmill/cloudfile/test-cloudfile-manager.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-manager.js
@@ -4,24 +4,31 @@
 
 /**
  * Tests the richlistbox in the manager for attachment storage
  * services
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-pref-window-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-cloudfile-manager";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                       "pref-window-helpers",
-                       "content-tab-helpers",
-                       "cloudfile-helpers",
-                       "window-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "pref-window-helpers",
+  "content-tab-helpers",
+  "cloudfile-helpers",
+  "window-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var kTestAccountType = "mock";
 var kRootURL = collector.addHttpResource("../cloudfile/html", "");
 var kSettingsWithLink = kRootURL + "settings-with-link.xhtml";
 
 function setupModule(module) {
--- a/mail/test/mozmill/cloudfile/test-cloudfile-notifications.js
+++ b/mail/test/mozmill/cloudfile/test-cloudfile-notifications.js
@@ -3,25 +3,33 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that the cloudfile notifications work as they should.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
+/* import-globals-from ../shared-modules/test-attachment-helpers.js */
+/* import-globals-from ../shared-modules/test-prompt-helpers.js */
+/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
+
 var MODULE_NAME = "test-cloudfile-notifications";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                       "compose-helpers",
-                       "cloudfile-helpers",
-                       "attachment-helpers",
-                       "prompt-helpers",
-                       "notificationbox-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "cloudfile-helpers",
+  "attachment-helpers",
+  "prompt-helpers",
+  "notificationbox-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {cloudFileAccounts} = ChromeUtils.import("resource:///modules/cloudFileAccounts.jsm");
 
 var maxSize, oldInsertNotificationPref;
 
 var kOfferThreshold = "mail.compose.big_attachments.threshold_kb";
 var kInsertNotificationPref = "mail.compose.big_attachments.insert_notification";
--- a/mail/test/mozmill/composition/test-address-widgets.js
+++ b/mail/test/mozmill/composition/test-address-widgets.js
@@ -3,23 +3,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests proper enabling of addressing widgets.
  */
 
 "use strict";
 
-var {fixIterator} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-address-widgets";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
-                         "window-helpers"];
+var {fixIterator} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 
 var cwc = null; // compose window controller
 var accountPOP3 = null;
 var accountNNTP = null;
 var originalAccountCount;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
@@ -28,17 +30,17 @@ function setupModule(module) {
 
   // Ensure we're in the tinderbox account as that has the right identities set
   // up for this test.
   let server = MailServices.accounts.FindServer("tinderbox", FAKE_SERVER_HOSTNAME, "pop3");
   accountPOP3 = MailServices.accounts.FindAccountForServer(server);
 
   // There may be pre-existing accounts from other tests.
   originalAccountCount = MailServices.accounts.allServers.length;
-};
+}
 
 function teardownModule(module) {
 }
 
 /**
  * Check if the address type items are in the wished state.
  *
  * @param aItemsEnabled  List of item values that should be enabled (uncollapsed).
--- a/mail/test/mozmill/composition/test-attachment-reminder.js
+++ b/mail/test/mozmill/composition/test-attachment-reminder.js
@@ -1,28 +1,33 @@
 /* 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/. */
 
 /**
  * Tests that the attachment reminder works properly.
  */
 
-// make SOLO_TEST=composition/test-attachment-reminder.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-attachment-reminder";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                         "compose-helpers",
-                         "window-helpers",
-                         "notificationbox-helpers",
-                         "keyboard-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "notificationbox-helpers",
+  "keyboard-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kBoxId = "compose-notification-bottom";
 var kNotificationId = "attachmentReminder";
 var kReminderPref = "mail.compose.attachment_reminder";
 var gDrafts;
@@ -412,18 +417,17 @@ function test_manual_automatic_attachmen
 
 /**
  * Assert if there is any notification in the compose window.
  *
  * @param aCwc         Compose Window Controller
  * @param aValue       True if notification should exist.
  *                     False otherwise.
  */
-function assert_any_notification(aCwc, aValue)
-{
+function assert_any_notification(aCwc, aValue) {
   let notification = aCwc.e(kBoxId).currentNotification;
   if ((notification == null) == aValue)
     throw new Error("Notification in wrong state");
 }
 
 /**
  * Bug 989653
  * Send filelink attachment should not trigger the attachment reminder.
@@ -437,17 +441,17 @@ function test_attachment_vs_filelink_rem
   // There should be no notification yet.
   assert_any_notification(cwc, false);
 
   // Bring up the FileLink notification.
   let kOfferThreshold = "mail.compose.big_attachments.threshold_kb";
   let maxSize = Services.prefs.getIntPref(kOfferThreshold, 0) * 1024;
   let file = Services.dirsvc.get("ProfD", Ci.nsIFile);
   file.append("panacea.dat");
-  add_attachment(cwc, Services.io.newFileURI(file).spec, maxSize);
+  add_attachments(cwc, Services.io.newFileURI(file).spec, maxSize);
 
   // The filelink attachment proposal should be up but not the attachment
   // reminder and it should also not interfere with the sending of the message.
   wait_for_notification_to_show(cwc, kBoxId, "bigAttachment");
   assert_automatic_reminder_state(cwc, false);
 
   click_send_and_handle_send_error(cwc);
   close_window(cwc);
@@ -689,37 +693,37 @@ function click_send_and_handle_send_erro
     aController.click(aController.eid("button-send"));
   wait_for_modal_dialog("commonDialog");
 }
 
 /**
  * Click the "Oh, I Did!" button in the attachment reminder dialog.
  */
 function click_oh_i_did(controller) {
-  controller.window.document.documentElement.getButton('extra1').doCommand();
+  controller.window.document.documentElement.getButton("extra1").doCommand();
 }
 
 /**
  * Click the "No, Send Now" button in the attachment reminder dialog.
  */
 function click_no_send_now(controller) {
-  controller.window.document.documentElement.getButton('accept').doCommand();
+  controller.window.document.documentElement.getButton("accept").doCommand();
 }
 
 /**
  * Click Ok in the Send Message Error dialog.
  */
 function click_ok_on_send_error(controller) {
   if (controller.window.document.title != "Send Message Error")
     throw new Error("Not a send error dialog; title=" +
                     controller.window.document.title);
-  controller.window.document.documentElement.getButton('accept').doCommand();
+  controller.window.document.documentElement.getButton("accept").doCommand();
 }
 
 /**
  * Click Save in the Save message dialog.
  */
 function click_save_message(controller) {
   if (controller.window.document.title != "Save Message")
     throw new Error("Not a Save message dialog; title=" +
                     controller.window.document.title);
-  controller.window.document.documentElement.getButton('accept').doCommand();
+  controller.window.document.documentElement.getButton("accept").doCommand();
 }
--- a/mail/test/mozmill/composition/test-attachment.js
+++ b/mail/test/mozmill/composition/test-attachment.js
@@ -3,23 +3,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests attachment handling functionality of the message compose window.
  */
 
 "use strict";
 
-var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
-
-var MODULE_NAME = 'test-attachment';
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
-                       'window-helpers'];
+var MODULE_NAME = "test-attachment";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
+
+var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var messenger;
 var folder;
 var epsilon;
 var isWindows;
 var filePrefix;
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
@@ -27,202 +29,202 @@ var {AppConstants} = ChromeUtils.import(
 
 var rawAttachment =
   "Can't make the frug contest, Helen; stomach's upset. I'll fix you, " +
   "Ubik! Ubik drops you back in the thick of things fast. Taken as " +
   "directed, Ubik speeds relief to head and stomach. Remember: Ubik is " +
   "only seconds away. Avoid prolonged use.";
 
 var b64Attachment =
-  'iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS' +
-  'FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA' +
-  'A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe' +
-  'SNQAAlmAY+71EgFoAAAAASUVORK5CYII=';
+  "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS" +
+  "FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA" +
+  "A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe" +
+  "SNQAAlmAY+71EgFoAAAAASUVORK5CYII=";
 var b64Size = 188;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
-  folder = create_folder('ComposeAttachmentA');
+  folder = create_folder("ComposeAttachmentA");
 
-  messenger = Cc['@mozilla.org/messenger;1']
+  messenger = Cc["@mozilla.org/messenger;1"]
                 .createInstance(Ci.nsIMessenger);
 
-  isWindows = '@mozilla.org/windows-registry-key;1' in Cc;
+  isWindows = "@mozilla.org/windows-registry-key;1" in Cc;
 
   /* Today's gory details (thanks to Jonathan Protzenko): libmime somehow
    * counts the trailing newline for an attachment MIME part. Most of the time,
    * assuming attachment has N bytes (no matter what's inside, newlines or
    * not), libmime will return N + 1 bytes. On Linux and Mac, this always
    * holds. However, on Windows, if the attachment is not encoded (that is, is
    * inline text), libmime will return N + 2 bytes. Since we're dealing with
    * forwarded message data here, the bonus byte(s) appear twice.
    */
   epsilon = isWindows ? 4 : 2;
-  filePrefix = isWindows ? 'file:///C:/' : 'file:///';
+  filePrefix = isWindows ? "file:///C:/" : "file:///";
 
   // create some messages that have various types of attachments
   let messages = [
     // no attachment
     {},
     // raw attachment
     { attachments: [{ body: rawAttachment,
-                      filename: 'ubik.txt',
-                      format: '' }]},
+                      filename: "ubik.txt",
+                      format: "" }]},
     // b64-encoded image attachment
     { attachments: [{ body: b64Attachment,
-                      contentType: 'image/png',
-                      filename: 'lines.png',
-                      encoding: 'base64',
-                      format: '' }]},
+                      contentType: "image/png",
+                      filename: "lines.png",
+                      encoding: "base64",
+                      format: "" }]},
     ];
 
-  for (let i=0; i<messages.length; i++) {
+  for (let i = 0; i < messages.length; i++) {
     add_message_to_folder(folder, create_message(messages[i]));
   }
 }
 
 /**
  * Make sure that the attachment's size is what we expect
  * @param controller the controller for the compose window
  * @param index the attachment to examine, as an index into the listbox
  * @param expectedSize the expected size of the attachment, in bytes
  */
 function check_attachment_size(controller, index, expectedSize) {
-  let bucket = controller.e('attachmentBucket');
+  let bucket = controller.e("attachmentBucket");
   let node = bucket.querySelectorAll("richlistitem.attachmentItem")[index];
 
   // First, let's check that the attachment size is correct
   let size = node.attachment.size;
   if (Math.abs(size - expectedSize) > epsilon)
-    throw new Error('Reported attachment size ('+size+') not within epsilon ' +
-                    'of actual attachment size ('+expectedSize+')');
+    throw new Error("Reported attachment size (" + size + ") not within epsilon " +
+                    "of actual attachment size (" + expectedSize + ")");
 
   // Next, make sure that the formatted size in the label is correct
-  let formattedSize = node.getAttribute('size');
+  let formattedSize = node.getAttribute("size");
   let expectedFormattedSize = messenger.formatFileSize(size);
   if (formattedSize != expectedFormattedSize)
-    throw new Error('Formatted attachment size ('+formattedSize+') does not ' +
-                    'match expected value ('+expectedFormattedSize+')');
+    throw new Error("Formatted attachment size (" + formattedSize + ") does not " +
+                    "match expected value (" + expectedFormattedSize + ")");
 }
 
 /**
  * Make sure that the attachment's size is not displayed
  * @param controller the controller for the compose window
  * @param index the attachment to examine, as an index into the listbox
  */
 function check_no_attachment_size(controller, index) {
-  let bucket = controller.e('attachmentBucket');
+  let bucket = controller.e("attachmentBucket");
   let node = bucket.querySelectorAll("richlistitem.attachmentItem")[index];
 
   if (node.attachment.size != -1)
-    throw new Error('attachment.size attribute should be -1!');
+    throw new Error("attachment.size attribute should be -1!");
 
   // If there's no size, the size attribute is the zero-width space.
-  if (node.getAttribute('size') != '\u200b')
-    throw new Error('Attachment size should not be displayed!');
+  if (node.getAttribute("size") != "\u200b")
+    throw new Error("Attachment size should not be displayed!");
 }
 
 /**
  * Make sure that the total size of all attachments is what we expect.
  * @param controller the controller for the compose window
  * @param count the expected number of attachments
  */
 function check_total_attachment_size(controller, count) {
   let bucket = controller.e("attachmentBucket");
   let nodes = bucket.querySelectorAll("richlistitem.attachmentItem");
   let sizeNode = controller.e("attachmentBucketSize");
 
   if (nodes.length != count)
-    throw new Error("Saw "+nodes.length+" attachments, but expected "+count);
+    throw new Error("Saw " + nodes.length + " attachments, but expected " + count);
 
   let size = 0;
   for (let i = 0; i < nodes.length; i++) {
     let currSize = nodes[i].attachment.size;
     if (currSize != -1)
       size += currSize;
   }
 
   // Next, make sure that the formatted size in the label is correct
   let formattedSize = sizeNode.getAttribute("value");
   let expectedFormattedSize = messenger.formatFileSize(size);
   if (formattedSize != expectedFormattedSize)
-    throw new Error("Formatted attachment size ("+formattedSize+") does not " +
-                    "match expected value ("+expectedFormattedSize+")");
+    throw new Error("Formatted attachment size (" + formattedSize + ") does not " +
+                    "match expected value (" + expectedFormattedSize + ")");
 }
 
 function test_file_attachment() {
   let cwc = open_compose_new_mail();
 
   let url = filePrefix + "some/file/here.txt";
   let size = 1234;
 
-  add_attachment(cwc, url, size);
+  add_attachments(cwc, url, size);
   check_attachment_size(cwc, 0, size);
   check_total_attachment_size(cwc, 1);
 
   close_compose_window(cwc);
 }
 
 function test_webpage_attachment() {
   let cwc = open_compose_new_mail();
 
-  add_attachment(cwc, "http://www.mozilla.org/");
+  add_attachments(cwc, "http://www.mozilla.org/");
   check_no_attachment_size(cwc, 0);
   check_total_attachment_size(cwc, 1);
 
   close_compose_window(cwc);
 }
 
 function test_multiple_attachments() {
   let cwc = open_compose_new_mail();
 
   let files = [{name: "foo.txt", size: 1234},
                {name: "bar.txt", size: 5678},
                {name: "baz.txt", size: 9012}];
   for (let i = 0; i < files.length; i++) {
-    add_attachment(cwc, filePrefix+files[i].name, files[i].size);
+    add_attachments(cwc, filePrefix + files[i].name, files[i].size);
     check_attachment_size(cwc, i, files[i].size);
   }
 
   check_total_attachment_size(cwc, files.length);
   close_compose_window(cwc);
 }
 
 function test_delete_attachments() {
   let cwc = open_compose_new_mail();
 
   let files = [{name: "foo.txt", size: 1234},
                {name: "bar.txt", size: 5678},
                {name: "baz.txt", size: 9012}];
   for (let i = 0; i < files.length; i++) {
-    add_attachment(cwc, filePrefix+files[i].name, files[i].size);
+    add_attachments(cwc, filePrefix + files[i].name, files[i].size);
     check_attachment_size(cwc, i, files[i].size);
   }
 
   delete_attachment(cwc, 0);
-  check_total_attachment_size(cwc, files.length-1);
+  check_total_attachment_size(cwc, files.length - 1);
 
   close_compose_window(cwc);
 }
 
 function subtest_rename_attachment(cwc) {
   cwc.e("loginTextbox").value = "renamed.txt";
-  cwc.window.document.documentElement.getButton('accept').doCommand();
+  cwc.window.document.documentElement.getButton("accept").doCommand();
 }
 
 function test_rename_attachment() {
   let cwc = open_compose_new_mail();
 
   let url = filePrefix + "some/file/here.txt";
   let size = 1234;
 
-  add_attachment(cwc, url, size);
+  add_attachments(cwc, url, size);
 
   // Now, rename the attachment.
   let bucket = cwc.e("attachmentBucket");
   let node = bucket.querySelector("richlistitem.attachmentItem");
   cwc.click(new elib.Elem(node));
   plan_for_modal_dialog("commonDialog", subtest_rename_attachment);
   cwc.window.RenameSelectedAttachment();
   wait_for_modal_dialog("commonDialog");
@@ -245,42 +247,42 @@ function test_open_attachment() {
   // set up our external file for attaching
   let thisFilePath = os.getFileForPath(__file__);
   let file = os.getFileForPath(os.abspath("./attachment.txt", thisFilePath));
   let fileHandler = Services.io.getProtocolHandler("file")
                             .QueryInterface(Ci.nsIFileProtocolHandler);
   let url = fileHandler.getURLSpecFromFile(file);
   let size = file.fileSize;
 
-  add_attachment(cwc, url, size);
+  add_attachments(cwc, url, size);
 
   // Now, open the attachment.
   let bucket = cwc.e("attachmentBucket");
   let node = bucket.querySelector("richlistitem.attachmentItem");
   plan_for_modal_dialog("unknownContentType", subtest_open_attachment);
   cwc.doubleClick(new elib.Elem(node));
   wait_for_modal_dialog("unknownContentType");
 
   close_compose_window(cwc);
 }
 
 function test_forward_raw_attachment() {
   be_in_folder(folder);
-  let curMessage = select_click_row(1);
+  select_click_row(1);
 
   let cwc = open_compose_with_forward();
   check_attachment_size(cwc, 0, rawAttachment.length);
   check_total_attachment_size(cwc, 1);
 
   close_compose_window(cwc);
 }
 
 function test_forward_b64_attachment() {
   be_in_folder(folder);
-  let curMessage = select_click_row(2);
+  select_click_row(2);
 
   let cwc = open_compose_with_forward();
   check_attachment_size(cwc, 0, b64Size);
   check_total_attachment_size(cwc, 1);
 
   close_compose_window(cwc);
 }
 
@@ -329,17 +331,16 @@ function check_attachment_names(aControl
  *                    { focusEl: the element to be focused for keypresses
  *                      key:     keycode of key to press
  *                      key_modifiers: { accelKey: bool, ctrlKey: bool
  *                                       shiftKey: bool, altKey: bool, etc. },
  *                    }
  */
 function subtest_reordering_panel_keyboard(aCwc, aActions) {
   let panel = aCwc.e("reorderAttachmentsPanel");
-  let bucket = aCwc.e("attachmentBucket");
 
   for (let action of aActions) {
     aCwc.keypress(new elib.Elem(action.focusEl),
                   action.key, action.key_modifiers);
     wait_for_popup_to_open(panel);
     aCwc.sleep(0);
 
     // Press ESC which should close the panel.
@@ -370,17 +371,17 @@ function subtest_reordering_panel_keyboa
 function subtest_reordering(aCwc, aInitialAttachmentNames,
                             aReorder_actions, aOpenPanel = true) {
   let bucket = aCwc.e("attachmentBucket");
   let panel;
 
   // Create a set of attachments for the test.
   const size = 1234;
   for (let name of aInitialAttachmentNames) {
-    add_attachment(aCwc, filePrefix + name, size);
+    add_attachments(aCwc, filePrefix + name, size);
   }
   aCwc.sleep(0);
   assert_equals(aCwc.window.attachmentsCount(), aInitialAttachmentNames.length);
   check_attachment_names(aCwc, aInitialAttachmentNames);
 
   if (aOpenPanel) {
     // Bring up the reordering panel.
     aCwc.window.showReorderAttachmentsPanel();
@@ -421,28 +422,28 @@ function subtest_reordering(aCwc, aIniti
  * Check basic and advanced attachment reordering operations.
  * This is the main function of this test.
  */
 function test_attachment_reordering() {
   let cwc = open_compose_new_mail();
   let editorEl = cwc.window.GetCurrentEditorElement();
   let bucket = cwc.e("attachmentBucket");
   let panel = cwc.e("reorderAttachmentsPanel");
-  const openReorderPanelModifiers =
-    (AppConstants.platform == "macosx") ? { controlKey: true }
-                                        : { altKey: true };
+  // const openReorderPanelModifiers =
+  //   (AppConstants.platform == "macosx") ? { controlKey: true }
+  //                                       : { altKey: true };
 
   // First, some checks if the 'Reorder Attachments' panel
   // opens and closes correctly.
 
   // Create two attachments as otherwise the reordering panel won't open.
   const size = 1234;
   const initialAttachmentNames_0 = ["A1", "A2"];
   for (let name of initialAttachmentNames_0) {
-    add_attachment(cwc, filePrefix + name, size);
+    add_attachments(cwc, filePrefix + name, size);
     cwc.sleep(0);
   }
   assert_equals(cwc.window.attachmentsCount(), initialAttachmentNames_0.length);
   check_attachment_names(cwc, initialAttachmentNames_0);
 
   // Show 'Reorder Attachments' panel via mouse clicks.
   cwc.rightClick(new elib.Elem(bucket.getItemAtIndex(1)));
   cwc.click_menus_in_sequence(cwc.e("msgComposeAttachmentItemContext"),
@@ -451,24 +452,24 @@ function test_attachment_reordering() {
 
   // Click on the editor which should close the panel.
   cwc.click(new elib.Elem(editorEl));
   cwc.waitFor(() => panel.state == "closed",
     "Reordering panel didn't close when editor was clicked.");
 
   // Show 'Reorder Attachments' panel via keyboard.
   // key_reorderAttachments, Bug 1427037
-  const openPanelActions = [
-    { focusEl: editorEl,
-      key: "x",
-      key_modifiers: openReorderPanelModifiers },
-    { focusEl: bucket,
-      key: "x",
-      key_modifiers: openReorderPanelModifiers }
-  ];
+  // const openPanelActions = [
+  //   { focusEl: editorEl,
+  //     key: "x",
+  //     key_modifiers: openReorderPanelModifiers },
+  //   { focusEl: bucket,
+  //     key: "x",
+  //     key_modifiers: openReorderPanelModifiers },
+  // ];
 
   // XXX this doesn't work on any platform yet, ESC doesn't close the panel.
   // Execute test of opening 'Reorder Attachments' panel via keyboard.
   // subtest_reordering_panel_keyboard(cwc, openPanelActions);
 
   // Clean up for a new set of attachments.
   cwc.window.RemoveAllAttachments();
 
@@ -492,17 +493,17 @@ function test_attachment_reordering() {
       button: "btn_moveAttachmentBottom",
       result: ["a", "b", "B", "bb", "C", "x"] },
     { select: [1, 3],
       button: "btn_moveAttachmentBundleUp",
       result: ["a", "b", "bb", "B", "C", "x"] },
     // Bug 1417856
     { select: [2],
       button: "btn_sortAttachmentsToggle",
-      result: ["a", "b", "B", "bb", "C", "x"] }
+      result: ["a", "b", "B", "bb", "C", "x"] },
   ];
 
   // Check 2: basic and advanced, mouse-only.
   const initialAttachmentNames_2 = ["a", "x", "C", "y1", "y2", "B", "b", "z", "bb"];
   const reorderActions_2 = [
     // For starters: moving a single attachment around in the list.
     { select: [1],
       button: "btn_moveAttachmentUp",
@@ -590,17 +591,17 @@ function test_attachment_reordering() {
       result: ["z", "y2", "y1", "x", "C", "bb", "B", "b", "a"] },
 
     // Collapsing multiple, disjunct selection with inner block to top/bottom.
     { select: [3, 5, 6, 8],
       button: "btn_moveAttachmentTop",
       result: ["x", "bb", "B", "a", "z", "y2", "y1", "C", "b"] },
     { select: [0, 2, 3, 7],
       button: "btn_moveAttachmentBottom",
-      result: ["bb", "z", "y2", "y1", "b", "x", "B", "a", "C"] }
+      result: ["bb", "z", "y2", "y1", "b", "x", "B", "a", "C"] },
   ];
 
   // Check 3: basic and advanced, keyboard-only.
   const initialAttachmentNames_3 = ["a", "x", "C", "y1", "y2", "B", "b", "z", "bb"];
   const modAlt = { altKey: true };
   const modifiers2 = (AppConstants.platform == "macosx") ? { accelKey: true,
                                                              altKey: true }
                                                          : { altKey: true };
@@ -728,28 +729,28 @@ function test_attachment_reordering() {
       // key_moveAttachmentBottom2 (secondary shortcut on MAC, same as Win primary)
       key:    "VK_END",
       key_modifiers: modAlt,
       result: ["B", "x", "y1", "y2", "z", "a", "b", "C", "bb"] },
     { select: [5, 6, 7, 8],
       // key_moveAttachmentTop2 (secondary shortcut on MAC, same as Win primary)
       key:    "VK_HOME",
       key_modifiers: modAlt,
-      result: ["a", "b", "C", "bb", "B", "x", "y1", "y2", "z"] }
+      result: ["a", "b", "C", "bb", "B", "x", "y1", "y2", "z"] },
   ];
 
   // Check 4: Alt+Y keyboard shortcut for sorting (Bug 1425891).
   const initialAttachmentNames_4 = ["a", "x", "C", "y1", "y2", "B", "b", "z", "bb"];
 
   const reorderActions_4 = [
     { select: [1],
       // key_sortAttachmentsToggle
       key:    "y",
       key_modifiers: modAlt,
-      result: ["a", "b", "B", "bb", "C", "x", "y1", "y2", "z"] }
+      result: ["a", "b", "B", "bb", "C", "x", "y1", "y2", "z"] },
   ];
 
   // Execute the tests of reordering actions as defined above.
   subtest_reordering(cwc, initialAttachmentNames_1, reorderActions_1);
   subtest_reordering(cwc, initialAttachmentNames_2, reorderActions_2);
   // Check 3 (keyboard-only) with panel open.
   subtest_reordering(cwc, initialAttachmentNames_3, reorderActions_3);
   // Check 3 (keyboard-only) without panel.
--- a/mail/test/mozmill/composition/test-base64-display.js
+++ b/mail/test/mozmill/composition/test-base64-display.js
@@ -1,22 +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/. */
 
 /**
  * Tests that messages with "broken" base64 are correctly displayed.
  */
 
-// mozmake SOLO_TEST=composition/test-base64-display.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-base64-display.js";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
--- a/mail/test/mozmill/composition/test-blocked-content.js
+++ b/mail/test/mozmill/composition/test-blocked-content.js
@@ -1,28 +1,30 @@
 /* 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/. */
 
 /**
  * Tests that we do the right thing wrt. blocked resources during composition.
  */
 
-// make mozmill-one SOLO_TEST=composition/test-blocked-content.js
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-blocked-content";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = [
   "folder-display-helpers",
-   "window-helpers",
-   "compose-helpers",
-   "notificationbox-helpers"
+  "window-helpers",
+  "compose-helpers",
+  "notificationbox-helpers",
 ];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 
 var gOutboxFolder;
--- a/mail/test/mozmill/composition/test-charset-edit.js
+++ b/mail/test/mozmill/composition/test-charset-edit.js
@@ -2,25 +2,31 @@
  * 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/. */
 
 /**
  * Tests that we do the right thing wrt. message encoding when editing or
  * replying to messages.
  */
 
-// make SOLO_TEST=composition/test-charset-edit.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-charset-edit";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
-                       "window-helpers", "notificationbox-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "notificationbox-helpers",
+];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var {MimeParser} = ChromeUtils.import("resource:///modules/mimeParser.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
 
@@ -44,31 +50,31 @@ function setupModule(module) {
 
 /**
  * Helper to get the full message content.
  *
  * @param aMsgHdr: nsIMsgDBHdr object whose text body will be read
  * @param aGetText: if true, return header objects. if false, return body data.
  * @return Map(partnum -> message headers)
  */
-function getMsgHeaders(aMsgHdr, aGetText=false) {
+function getMsgHeaders(aMsgHdr, aGetText = false) {
   let msgFolder = aMsgHdr.folder;
   let msgUri = msgFolder.getUriForMsg(aMsgHdr);
 
   let messenger = Cc["@mozilla.org/messenger;1"]
                     .createInstance(Ci.nsIMessenger);
   let handler = {
     _done: false,
     _data: new Map(),
     _text: new Map(),
-    endMessage: function () { this._done = true; },
-    deliverPartData: function (num, text) {
+    endMessage() { this._done = true; },
+    deliverPartData(num, text) {
       this._text.set(num, this._text.get(num) + text);
     },
-    startPart: function (num, headers) {
+    startPart(num, headers) {
       this._data.set(num, headers);
       this._text.set(num, "");
     },
   };
   let streamListener = MimeParser.makeStreamListenerParser(handler,
     {strformat: "unicode"});
   messenger.messageServiceFromURI(msgUri).streamMessage(msgUri,
                                                         streamListener,
@@ -85,17 +91,17 @@ function getMsgHeaders(aMsgHdr, aGetText
  * Test that if we reply to a message in an invalid charset, we don't try to compose
  * in that charset. Instead, we should be using the default charset (set to
  * not be UTF-8 in this test).
  */
 function test_wrong_reply_charset() {
   let folder = gDrafts;
   let msg0 = create_message({
     bodyPart: new SyntheticPartLeaf("Some text",
-      {charset: "invalid-charset"})
+      {charset: "invalid-charset"}),
   });
   add_message_to_folder(folder, msg0);
   be_in_folder(folder);
   let msg = select_click_row(0);
   assert_selected_and_displayed(mc, msg);
   assert_equals(getMsgHeaders(msg).get("").charset, "invalid-charset");
 
   let rwc = open_compose_with_reply();
@@ -126,17 +132,17 @@ function test_wrong_reply_charset() {
 /**
  * Test that replying to bad charsets don't screw up the existing text.
  */
 function test_no_mojibake() {
   let folder = gDrafts;
   let nonASCII = "ケツァルコアトル";
   let UTF7 = "+MLEwxDChMOswszCiMMgw6w-";
   let msg0 = create_message({
-    bodyPart: new SyntheticPartLeaf(UTF7, {charset: "utf-7"})
+    bodyPart: new SyntheticPartLeaf(UTF7, {charset: "utf-7"}),
   });
   add_message_to_folder(folder, msg0);
   be_in_folder(folder);
   let msg = select_click_row(0);
   assert_selected_and_displayed(mc, msg);
   assert_equals(getMsgHeaders(msg).get("").charset, "utf-7");
   assert_equals(getMsgHeaders(msg, true).get("").trim(), nonASCII);
 
--- a/mail/test/mozmill/composition/test-charset-upgrade.js
+++ b/mail/test/mozmill/composition/test-charset-upgrade.js
@@ -2,22 +2,23 @@
  * 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/. */
 
 /**
  * Tests that we do the right thing wrt. message encoding, especially when
  * all characters doesn't fit the selected charset.
  */
 
-// make SOLO_TEST=composition/test-charset-upgrade.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-charset-upgrade";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gDrafts;
 var gOutbox;
@@ -158,17 +159,17 @@ function test_encoding_upgrade_plaintext
 
   be_in_folder(gDrafts);
   let draftMsg2 = select_click_row(0);
   // Charset should have be upgraded to UTF-8.
   assert_equals(draftMsg2.Charset, "UTF-8");
 
   let draftMsg2Content = get_msg_source(draftMsg2, "UTF-8");
   if (draftMsg2Content.includes("<html>"))
-    throw new Error("Plaintext draft contained <html>; "+
+    throw new Error("Plaintext draft contained <html>; " +
                     "draftMsg2Content=" + draftMsg2Content);
 
   if (!draftMsg2Content.includes(CHINESE))
     throw new Error("Chinese text not in msg; CHINESE=" + CHINESE +
                     ", draftMsg2Content=" + draftMsg2Content);
 
   plan_for_window_close(compWin);
   compWin.window.goDoCommand("cmd_sendLater");
--- a/mail/test/mozmill/composition/test-cp932-display.js
+++ b/mail/test/mozmill/composition/test-cp932-display.js
@@ -1,22 +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/. */
 
 /**
  * Tests that messages in cp932, Thunderbirds alias for Shift_JIS, are correctly displayed.
  */
 
-// mozmake SOLO_TEST=composition/test-cp932-display.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-cp932-display.js";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
--- a/mail/test/mozmill/composition/test-draft-identity.js
+++ b/mail/test/mozmill/composition/test-draft-identity.js
@@ -2,25 +2,31 @@
  * 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/. */
 
 /**
  * Tests that compose new message chooses the correct initial identity when
  * called from the context of an open composer.
  */
 
-// make SOLO_TEST=composition/test-draft-identity.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-draft-identity";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "compose-helpers", "notificationbox-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "window-helpers",
+  "compose-helpers",
+  "notificationbox-helpers",
+];
 
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gDrafts;
 var gAccount;
 
 // The first identity should become the default in the account.
 var gIdentities = [ { email: "x@example.invalid" },
@@ -63,24 +69,24 @@ function setupModule(module) {
 /**
  * Create a new templated draft message in the drafts folder.
  *
  * @return {integer}  The index (position) of the created message in the drafts folder.
  */
 function create_draft(aFrom, aIdKey) {
   let msgCount = gDrafts.getTotalMessages(false);
   let source =
-    "From - Wed Mar 01 01:02:03 2017\n"+
+    "From - Wed Mar 01 01:02:03 2017\n" +
     "X-Mozilla-Status: 0000\n" +
     "X-Mozilla-Status2: 00000000\n" +
     "X-Mozilla-Keys:                                                                                 \n" +
     "FCC: mailbox://nobody@Local%20Folders/Sent\n" +
     (aIdKey ?
     `X-Identity-Key: ${aIdKey}\n` +
-    `X-Account-Key: ${gAccount.key}\n`:"") +
+    `X-Account-Key: ${gAccount.key}\n` : "") +
     `From: ${aFrom}\n` +
     "To: nobody@example.invalid\n" +
     "Subject: test!\n" +
     `Message-ID: <${msgCount}@example.invalid>\n` +
     "Date: Wed, 1 Mar 2017 01:02:03 +0100\n" +
     "X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;\n" +
     " attachmentreminder=0; deliveryformat=4\n" +
     "MIME-Version: 1.0\n" +
--- a/mail/test/mozmill/composition/test-drafts.js
+++ b/mail/test/mozmill/composition/test-drafts.js
@@ -2,25 +2,31 @@
  * 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/. */
 
 /**
  * Tests draft related functionality:
  * - that we don't allow opening multiple copies of a draft.
  */
 
-// make SOLO_TEST=composition/test-drafts.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-drafts";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
-                       "window-helpers", "notificationbox-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "notificationbox-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var kBoxId = "mail-notification-top";
 var draftsFolder;
 
 function setupModule(module) {
@@ -33,17 +39,17 @@ function setupModule(module) {
 
 /**
  * Bug 349547.
  * Tests that we only open one compose window for one instance of a draft.
  */
 function test_open_draft_again() {
   make_new_sets_in_folder(draftsFolder, [{count: 1}]);
   be_in_folder(draftsFolder);
-  let draftMsg = select_click_row(0);
+  select_click_row(0);
 
   // Wait for the notification with the Edit button.
   wait_for_notification_to_show(mc, kBoxId, "draftMsgContent");
 
   plan_for_new_window("msgcompose");
   mc.click(mc.eid(kBoxId, {tagName: "button", label: "Edit"}));
   let cwc = wait_for_compose_window();
 
@@ -175,17 +181,17 @@ function test_save_delivery_format_with_
  * Tests that 'Edit as New' leaves the original message in drafts folder.
  */
 function test_edit_as_new_in_draft() {
   make_new_sets_in_folder(draftsFolder, [{count: 1}]);
   be_in_folder(draftsFolder);
 
   assert_equals(draftsFolder.getTotalMessages(false), 1);
 
-  let draftMsg = select_click_row(0);
+  select_click_row(0);
 
   // Wait for the notification with the Edit button.
   wait_for_notification_to_show(mc, kBoxId, "draftMsgContent");
 
   plan_for_new_window("msgcompose");
   mc.keypress(null, "e", {shiftKey: false, accelKey: true});
   let cwc = wait_for_compose_window();
 
@@ -249,17 +255,17 @@ function test_remove_space_stuffing_form
   utils.waitFor(() => !cwc.window.gSaveOperationInProgress && !cwc.window.gWindowLock,
                 "Saving of draft did not finish");
   wait_for_window_focused(cwc.window);
 
   close_compose_window(cwc);
 
   be_in_folder(draftsFolder);
 
-  let draftMsg = select_click_row(0);
+  select_click_row(0);
 
   // Wait for the notification with the Edit button.
   wait_for_notification_to_show(mc, kBoxId, "draftMsgContent");
 
   plan_for_new_window("msgcompose");
   mc.click(mc.eid(kBoxId, {tagName: "button", label: "Edit"}));
   cwc = wait_for_compose_window();
 
--- a/mail/test/mozmill/composition/test-eml-actions.js
+++ b/mail/test/mozmill/composition/test-eml-actions.js
@@ -1,22 +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/. */
 
 /**
  * Tests that actions such as replying to an .eml works properly.
  */
 
-// make SOLO_TEST=composition/test-eml-actions.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-eml-actions";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var gDrafts;
--- a/mail/test/mozmill/composition/test-focus.js
+++ b/mail/test/mozmill/composition/test-focus.js
@@ -3,21 +3,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that cycling through the focus of the 3pane's panes works correctly.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-focus";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
-                       "window-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 }
 
 /**
@@ -72,25 +74,25 @@ function check_element_cycling(controlle
 function test_f6_no_attachment() {
   let cwc = open_compose_new_mail();
   check_element_cycling(cwc, false, false);
   close_compose_window(cwc);
 }
 
 function test_f6_attachment() {
   let cwc = open_compose_new_mail();
-  add_attachment(cwc, "http://www.mozilla.org/");
+  add_attachments(cwc, "http://www.mozilla.org/");
   check_element_cycling(cwc, true, false);
   close_compose_window(cwc);
 }
 
 function test_ctrl_tab_no_attachment() {
   let cwc = open_compose_new_mail();
   check_element_cycling(cwc, false, true);
   close_compose_window(cwc);
 }
 
 function test_ctrl_tab_attachment() {
   let cwc = open_compose_new_mail();
-  add_attachment(cwc, "http://www.mozilla.org/");
+  add_attachments(cwc, "http://www.mozilla.org/");
   check_element_cycling(cwc, true, true);
   close_compose_window(cwc);
 }
--- a/mail/test/mozmill/composition/test-forward-headers.js
+++ b/mail/test/mozmill/composition/test-forward-headers.js
@@ -4,29 +4,37 @@
 
 /**
  * Tests that headers like References and X-Forwarded-Message-Id are
  * set properly when forwarding messages.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-message-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-forward-headers";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers",
-                         "message-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "message-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var cwc = null; // compose window controller
 var folder;
 var gDrafts;
 
-var setupModule = function (module) {
+function setupModule(module) {
   let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
   let composeHelper = collector.getModule("compose-helpers");
   composeHelper.installInto(module);
   let wh = collector.getModule("window-helpers");
   wh.installInto(module);
   let mh = collector.getModule("message-helpers");
   mh.installInto(module);
@@ -36,50 +44,50 @@ var setupModule = function (module) {
   add_sets_to_folders([folder], [thread1]);
 
   gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
 
   // Don't create paragraphs in the test.
   // The test checks for the first DOM node and expects a text and not
   // a paragraph.
   Services.prefs.setBoolPref("mail.compose.default_to_paragraph", false);
-};
+}
 
 function teardownModule(module) {
   Services.prefs.clearUserPref("mail.compose.default_to_paragraph");
 }
 
 function forward_selected_messages_and_go_to_drafts_folder(f) {
   const kText = "Hey check out this megalol link";
   // opening a new compose window
   cwc = f(mc);
   cwc.type(cwc.eid("content-frame"), kText);
 
   let mailBody = get_compose_body(cwc);
   assert_previous_text(mailBody.firstChild, [kText]);
 
   plan_for_window_close(cwc);
   // mwc is modal window controller
-  plan_for_modal_dialog("commonDialog", function click_save (mwc) {
-      //accept saving
-      mwc.window.document.documentElement.getButton('accept').doCommand();
-    });
+  plan_for_modal_dialog("commonDialog", function click_save(mwc) {
+    // accept saving
+    mwc.window.document.documentElement.getButton("accept").doCommand();
+  });
 
   // quit -> do you want to save ?
-  cwc.window.goDoCommand('cmd_close');
+  cwc.window.goDoCommand("cmd_close");
   // wait for the modal dialog to return
   wait_for_modal_dialog();
   // Actually quit the window.
   wait_for_window_close();
 
   // Visit the existing Drafts folder.
   be_in_folder(gDrafts);
 }
 
-function test_forward_inline () {
+function test_forward_inline() {
   be_in_folder(folder);
   // original message header
   let oMsgHdr = select_click_row(0);
 
   forward_selected_messages_and_go_to_drafts_folder(open_compose_with_forward);
 
   // forwarded message header
   let fMsgHdr = select_click_row(0);
@@ -87,24 +95,24 @@ function test_forward_inline () {
   assert_true(fMsgHdr.numReferences > 0, "No References Header in forwarded msg.");
   assert_equals(fMsgHdr.getStringReference(0), oMsgHdr.messageId,
     "The forwarded message should have References: = Message-Id: of the original msg");
 
   // test for x-forwarded-message id and exercise the js mime representation as
   // well
   to_mime_message(fMsgHdr, null, function(aMsgHdr, aMimeMsg) {
     assert_equals(aMimeMsg.headers["x-forwarded-message-id"],
-      "<"+oMsgHdr.messageId+">");
-    assert_equals(aMimeMsg.headers["references"],
-      "<"+oMsgHdr.messageId+">");
+      "<" + oMsgHdr.messageId + ">");
+    assert_equals(aMimeMsg.headers.references,
+      "<" + oMsgHdr.messageId + ">");
   });
   press_delete(mc);
 }
 
-function test_forward_as_attachments () {
+function test_forward_as_attachments() {
   be_in_folder(folder);
   // original message header
   let oMsgHdr0 = select_click_row(0);
   let oMsgHdr1 = select_click_row(1);
   select_shift_click_row(0);
 
   forward_selected_messages_and_go_to_drafts_folder(open_compose_with_forward_as_attachments);
 
@@ -117,15 +125,15 @@ function test_forward_as_attachments () 
     "The forwarded message should have References: = Message-Id: of the original msg#1");
   assert_equals(fMsgHdr.getStringReference(0), oMsgHdr0.messageId,
     "The forwarded message should have References: = Message-Id: of the original msg#0");
 
   // test for x-forwarded-message id and exercise the js mime representation as
   // well
   to_mime_message(fMsgHdr, null, function(aMsgHdr, aMimeMsg) {
     assert_equals(aMimeMsg.headers["x-forwarded-message-id"],
-      "<"+oMsgHdr0.messageId+"> <"+oMsgHdr1.messageId+">");
-    assert_equals(aMimeMsg.headers["references"],
-      "<"+oMsgHdr0.messageId+"> <"+oMsgHdr1.messageId+">");
+      "<" + oMsgHdr0.messageId + "> <" + oMsgHdr1.messageId + ">");
+    assert_equals(aMimeMsg.headers.references,
+      "<" + oMsgHdr0.messageId + "> <" + oMsgHdr1.messageId + ">");
   });
 
   press_delete(mc);
 }
--- a/mail/test/mozmill/composition/test-forward-rfc822-attach.js
+++ b/mail/test/mozmill/composition/test-forward-rfc822-attach.js
@@ -2,22 +2,23 @@
  * 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/. */
 
 /**
  * Tests that attached messages (message/rfc822) are correctly sent.
  * It's easiest to test the forward case.
  */
 
-// mozmake SOLO_TEST=composition/test-forward-rfc822-attach.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-forward-rfc822-attach";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
 var gDrafts;
--- a/mail/test/mozmill/composition/test-forward-utf8.js
+++ b/mail/test/mozmill/composition/test-forward-utf8.js
@@ -1,22 +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/. */
 
 /**
  * Tests that UTF-8 messages are correctly forwarded.
  */
 
-// mozmake SOLO_TEST=composition/test-forward-utf8.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-forward-utf8";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
--- a/mail/test/mozmill/composition/test-forwarded-content.js
+++ b/mail/test/mozmill/composition/test-forwarded-content.js
@@ -3,21 +3,23 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that forwarded content is ok.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-forwarded-content";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                         "window-helpers", "compose-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var folder = null;
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
--- a/mail/test/mozmill/composition/test-forwarded-eml-actions.js
+++ b/mail/test/mozmill/composition/test-forwarded-eml-actions.js
@@ -2,25 +2,25 @@
  * 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/. */
 
 /**
  * Tests that actions such as replying and forwarding works correctly from
  * an .eml message that's attached to another mail.
  */
 
-// make SOLO_TEST=composition/test-forwarded-eml-actions.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-forwarded-eml-actions";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                         "compose-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var folder;
 
 var msgsubject = "mail client suggestions";
 var msgbodyA = "know of a good email client?";
@@ -76,17 +76,17 @@ var setupModule = function(module) {
     "Content-Transfer-Encoding: 7bit\n" +
     "\n" +
     msgbodyA + "\n" +
     "\n" +
     "--------------080806020206040800000503--\n";
 
   folder.QueryInterface(Ci.nsIMsgLocalMailFolder);
   folder.addMessage(source);
-}
+};
 
 /**
  * Helper to open an attached .eml file, invoke the hotkey and check some
  * properties of the composition content we get.
  */
 function setupWindowAndTest(hotkeyToHit, hotkeyModifiers) {
   be_in_folder(folder);
 
@@ -108,17 +108,17 @@ function setupWindowAndTest(hotkeyToHit,
 
   if (!bodyText.includes(msgbodyA))
     throw new Error("body text didn't contain the body text; msgbodyA=" +
                     msgbodyB + ", bodyText=" + bodyText);
 
   let subjectText = compWin.e("msgSubject").value;
   if (!subjectText.includes(msgsubject))
     throw new Error("subject text didn't contain the original subject; " +
-                    "msgsubject=" +  msgsubject + ", subjectText=" + subjectText);
+                    "msgsubject=" + msgsubject + ", subjectText=" + subjectText);
 
   close_compose_window(compWin, false);
   close_window(msgWin);
 }
 
 /**
  * Test that replying to an attached .eml contains the expected texts.
  */
--- a/mail/test/mozmill/composition/test-image-display.js
+++ b/mail/test/mozmill/composition/test-image-display.js
@@ -1,25 +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/. */
 
 /**
  * Tests that we load and display embedded images in messages.
  */
 
-// make SOLO_TEST=composition/test-image-display.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-image-display";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [ "folder-display-helpers", "window-helpers",
-                        "compose-helpers" ];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var {IOUtils} = ChromeUtils.import("resource:///modules/IOUtils.js");
 
 var gImageFolder;
 
 function setupModule(module) {
--- a/mail/test/mozmill/composition/test-image-insertion-dialog.js
+++ b/mail/test/mozmill/composition/test-image-insertion-dialog.js
@@ -3,34 +3,42 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests the image insertion dialog functionality.
  */
 
 "use strict";
 
-var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-image-insertion-dialog";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "keyboard-helpers",
+];
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
-                       'window-helpers', 'keyboard-helpers'];
+var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var fdh, ch, wh, kh;
 
 function setupModule(module) {
-  fdh = collector.getModule('folder-display-helpers');
+  fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
   ch = collector.getModule("compose-helpers");
   ch.installInto(module);
-  wh = collector.getModule('window-helpers');
+  wh = collector.getModule("window-helpers");
   wh.installInto(module);
-  kh = collector.getModule('keyboard-helpers');
+  kh = collector.getModule("keyboard-helpers");
   kh.installInto(module);
 }
 
 function test_image_insertion_dialog_persist() {
   let cwc = open_compose_new_mail();
 
   // First focus on the editor element
   cwc.e("content-frame").focus();
--- a/mail/test/mozmill/composition/test-multipart-related.js
+++ b/mail/test/mozmill/composition/test-multipart-related.js
@@ -1,22 +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/. */
 
 /**
  * Tests that multipart/related messages are handled properly.
  */
 
-// make SOLO_TEST=composition/test-multipart-related.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-multipart-related";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var {MimeParser} = ChromeUtils.import("resource:///modules/mimeParser.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
@@ -42,21 +43,21 @@ function getMsgHeaders(aMsgHdr) {
   let msgUri = msgFolder.getUriForMsg(aMsgHdr);
 
   let messenger = Cc["@mozilla.org/messenger;1"]
                     .createInstance(Ci.nsIMessenger);
   let handler = {
     _done: false,
     _data: new Map(),
     _text: new Map(),
-    endMessage: function () { this._done = true; },
-    deliverPartData: function (num, text) {
+    endMessage() { this._done = true; },
+    deliverPartData(num, text) {
       this._text.set(num, this._text.get(num) + text);
     },
-    startPart: function (num, headers) {
+    startPart(num, headers) {
       this._data.set(num, headers);
       this._text.set(num, "");
     },
   };
   let streamListener = MimeParser.makeStreamListenerParser(handler,
     {strformat: "unicode"});
   messenger.messageServiceFromURI(msgUri).streamMessage(msgUri,
                                                         streamListener,
@@ -79,17 +80,17 @@ function test_basic_multipart_related() 
 
   const fname = "./tb-logo.png";
   let file = os.getFileForPath(os.abspath(fname, os.getFileForPath(__file__)));
   let fileHandler = Services.io.getProtocolHandler("file")
     .QueryInterface(Ci.nsIFileProtocolHandler);
   let fileURL = fileHandler.getURLSpecFromFile(file);
 
   // Add a simple image to our dialog
-  plan_for_modal_dialog("imageDlg", function (dialog) {
+  plan_for_modal_dialog("imageDlg", function(dialog) {
     // Insert the url of the image.
     dialog.type(null, fileURL);
     dialog.type(dialog.eid("altTextInput"), "Alt text");
     dialog.sleep(0);
 
     // Accept the dialog
     dialog.window.document.getElementById("imageDlg").acceptDialog();
   });
--- a/mail/test/mozmill/composition/test-newmsg-compose-identity.js
+++ b/mail/test/mozmill/composition/test-newmsg-compose-identity.js
@@ -4,21 +4,23 @@
 
 /**
  * Tests that compose new message chooses the correct initial identity when
  * called from the context of an open composer.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-newmsg-compose-identity";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                       "window-helpers", "compose-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var gInbox;
 var gDrafts;
 var account;
 
 var identityKey1;
--- a/mail/test/mozmill/composition/test-reply-addresses.js
+++ b/mail/test/mozmill/composition/test-reply-addresses.js
@@ -3,25 +3,25 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that we get correct adressees for different type of replies:
  * reply to sender, reply to all, reply to list, mail-followup-tp,
  * mail-reply-to, and reply to self.
  */
 
-// make SOLO_TEST=composition/test-reply-addresses.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-reply-addresses";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                         "window-helpers", "compose-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
 
 var folder;
 var i = 0;
 
 var myEmail = "me@example.com";
 var myEmail2 = "otherme@example.com";
 
 var identity;
@@ -177,17 +177,17 @@ function ensureNoAutoBcc(aIdentity) {
 function testReplyToMungedReplyToList() {
   let msg0 = create_message({
     from: "Tester <test@example.com>",
     to: "munged.list@example.com, someone.else@example.com",
     subject: "testReplyToMungedReplyToList",
     clobberHeaders: {
       "Reply-To": "Munged List <munged.list@example.com>",
       "List-Post": "<mailto:munged.list@example.com>",
-    }
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -198,39 +198,39 @@ function testReplyToMungedReplyToList() 
   );
 
   checkReply(
     open_compose_with_reply_to_all,
     {
       "addr_to": [
         "Munged List <munged.list@example.com>",
         "someone.else@example.com",
-        "Tester <test@example.com>"
-       ]
+        "Tester <test@example.com>",
+       ],
     }
   );
 
   checkReply(
     open_compose_with_reply_to_list,
     {
-      "addr_to": ["munged.list@example.com"]
+      "addr_to": ["munged.list@example.com"],
     }
   );
 }
 
 /**
  * Tests that addresses get set properly when doing a normal reply.
  */
 function testToCcReply() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "Mr Burns <mrburns@example.com>, workers@example.com, " +
         myEmail,
     cc: "Lisa <lisa@example.com>",
-    subject: "testToCcReply - normal mail with to and cc (me in To)"
+    subject: "testToCcReply - normal mail with to and cc (me in To)",
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -242,85 +242,89 @@ function testToCcReply() {
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply,
     // To: From
     // Cc: identity Cc list, including self.
     {
       "addr_to": ["Homer <homer@example.com>"],
-      "addr_cc": [myEmail, "smithers@example.com"]
+      "addr_cc": [myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly when doing a normal reply to all.
  */
 function testToCcReplyAll() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "Mr Burns <mrburns@example.com>, workers@example.com, " +
         myEmail,
     cc: "Lisa <lisa@example.com>",
-    subject: "testToCcReplyAll - normal mail with to and cc (me in To)"
+    subject: "testToCcReplyAll - normal mail with to and cc (me in To)",
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
   checkReply(
     open_compose_with_reply_to_all,
     // To: From + Tos without me.
     // Cc: original Ccs
     {
       "addr_to": ["Homer <homer@example.com>",
                   "Mr Burns <mrburns@example.com>",
                   "workers@example.com"],
-      "addr_cc": ["Lisa <lisa@example.com>"]
+      "addr_cc": ["Lisa <lisa@example.com>"],
     }
   );
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply_to_all,
     // To: From + Tos without me.
     // Cc: original Ccs + auto-Ccs
     {
       "addr_to": ["Homer <homer@example.com>",
                   "Mr Burns <mrburns@example.com>",
                   "workers@example.com"],
       "addr_cc": ["Lisa <lisa@example.com>",
                   myEmail,
-                  "smithers@example.com"]
+                  "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that that addresses get set properly when doing a normal reply to all
  * where when recipients aren't all ascii.
  */
 function testToCcReplyAllInternational() {
   let msg0 = create_message({
     from: "Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= <hideaki@example.com>",
     to: "Mr Burns <mrburns@example.com>, =?UTF-8?B?w4VrZQ==?= <ake@example.com>, " +
         "=?KOI8-R?Q?=E9=D7=C1=CE?= <ivan@example.com>, " + myEmail,
     cc: "=?Big5?B?pP2oca1e?= <xiuying@example.com>",
     subject: "testToCcReplyAllInternational - non-ascii people mail with to and cc (me in To)",
-    clobberHeaders: { 'Content-Transfer-Encoding': 'quoted-printable' },
+    clobberHeaders: { "Content-Transfer-Encoding": "quoted-printable" },
     // Content-Transfer-Encoding ^^^ should be set from the body encoding below,
-    //but that doesn't seem to work. (No Content-Transfer-Encoding header is
+    // but that doesn't seem to work. (No Content-Transfer-Encoding header is
     // generated).
-    body: {charset: "windows-1251", encoding: "quoted-printable", body: "=CF=F0=E8=E2=E5=F2 =E8=E7 =CC=EE=F1=EA=E2=FB"}
+    body: {
+      charset: "windows-1251",
+      encoding: "quoted-printable",
+      body: "=CF=F0=E8=E2=E5=F2 =E8=E7 =CC=EE=F1=EA=E2=FB",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -328,49 +332,49 @@ function testToCcReplyAllInternational()
     open_compose_with_reply_to_all,
     // To: From + Tos without me.
     // Cc: original Ccs
     {
       "addr_to": ["Hideaki / 吉藤英明 <hideaki@example.com>",
                   "Mr Burns <mrburns@example.com>",
                   "Åke <ake@example.com>",
                   "Иван <ivan@example.com>"],
-      "addr_cc": ["王秀英 <xiuying@example.com>"]
+      "addr_cc": ["王秀英 <xiuying@example.com>"],
     }
   );
 
   useAutoCc(identity, "Åsa <asa@example.com>");
   checkReply(
     open_compose_with_reply_to_all,
     // To: From + Tos without me.
     // Cc: original Ccs + auto-Ccs
     {
       "addr_to": ["Hideaki / 吉藤英明 <hideaki@example.com>",
                   "Mr Burns <mrburns@example.com>",
                   "Åke <ake@example.com>",
                   "Иван <ivan@example.com>"],
-      "addr_cc": ["王秀英 <xiuying@example.com>", "Åsa <asa@example.com>"]
+      "addr_cc": ["王秀英 <xiuying@example.com>", "Åsa <asa@example.com>"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that that addresses get set properly when doing a reply to a mail with
  * reply-to set.
  */
 function testToCcReplyWhenReplyToSet() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "workers@example.com",
     cc: "Lisa <lisa@example.com>, " + myEmail,
     subject: "testToCcReplyWhenReplyToSet - to/cc mail with reply-to set (me in Cc)",
     clobberHeaders: {
-      "Reply-To": "marge@example.com"
-    }
+      "Reply-To": "marge@example.com",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -382,80 +386,80 @@ function testToCcReplyWhenReplyToSet() {
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply,
     // To: reply-to
     // Cc: auto-Ccs
     {
       "addr_to": ["marge@example.com"],
-      "addr_cc": [myEmail, "smithers@example.com"]
+      "addr_cc": [myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly when doing a reply to all for a mail
  * w/ Reply-To.
  */
 function testToCcReplyAllWhenReplyToSet() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "workers@example.com",
     cc: "Lisa <lisa@example.com>, " + myEmail,
     subject: "testToCcReplyAllWhenReplyToSet - to/cc mail with reply-to set (me in Cc)",
     clobberHeaders: {
-      "Reply-To": "marge@example.com"
-    }
+      "Reply-To": "marge@example.com",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
   checkReply(
     open_compose_with_reply_to_all,
     // To: Reply-To + Tos
     // Cc: original Ccs without me.
     {
       "addr_to": ["marge@example.com",
                   "workers@example.com"],
-      "addr_cc": ["Lisa <lisa@example.com>"]
+      "addr_cc": ["Lisa <lisa@example.com>"],
     }
   );
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply_to_all,
     // To: Reply-To + Tos
     // Cc: original Ccs + auto-Ccs (which includes me!)
     {
       "addr_to": ["marge@example.com",
                   "workers@example.com"],
-      "addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"]
+      "addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly when doing a reply to list.
  */
 function testReplyToList() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "workers-list@example.com",
     cc: "Lisa <lisa@example.com>, " + myEmail,
     subject: "testReplyToList - mailing list message (me in Cc)",
     clobberHeaders: {
-      "List-Post": "<mailto:workers-list@example.com>"
-    }
+      "List-Post": "<mailto:workers-list@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -467,35 +471,35 @@ function testReplyToList() {
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply_to_list,
     // To: the list
     // Cc: auto-Ccs
     {
       "addr_to": ["workers-list@example.com"],
-      "addr_cc": [myEmail, "smithers@example.com"]
+      "addr_cc": [myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly when doing a reply to sender for a
  * list post.
  */
 function testReplySenderForListPost() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "workers-list@example.com",
     cc: "Lisa <lisa@example.com>, " + myEmail,
     subject: "testReplySenderForListPost - mailing list message (me in Cc)",
     clobberHeaders: {
-      "List-Post": "<mailto:workers-list@example.com>"
-    }
+      "List-Post": "<mailto:workers-list@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -507,60 +511,60 @@ function testReplySenderForListPost() {
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply,
     // To: From
     // Cc: auto-Ccs
     {
       "addr_to": ["Homer <homer@example.com>"],
-      "addr_cc": [myEmail, "smithers@example.com"]
+      "addr_cc": [myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly when doing a reply all to a list post.
  */
 function testReplyToAllForListPost() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "workers-list@example.com",
     cc: "Lisa <lisa@example.com>, " + myEmail,
     subject: "testReplyToAllForListPost - mailing list message (me in Cc)",
     clobberHeaders: {
-      "List-Post": "<mailto:workers-list@example.com>"
-    }
+      "List-Post": "<mailto:workers-list@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
   checkReply(
     open_compose_with_reply_to_all,
     // To: From + original To
     // Cc: original CC without me
     {
       "addr_to": ["Homer <homer@example.com>", "workers-list@example.com"],
-      "addr_cc": ["Lisa <lisa@example.com>"]
+      "addr_cc": ["Lisa <lisa@example.com>"],
     }
   );
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply_to_all,
     // To: From + original To
     // Cc: original CC + auto-Ccs (including me!)
     {
     "addr_to": ["Homer <homer@example.com>", "workers-list@example.com"],
-    "addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"]
+    "addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly when doing a reply to all for a list
  * post when also reply-to is set.
@@ -568,44 +572,44 @@ function testReplyToAllForListPost() {
 function testReplyToListWhenReplyToSet() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "workers-list@example.com, " + myEmail,
     cc: "Lisa <lisa@example.com>",
     subject: "testReplyToListWhenReplyToSet - mailing list message w/ cc, reply-to (me in To)",
     clobberHeaders: {
       "Reply-To": "marge@example.com",
-      "List-Post": "<mailto:workers-list@example.com>"
-    }
+      "List-Post": "<mailto:workers-list@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
   checkReply(
     open_compose_with_reply_to_all,
     // To: Reply-To, original Tos
     // Cc: original Cc
     {
       "addr_to": ["marge@example.com", "workers-list@example.com"],
-      "addr_cc": ["Lisa <lisa@example.com>"]
+      "addr_cc": ["Lisa <lisa@example.com>"],
     }
   );
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply_to_all,
     // To: Reply-To, original Tos
     // Cc: original Cc + auto-Ccs
     {
       "addr_to": ["marge@example.com", "workers-list@example.com"],
-      "addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"]
+      "addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Test that addresses get set properly for Mail-Reply-To. Mail-Reply-To should
  * be used for reply to author, if present.
@@ -614,18 +618,18 @@ function testReplyToListWhenReplyToSet()
 function testMailReplyTo() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "workers-list@example.com",
     cc: "Lisa <lisa@example.com>",
     subject: "testMailReplyTo - mail with Mail-Reply-To header",
     clobberHeaders: {
       "Reply-To": "workers-list@example.com", // reply-to munging
-      "Mail-Reply-To": "Homer S. <homer@example.com>"
-    }
+      "Mail-Reply-To": "Homer S. <homer@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -637,17 +641,17 @@ function testMailReplyTo() {
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply,
     // To: Mail-Reply-To
     // Cc: auto-Ccs
     {
       "addr_to": ["Homer S. <homer@example.com>"],
-      "addr_cc": [myEmail, "smithers@example.com"]
+      "addr_cc": [myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Test that addresses get set properly Mail-Followup-To. Mail-Followup-To
  * should be the default recipient list for reply-all, if present.
@@ -657,18 +661,18 @@ function testMailFollowupTo() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "workers-list@example.com, " + myEmail,
     cc: "Lisa <lisa@example.com>",
     subject: "testMailFollowupTo - mail with Mail-Followup-To header",
     clobberHeaders: {
       // Homer is on the list, and don't want extra copies, so he has
       // set the Mail-Followup-To header so followups go to the list.
-      "Mail-Followup-To": "workers-list@example.com"
-    }
+      "Mail-Followup-To": "workers-list@example.com",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -680,63 +684,63 @@ function testMailFollowupTo() {
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply_to_all,
     // To: Mail-Followup-To
     // Cc: auto-Ccs
     {
       "addr_to": ["workers-list@example.com"],
-      "addr_cc": [myEmail, "smithers@example.com"]
+      "addr_cc": [myEmail, "smithers@example.com"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly for reply to self.
  */
 function testReplyToSelfReply() {
   let msg0 = create_message({
     from: myEmail,
     to: "Bart <bart@example.com>, Maggie <maggie@example.com>",
     cc: "Lisa <lisa@example.com>",
     subject: "testReplyToSelfReply - reply to self",
     clobberHeaders: {
       "Bcc": "Moe <moe@example.com>",
-      "Reply-To": "Flanders <flanders@example.com>"
-    }
+      "Reply-To": "Flanders <flanders@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
   checkReply(
     open_compose_with_reply,
     // To: original To
     // Reply-To: original Reply-To
     {
       "addr_to": ["Bart <bart@example.com>", "Maggie <maggie@example.com>"],
-      "addr_reply": ["Flanders <flanders@example.com>"]
+      "addr_reply": ["Flanders <flanders@example.com>"],
     }
   );
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply,
     // To: original To
     // Cc: auto-Ccs
     // Reply-To: original Reply-To
     {
       "addr_to": ["Bart <bart@example.com>", "Maggie <maggie@example.com>"],
       "addr_cc": [myEmail, "smithers@example.com"],
-      "addr_reply": ["Flanders <flanders@example.com>"]
+      "addr_reply": ["Flanders <flanders@example.com>"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly for a reply all to self - this should
  * be treated as a followup.
@@ -744,18 +748,18 @@ function testReplyToSelfReply() {
 function testReplyToSelfReplyAll() {
   let msg0 = create_message({
     from: myEmail,
     to: "Bart <bart@example.com>, Maggie <maggie@example.com>",
     cc: "Lisa <lisa@example.com>",
     subject: "testReplyToSelfReplyAll - reply to self",
     clobberHeaders: {
       "Bcc": "Moe <moe@example.com>",
-      "Reply-To": "Flanders <flanders@example.com>"
-    }
+      "Reply-To": "Flanders <flanders@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -765,34 +769,34 @@ function testReplyToSelfReplyAll() {
     // Cc: original Cc
     // Bcc: original Bcc
     // Reply-To: original Reply-To
     {
       "addr_to": ["Bart <bart@example.com>",
                   "Maggie <maggie@example.com>"],
       "addr_cc": ["Lisa <lisa@example.com>"],
       "addr_bcc": ["Moe <moe@example.com>"],
-      "addr_reply": ["Flanders <flanders@example.com>"]
+      "addr_reply": ["Flanders <flanders@example.com>"],
     }
   );
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   useAutoBcc(identity, "Lisa <lisa@example.com>");
   checkReply(
     open_compose_with_reply_to_all,
     // To: original To
     // Cc: original Cc (auto-Ccs would have been included here already)
     // Bcc: original Bcc
     // Reply-To: original Reply-To
     {
       "addr_to": ["Bart <bart@example.com>",
                   "Maggie <maggie@example.com>"],
       "addr_cc": ["Lisa <lisa@example.com>"],
       "addr_bcc": ["Moe <moe@example.com>"],
-      "addr_reply": ["Flanders <flanders@example.com>"]
+      "addr_reply": ["Flanders <flanders@example.com>"],
     }
   );
   stopUsingAutoCc(identity);
   stopUsingAutoBcc(identity);
 }
 
 /**
  * Tests that addresses get set properly for a reply all to self - but for a
@@ -801,18 +805,18 @@ function testReplyToSelfReplyAll() {
  */
 function testReplyToSelfNotOriginalSourceMsgReplyAll() {
   let msg0 = create_message({
     from: myEmail2,
     to: "Bart <bart@example.com>, Maggie <maggie@example.com>",
     cc: "Lisa <lisa@example.com>",
     subject: "testReplyToSelfNotOriginalSourceMsgReplyAll - reply to self",
     clobberHeaders: {
-      "Reply-To": "Flanders <flanders@example.com>"
-    }
+      "Reply-To": "Flanders <flanders@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity2);
@@ -823,17 +827,17 @@ function testReplyToSelfNotOriginalSourc
     // Cc: original Cc
     // Bcc: auto-bccs
     // Reply-To: original Reply-To
     {
       "addr_to": ["Bart <bart@example.com>",
                   "Maggie <maggie@example.com>"],
       "addr_cc": ["Lisa <lisa@example.com>"],
       "addr_bcc": [myEmail, "smithers@example.com"],
-      "addr_reply": ["Flanders <flanders@example.com>"]
+      "addr_reply": ["Flanders <flanders@example.com>"],
     }
   );
   stopUsingAutoBcc(identity2);
 
   useAutoCc(identity2, myEmail + ", smithers@example.com");
   useAutoBcc(identity2, "moe@example.com,bart@example.com,lisa@example.com");
   checkReply(
     open_compose_with_reply_to_all,
@@ -841,17 +845,17 @@ function testReplyToSelfNotOriginalSourc
     // Cc: original Cc (auto-Ccs would have been included here already)
     // Bcc: auto-bcc minus addresses already in To/Cc
     // Reply-To: original Reply-To
     {
       "addr_to": ["Bart <bart@example.com>",
                   "Maggie <maggie@example.com>"],
       "addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"],
       "addr_bcc": ["moe@example.com"],
-      "addr_reply": ["Flanders <flanders@example.com>"]
+      "addr_reply": ["Flanders <flanders@example.com>"],
     }
   );
   stopUsingAutoCc(identity2);
   stopUsingAutoBcc(identity2);
 
   useAutoBcc(identity2, myEmail2 + ", smithers@example.com");
   checkReply(
     open_compose_with_reply_to_all,
@@ -859,70 +863,70 @@ function testReplyToSelfNotOriginalSourc
     // Cc: original Cc (auto-Ccs would have been included here already)
     // Bcc: auto-bccs
     // Reply-To: original Reply-To
     {
       "addr_to": ["Bart <bart@example.com>",
                   "Maggie <maggie@example.com>"],
       "addr_cc": ["Lisa <lisa@example.com>"],
       "addr_bcc": [myEmail2, "smithers@example.com"],
-      "addr_reply": ["Flanders <flanders@example.com>"]
+      "addr_reply": ["Flanders <flanders@example.com>"],
     }
   );
   stopUsingAutoBcc(identity2);
 }
 
 /**
  * Tests that a reply to an other identity isn't treated as a reply to self
  * followup.
  */
 function testReplyToOtherIdentity() {
   let msg0 = create_message({
     from: myEmail,
     to: myEmail2 + ", barney@example.com",
     cc: "Lisa <lisa@example.com>",
     subject: "testReplyToOtherIdentity - reply to other identity",
     clobberHeaders: {
-      "Reply-To": "secretary@example.com"
-    }
+      "Reply-To": "secretary@example.com",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity2);
   ensureNoAutoBcc(identity2);
   checkReply(
     open_compose_with_reply_to_all,
     // To: from + to (except me2)
     // Cc: original Cc
     //
     {
       "addr_to": ["secretary@example.com", "barney@example.com"],
-      "addr_cc": ["Lisa <lisa@example.com>"]
+      "addr_cc": ["Lisa <lisa@example.com>"],
     }
   );
 }
 
 /**
  * Tests that addresses get set properly for a reply all to self w/ bccs -
  * this should be treated as a followup.
  */
 function testReplyToSelfWithBccs() {
   let msg0 = create_message({
     from: myEmail,
     to: myEmail,
     cc: myEmail2 + ", Lisa <lisa@example.com>",
     subject: "testReplyToSelfWithBccs - reply to self",
     clobberHeaders: {
       "Bcc": "Moe <moe@example.com>, Barney <barney@example.com>",
-      "Reply-To": myEmail2
-    }
+      "Reply-To": myEmail2,
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
@@ -931,154 +935,154 @@ function testReplyToSelfWithBccs() {
     // To: original To
     // Cc: original Cc
     // Bcc: original Bcc
     // Reply-To: original Reply-To
     {
       "addr_to": [myEmail],
       "addr_cc": [myEmail2, "Lisa <lisa@example.com>"],
       "addr_bcc": ["Moe <moe@example.com>", "Barney <barney@example.com>"],
-      "addr_reply": [myEmail2]
+      "addr_reply": [myEmail2],
     }
   );
 }
 
 /**
  * Tests that addresses get set properly for a reply all to other identity w/ bccs -
  * this be treated as a followup.
  */
 function testReplyToOtherIdentityWithBccs() {
   let msg0 = create_message({
     from: myEmail,
     to: myEmail2,
     cc: "Lisa <lisa@example.com>",
     subject: "testReplyToOtherIdentityWithBccs - reply to other identity",
     clobberHeaders: {
-      "Bcc": "Moe <moe@example.com>, Barney <barney@example.com>"
-    }
+      "Bcc": "Moe <moe@example.com>, Barney <barney@example.com>",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
   checkReply(
     open_compose_with_reply_to_all,
     // To: original To
     // Cc: original Cc
     // Bcc: original Bcc
     {
       "addr_to": [myEmail2],
       "addr_cc": ["Lisa <lisa@example.com>"],
-      "addr_bcc": ["Moe <moe@example.com>", "Barney <barney@example.com>"]
+      "addr_bcc": ["Moe <moe@example.com>", "Barney <barney@example.com>"],
     }
   );
 }
 
 /**
  * Tests that addresses get set properly for a nntp reply-all.
  */
 function testNewsgroupsReplyAll() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "test1-list@example.org",
     subject: "testNewsgroupsReplyAll - sent to two newsgroups and a list",
     clobberHeaders: {
-      "Newsgroups": "example.test1, example.test2"
-    }
+      "Newsgroups": "example.test1, example.test2",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
   checkReply(
      open_compose_with_reply_to_all,
     // To: From, original To
     // Newsgroups: original Ccs
     {
       "addr_to": ["Homer <homer@example.com>", "test1-list@example.org"],
-      "addr_newsgroups": ["example.test1", "example.test2"]
+      "addr_newsgroups": ["example.test1", "example.test2"],
     }
   );
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
      open_compose_with_reply_to_all,
     // To: From, original To
     // Newsgroups: original Ccs
     {
       "addr_to": ["Homer <homer@example.com>", "test1-list@example.org"],
       "addr_cc": [myEmail, "smithers@example.com"],
-      "addr_newsgroups": ["example.test1", "example.test2"]
+      "addr_newsgroups": ["example.test1", "example.test2"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly for an nntp followup, when Followup-To
  * is set.
  */
 function testNewsgroupsReplyAllFollowupTo() {
   let msg0 = create_message({
     from: "Homer <homer@example.com>",
     to: "test1-list@example.org, " + myEmail,
     subject: "testNewsgroupsReplyAllFollowupTo - Followup-To set",
     clobberHeaders: {
       "Newsgroups": "example.test1, example.test2",
-      "Followup-To": "example.test2"
-    }
+      "Followup-To": "example.test2",
+    },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
   checkReply(
     open_compose_with_reply_to_all,
     // To: From + original To (except me)
     // Newsgroups: <Followup-To>
     {
       "addr_to": ["Homer <homer@example.com>", "test1-list@example.org"],
-      "addr_newsgroups": ["example.test2"]
+      "addr_newsgroups": ["example.test2"],
     }
   );
 
   useAutoCc(identity, myEmail + ", smithers@example.com");
   checkReply(
     open_compose_with_reply_to_all,
     // To: From + original To (except me)
     // Cc: auto-Ccs
     // Newsgroups: <Followup-To>
     {
       "addr_to": ["Homer <homer@example.com>", "test1-list@example.org"],
       "addr_cc": [myEmail, "smithers@example.com"],
-      "addr_newsgroups": ["example.test2"]
+      "addr_newsgroups": ["example.test2"],
     }
   );
   stopUsingAutoCc(identity);
 }
 
 /**
  * Tests that addresses get set properly when doing a reply where To=From
  * and a Reply-To exists.
  */
 function testToFromWithReplyTo() {
   let msg0 = create_message({
     from: myEmail,
     to: myEmail,
     subject: "testToFromWithReplyTo - To=From w/ Reply-To set",
-    clobberHeaders: { "Reply-To": "Flanders <flanders@example.com>" }
+    clobberHeaders: { "Reply-To": "Flanders <flanders@example.com>" },
   });
   add_message_to_folder(folder, msg0);
 
   be_in_folder(folder);
   let msg = select_click_row(i++);
   assert_selected_and_displayed(mc, msg);
 
   ensureNoAutoCc(identity);
--- a/mail/test/mozmill/composition/test-reply-format-flowed.js
+++ b/mail/test/mozmill/composition/test-reply-format-flowed.js
@@ -1,22 +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/. */
 
 /**
  * Tests that the reply to a format=flowed message is also flowed.
  */
 
-// make SOLO_TEST=composition/test-reply-format-flowed.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-reply-format-flowed";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
--- a/mail/test/mozmill/composition/test-reply-multipart-charset.js
+++ b/mail/test/mozmill/composition/test-reply-multipart-charset.js
@@ -15,22 +15,23 @@
  *
  * Bug 1323377:
  * Tests that the correct charset is used, even if the message
  * wasn't viewed before answering/forwarding.
  * For good measure some tests are included for charset overriding
  * and enforcing the charset default.
  */
 
-// make SOLO_TEST=composition/test-reply-multipart-charset.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-reply-multipart-charset";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
 var folderToStoreMessages;
 
--- a/mail/test/mozmill/composition/test-reply-signature.js
+++ b/mail/test/mozmill/composition/test-reply-signature.js
@@ -1,25 +1,31 @@
 /* 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/. */
 
 /**
  * Tests the mail.strip_sig_on_reply pref.
  */
 
-// make SOLO_TEST=composition/test-reply-signature.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-message-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-reply-signature";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers",
-                         "message-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "message-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var sig = "roses are red";
 var folder;
 
 function setupModule(module) {
     for (let req of MODULE_REQUIRES) {
@@ -30,32 +36,32 @@ function setupModule(module) {
 
   let msg = create_message({
     subject: "msg with signature; format=flowed",
     body: {
       body: "get with the flow! get with the flow! get with the flow! " +
         "get with the \n flow! get with the flow!\n-- \n" + sig + "\n",
       contentType: "text/plain",
       charset: "UTF-8",
-      format: "flowed"
-    }
+      format: "flowed",
+    },
   });
   add_message_to_folder(folder, msg);
   let msg2 = create_message({
     subject: "msg with signature; format not flowed",
     body: {
       body: "not flowed! not flowed! not flowed! \n" +
         "not flowed!\n-- \n" + sig + "\n",
       contentType: "text/plain",
       charset: "UTF-8",
-      format: ""
-    }
+      format: "",
+    },
   });
   add_message_to_folder(folder, msg2);
-};
+}
 
 /** Test sig strip true for format flowed. */
 function test_sig_strip_true_ff() {
   Services.prefs.setBoolPref("mail.strip_sig_on_reply", true);
   check_sig_strip_works(0, true);
   Services.prefs.clearUserPref("mail.strip_sig_on_reply");
 }
 
@@ -90,16 +96,15 @@ function check_sig_strip_works(aRow, aSh
   let msg = select_click_row(aRow);
   assert_selected_and_displayed(mc, msg);
 
   let rwc = open_compose_with_reply();
   let body = get_compose_body(rwc);
 
   if (aShouldStrip && body.textContent.includes(sig)) {
     throw new Error("signature was not stripped; body=" + body.textContent);
-  }
-  else if (!aShouldStrip && !body.textContent.includes(sig)) {
+  } else if (!aShouldStrip && !body.textContent.includes(sig)) {
     throw new Error("signature stripped; body=" + body.textContent);
   }
   close_compose_window(rwc);
 }
 
 
--- a/mail/test/mozmill/composition/test-save-changes-on-quit.js
+++ b/mail/test/mozmill/composition/test-save-changes-on-quit.js
@@ -3,27 +3,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests that we prompt the user if they'd like to save their message when they
  * try to quit/close with an open compose window with unsaved changes, and
  * that we don't prompt if there are no changes.
  */
 
-// make SOLO_TEST=composition/test-save-changes-on-quit.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-prompt-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-save-changes-on-quit";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "prompt-helpers",
+  "window-helpers",
+];
 
-var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
-                         "prompt-helpers", "window-helpers"];
-var SAVE = 0
-var CANCEL = 1
+var SAVE = 0;
+var CANCEL = 1;
 var DONT_SAVE = 2;
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var cwc = null; // compose window controller
 var folder = null;
 
 function setupModule(module) {
@@ -167,17 +174,17 @@ function test_window_quit_state_reset_on
   // This is a hacky method for making sure that the second window
   // receives a CANCEL click in the popup dialog.
   var numOfPrompts = 0;
   gMockPromptService.onPromptCallback = function() {
     numOfPrompts++;
 
     if (numOfPrompts > 1)
       gMockPromptService.returnValue = CANCEL;
-  }
+  };
 
   gMockPromptService.returnValue = DONT_SAVE;
 
   // Trigger the quit-application-request notification
   Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
 
   // We should have cancelled the quit appropriately.
   assert_true(cancelQuit.data);
--- a/mail/test/mozmill/composition/test-send-button.js
+++ b/mail/test/mozmill/composition/test-send-button.js
@@ -3,41 +3,49 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Tests proper enabling of send buttons depending on addresses input.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-address-book-helpers.js */
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-send-button";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
-                         "window-helpers", "address-book-helpers"];
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "address-book-helpers",
+];
 
 var {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var account = null;
 
-var setupModule = function (module) {
+function setupModule(module) {
   collector.getModule("folder-display-helpers").installInto(module);
   collector.getModule("compose-helpers").installInto(module);
   collector.getModule("window-helpers").installInto(module);
   collector.getModule("address-book-helpers").installInto(module);
 
   // Ensure we're in the tinderbox account as that has the right identities set
   // up for this test.
   let server = MailServices.accounts.FindServer("tinderbox", FAKE_SERVER_HOSTNAME, "pop3");
   account = MailServices.accounts.FindAccountForServer(server);
   let inbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
   be_in_folder(inbox);
-};
+}
 
 /**
  * Check if the send commands are in the wished state.
  *
  * @param aCwc      The compose window controller.
  * @param aEnabled  The expected state of the commands.
  */
 function check_send_commands_state(aCwc, aEnabled) {
@@ -54,17 +62,16 @@ function check_send_commands_state(aCwc,
 }
 
 /**
  * Bug 431217
  * Test that the Send buttons are properly enabled if an addressee is input
  * by the user.
  */
 function test_send_enabled_manual_address() {
-  let isMac = AppConstants.platform == "macosx";
   let cwc = open_compose_new_mail(); // compose controller
   // On an empty window, Send must be disabled.
   check_send_commands_state(cwc, false);
 
   // On valid "To:" addressee input, Send must be enabled.
   toggle_recipient_type(cwc, "addr_to");
   setup_msg_contents(cwc, " recipient@fake.invalid ", "", "");
   check_send_commands_state(cwc, true);
--- a/mail/test/mozmill/composition/test-send-format.js
+++ b/mail/test/mozmill/composition/test-send-format.js
@@ -2,29 +2,28 @@
  * 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/. */
 
 /**
  * Tests resulting send format of a message dependent on using HTML features
  * in the composition.
  */
 
-// make SOLO_TEST=composition/test-send-format.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-send-format";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
-const nsIMsgCompConvertible = Ci.nsIMsgCompConvertible;
-
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 }
 
 function checkMsgFile(aFilePath, aConvertibility) {
   let file = os.getFileForPath(os.abspath(aFilePath,
@@ -39,20 +38,20 @@ function checkMsgFile(aFilePath, aConver
   close_compose_window(cwc);
   close_window(msgc);
 }
 
 /**
  * Tests that we only open one compose window for one instance of a draft.
  */
 function test_msg_convertibility() {
-  checkMsgFile("./format1-plain.eml", nsIMsgCompConvertible.Plain);
+  checkMsgFile("./format1-plain.eml", Ci.nsIMsgCompConvertible.Plain);
 
   // Bug 1385636
-  checkMsgFile("./format1-altering.eml", nsIMsgCompConvertible.Altering);
+  checkMsgFile("./format1-altering.eml", Ci.nsIMsgCompConvertible.Altering);
 
   // Bug 584313
-  checkMsgFile("./format2-style-attr.eml", nsIMsgCompConvertible.No);
-  checkMsgFile("./format3-style-tag.eml", nsIMsgCompConvertible.No);
+  checkMsgFile("./format2-style-attr.eml", Ci.nsIMsgCompConvertible.No);
+  checkMsgFile("./format3-style-tag.eml", Ci.nsIMsgCompConvertible.No);
 }
 
 function teardownModule() {
 }
--- a/mail/test/mozmill/composition/test-signature-init.js
+++ b/mail/test/mozmill/composition/test-signature-init.js
@@ -4,31 +4,33 @@
 
 /**
  * Tests that the compose window initializes with the signature correctly
  * under various circumstances.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-signature-init';
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['compose-helpers',
-                         'folder-display-helpers'];
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
 
-var kHtmlPref = 'mail.identity.default.compose_html';
-var kReplyOnTopPref = 'mail.identity.default.reply_on_top';
+var MODULE_NAME = "test-signature-init";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["compose-helpers", "folder-display-helpers"];
+
+var kHtmlPref = "mail.identity.default.compose_html";
+var kReplyOnTopPref = "mail.identity.default.reply_on_top";
 var kReplyOnTop = 1;
-var kSigBottomPref = 'mail.identity.default.sig_bottom';
+var kSigBottomPref = "mail.identity.default.sig_bottom";
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function setupModule(module) {
-  collector.getModule('folder-display-helpers').installInto(module);
-  collector.getModule('compose-helpers').installInto(module);
+  collector.getModule("folder-display-helpers").installInto(module);
+  collector.getModule("compose-helpers").installInto(module);
 }
 
 /**
  * Regression test for bug 762413 - tests that when we're set to reply above,
  * with the signature below the reply, we initialize the compose window such
  * that there is a <br> node above the signature. This allows the user to
  * insert text before the signature.
  */
@@ -40,15 +42,15 @@ function test_on_reply_above_signature_b
   Services.prefs.setBoolPref(kHtmlPref, false);
   Services.prefs.setIntPref(kReplyOnTopPref, kReplyOnTop);
   Services.prefs.setBoolPref(kSigBottomPref, false);
 
   let cw = open_compose_new_mail();
   let mailBody = get_compose_body(cw);
 
   let node = mailBody.firstChild;
-  assert_equals(node.localName, 'br',
-                'Expected a BR node to start the compose body.');
+  assert_equals(node.localName, "br",
+                "Expected a BR node to start the compose body.");
 
   Services.prefs.setBoolPref(kHtmlPref, origHtml);
   Services.prefs.setIntPref(kReplyOnTopPref, origReplyOnTop);
   Services.prefs.setBoolPref(kSigBottomPref, origSigBottom);
 }
--- a/mail/test/mozmill/composition/test-signature-updating.js
+++ b/mail/test/mozmill/composition/test-signature-updating.js
@@ -1,45 +1,47 @@
 /* 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/. */
 
 /**
  * Tests that the signature updates properly when switching identities.
  */
 
-// make SOLO_TEST=composition/test-signature-updating.js mozmill-one
-
 // mail.identity.id1.htmlSigFormat = false
 // mail.identity.id1.htmlSigText   = "Tinderbox is soo 90ies"
 
 // mail.identity.id2.htmlSigFormat = true
 // mail.identity.id2.htmlSigText   = "Tinderboxpushlog is the new <b>hotness!</b>"
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-signature-updating";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
+
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var cwc = null; // compose window controller
 
-var setupModule = function (module) {
+function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
   // Ensure we're in the tinderbox account as that has the right identities set
   // up for this test.
   let server = MailServices.accounts.FindServer("tinderbox", FAKE_SERVER_HOSTNAME, "pop3");
   let inbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
   be_in_folder(inbox);
-};
+}
 
 function teardownModule(module) {
   Services.prefs.clearUserPref("mail.compose.default_to_paragraph");
   Services.prefs.clearUserPref("mail.identity.id1.compose_html");
   Services.prefs.clearUserPref("mail.identity.id1.suppress_signature_separator");
   Services.prefs.clearUserPref("mail.identity.id2.suppress_signature_separator");
 }
 
--- a/mail/test/mozmill/content-policy/test-compose-mailto.js
+++ b/mail/test/mozmill/content-policy/test-compose-mailto.js
@@ -1,45 +1,54 @@
 /* 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/. */
 
 "use strict";
 
-var MODULE_NAME = 'test-compose-mailto';
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
-                       'window-helpers', 'keyboard-helpers',
-                       'content-tab-helpers'];
+var MODULE_NAME = "test-compose-mailto";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "compose-helpers",
+  "window-helpers",
+  "keyboard-helpers",
+  "content-tab-helpers",
+];
 
 var folder = null;
 var composeHelper = null;
 var windowHelper = null;
 var gMsgNo = 0;
 var gComposeWin;
 var gNewTab;
 var gPreCount;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
-var url = collector.addHttpResource('../content-policy/html', 'content');
+var url = collector.addHttpResource("../content-policy/html", "content");
 
-var setupModule = function (module) {
-  let fdh = collector.getModule('folder-display-helpers');
+function setupModule(module) {
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let kh = collector.getModule('keyboard-helpers');
+  let kh = collector.getModule("keyboard-helpers");
   kh.installInto(module);
-  composeHelper = collector.getModule('compose-helpers');
+  composeHelper = collector.getModule("compose-helpers");
   composeHelper.installInto(module);
-  windowHelper = collector.getModule('window-helpers');
+  windowHelper = collector.getModule("window-helpers");
   windowHelper.installInto(module);
   let cth = collector.getModule("content-tab-helpers");
   cth.installInto(module);
-};
+}
 
 function test_openComposeFromMailToLink() {
   // Open a content tab with the mailto link in it.
     // To open a tab we're going to have to cheat and use tabmail so we can load
   // in the data of what we want.
   gPreCount = mc.tabmail.tabContainer.childNodes.length;
   gNewTab = open_content_tab_with_url(url + "mailtolink.html");
   gComposeWin = composeHelper.open_compose_with_element_click("mailtolink");
--- a/mail/test/mozmill/content-policy/test-dns-prefetch.js
+++ b/mail/test/mozmill/content-policy/test-dns-prefetch.js
@@ -6,54 +6,55 @@
  * The purpose of this test is to ensure that dns prefetch is turned off in
  * the message pane and compose windows. It also checks that dns prefetch is
  * currently turned off in content tabs, although when bug 545407 is fixed, it
  * should be turned back on again.
  */
 
 "use strict";
 
-var MODULE_NAME = "test-dns-prefetch";
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
-                       'content-tab-helpers'];
+var MODULE_NAME = "test-dns-prefetch";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "content-tab-helpers"];
 
 var folder = null;
 var composeHelper = null;
 var gMsgNo = 0;
 var gMsgHdr = null;
 
 // These two constants are used to build the message body.
 var msgBody = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
-'<html>\n' +
-'<head>\n' +
-'\n' +
+"<html>\n" +
+"<head>\n" +
+"\n" +
 '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
-'</head>\n' +
+"</head>\n" +
 '<body bgcolor="#ffffff" text="#000000">\n' +
-'dns prefetch test message\n' +
-'</body>\n</html>\n';
+"dns prefetch test message\n" +
+"</body>\n</html>\n";
 
-var setupModule = function (module) {
-  let fdh = collector.getModule('folder-display-helpers');
+function setupModule(module) {
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  composeHelper = collector.getModule('compose-helpers');
+  composeHelper = collector.getModule("compose-helpers");
   composeHelper.installInto(module);
-  let cth = collector.getModule('content-tab-helpers');
+  let cth = collector.getModule("content-tab-helpers");
   cth.installInto(module);
 
   folder = create_folder("dnsPrefetch");
-};
+}
 
 function addToFolder(aSubject, aBody, aFolder) {
-
   let msgId = Cc["@mozilla.org/uuid-generator;1"]
                           .getService(Ci.nsIUUIDGenerator)
-                          .generateUUID() +"@mozillamessaging.invalid";
+                          .generateUUID() + "@mozillamessaging.invalid";
 
   let source = "From - Sat Nov  1 12:39:54 2008\n" +
                "X-Mozilla-Status: 0001\n" +
                "X-Mozilla-Status2: 00000000\n" +
                "Message-ID: <" + msgId + ">\n" +
                "Date: Wed, 11 Jun 2008 20:32:02 -0400\n" +
                "From: Tester <tests@mozillamessaging.invalid>\n" +
                "User-Agent: Thunderbird 3.0a2pre (Macintosh/2008052122)\n" +
@@ -155,18 +156,18 @@ function test_dnsPrefetch_compose() {
   checkComposeWindow(2);
 }
 
 function test_dnsPrefetch_contentTab() {
   // To open a tab we're going to have to cheat and use tabmail so we can load
   // in the data of what we want.
   let preCount = mc.tabmail.tabContainer.childNodes.length;
 
-  let dataurl = 'data:text/html,<html><head><title>test dns prefetch</title>' +
-    '</head><body>test dns prefetch</body></html>';
+  let dataurl = "data:text/html,<html><head><title>test dns prefetch</title>" +
+    "</head><body>test dns prefetch</body></html>";
 
   let newTab = open_content_tab_with_url(dataurl);
 
   if (!mc.tabmail.getBrowserForSelectedTab().docShell.allowDNSPrefetch)
     throw new Error("DNS prefetch unexpectedly disabled in content tabs");
 
   mc.tabmail.closeTab(newTab);
 
--- a/mail/test/mozmill/content-policy/test-exposed-in-content-tabs.js
+++ b/mail/test/mozmill/content-policy/test-exposed-in-content-tabs.js
@@ -4,57 +4,58 @@
 
 /**
  * The purpose of this test is to ensure that remote content can't gain access
  * to messages by loading their URIs.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-exposed-in-content-tabs';
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
-                       'content-tab-helpers'];
+var MODULE_NAME = "test-exposed-in-content-tabs";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "content-tab-helpers"];
 
 var folder = null;
 var composeHelper = null;
 var gMsgNo = 0;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
-var url = collector.addHttpResource('../content-policy/html', 'content');
+var url = collector.addHttpResource("../content-policy/html", "content");
 
 // These two constants are used to build the message body.
 var msgBody = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
-'<html>\n' +
-'<head>\n' +
-'\n' +
+"<html>\n" +
+"<head>\n" +
+"\n" +
 '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
-'</head>\n' +
+"</head>\n" +
 '<body bgcolor="#ffffff" text="#000000">\n' +
 '<img id="testelement" src="' + url + 'pass.png"/>\n' +
-'</body>\n</html>\n';
+"</body>\n</html>\n";
 
-var setupModule = function (module) {
-  let fdh = collector.getModule('folder-display-helpers');
+function setupModule(module) {
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  composeHelper = collector.getModule('compose-helpers');
+  composeHelper = collector.getModule("compose-helpers");
   composeHelper.installInto(module);
-  let cth = collector.getModule('content-tab-helpers');
+  let cth = collector.getModule("content-tab-helpers");
   cth.installInto(module);
 
   folder = create_folder("exposedInContent");
-};
+}
 
 function addToFolder(aSubject, aBody, aFolder) {
-
   let msgId = Cc["@mozilla.org/uuid-generator;1"]
                           .getService(Ci.nsIUUIDGenerator)
-                          .generateUUID() +"@mozillamessaging.invalid";
+                          .generateUUID() + "@mozillamessaging.invalid";
 
   let source = "From - Sat Nov  1 12:39:54 2008\n" +
                "X-Mozilla-Status: 0001\n" +
                "X-Mozilla-Status2: 00000000\n" +
                "Message-ID: <" + msgId + ">\n" +
                "Date: Wed, 11 Jun 2008 20:32:02 -0400\n" +
                "From: Tester <tests@mozillamessaging.invalid>\n" +
                "User-Agent: Thunderbird 3.0a2pre (Macintosh/2008052122)\n" +
@@ -103,17 +104,17 @@ function addMsgToFolder(folder) {
   return neckoURL.value.spec;
 }
 
 function checkContentTab(msgURL) {
   // To open a tab we're going to have to cheat and use tabmail so we can load
   // in the data of what we want.
   let preCount = mc.tabmail.tabContainer.childNodes.length;
 
-  let dataurl = 'data:text/html,<html><head><title>test exposed</title>' +
+  let dataurl = "data:text/html,<html><head><title>test exposed</title>" +
     '</head><body><iframe id="msgIframe" src="' + msgURL + '"/></body></html>';
 
   let newTab = open_content_tab_with_url(dataurl);
 
   if (mc.window.content.document.getElementById("msgIframe")
         .contentDocument.URL != "about:blank")
     throw new Error("Message display/access has not been blocked from remote content!");
 
--- a/mail/test/mozmill/content-policy/test-general-content-policy.js
+++ b/mail/test/mozmill/content-policy/test-general-content-policy.js
@@ -12,40 +12,48 @@
  *
  * - Messages
  * - Reply email compose window
  * - Forward email compose window
  * - Content tab
  * - Feed message
  */
 
-// make SOLO_TEST=content-policy/test-general-content-policy.js mozmill-one
-
 "use strict";
 
-var MODULE_NAME = 'test-general-content-policy';
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
+/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
-                         'compose-helpers', 'content-tab-helpers',
-                         'keyboard-helpers',
-                         'notificationbox-helpers'];
+var MODULE_NAME = "test-general-content-policy";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "window-helpers",
+  "compose-helpers",
+  "content-tab-helpers",
+  "keyboard-helpers",
+  "notificationbox-helpers",
+];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var folder = null;
 var gMsgNo = 0;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
-var url = collector.addHttpResource('../content-policy/html', 'content');
+var url = collector.addHttpResource("../content-policy/html", "content");
 
 /**
  * The TESTS array is constructed from objects containing the following:
  *
  * type:            The type of the test being run.
  * body:            The html to be inserted into the body of the message under
  *                  test. Note: the element under test for content
  *                  allowed/disallowed should have id 'testelement'.
@@ -60,63 +68,62 @@ var TESTS = [
   {
     type: "Image",
     checkDenied: true,
     body: '<img id="testelement" src="' + url + 'pass.png"/>\n',
     webPage: "remoteimage.html",
     checkForAllowed: function img_checkAllowed(element) {
       return element.QueryInterface(Ci.nsIImageLoadingContent)
                     .imageBlockingStatus == Ci.nsIContentPolicy.ACCEPT;
-    }
+    },
   },
   {
     type: "Video",
     checkDenied: true,
     body: '<video id="testelement" src="' + url + 'video.ogv"/>\n',
     webPage: "remotevideo.html",
     checkForAllowed: function video_checkAllowed(element) {
       return element.networkState != element.NETWORK_NO_SOURCE;
-    }
+    },
   },
   {
     type: "Image-Data",
     checkDenied: false,
     body: '<img id="testelement" src="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%002%00%00%00%14%08%02%00%00%00%40%A8%F9%CD%00%00%02%A3IDATH%C7%ED%96%3D%2C%2CQ%14%C7%FF3K%22H4%3Ev%13%1F%DDR%10QP%09BT%22%0A%C2F%23HhD%B2%09%A5NB%88%C4%2B%25%0A%0At%14%14%04%85%CFD%82H%14%3E%12%8A-h%84B%7Cd%AD%FD%BDb%5E%26c%F7%3D%3B%5E%A5pr%8A%B9%E7%FE%EE%B9%FF%DCs%EE%CC%18%80%BE%9F%99%FA%96%F6%23%EB%3Fd%15%A9%C8%90%E1%F4d%25g%2B%BBNu%EBZ%8FYs%AB%5B%8F%3C%86%8C%90B%F1%19%8Fu%1CP%20W%B9%C9JNRR%8Er*U%19T0%AC%B0%7B%C6%B0Z%BEHE%17%BA%18%D7%B8%24DD%91%7B%DD%1F%E8%60G%3B%A6%CC-mU%AA%D2N%3A%A9%C9%A0%82%92%C646%A8A%A7%A6%3D%ED%D5%AA%D6%23O%9B%DA%FC%F2G%14%09)t%A0%83S%9D%3E%EA1%5D%E9.%19%01%40!%85%E2%CF%B3%D3%26%98%10j%A5%D5%19%2C%A7%DC%83G%A8%8C%B2%18%BE%91F%A1%0D6b%E2W%5C%BD%F1%E6%9EI%20%EB%81%07%A1%12J%EC%C8%25%97B%DDt%7B%F1%0A%9Ds%EE%E4%8B)%16z%E5%95%7F%9B%1B%26A%CB%A7*U%92%E9%B8%19%F3%9A%97%14P%A0E-%92%16%B4%E0%E4%F3%95%2FiF3%9F%E4t%C3%248%AD%13N%9CE%8C%12%F5%E3%CF%24%F3%8D%B7m%B6%85%FC%F8%A3Dm~%8B-%AB%BE%0D4%2C%B1%F4%CCs%7CN7%CCg%B2%DEyo%A6Yh%99e%2Br%C8%A1P%0F%3D%D6%AC%0F%9F%D0%11G%CEUk%AC%15P%20%24%94FZ%3B%ED%FB%EC%C7dN%C8%7C%90u%C6%99%E5\'%9C%2C%B0PM%B5P%1F%7D%F6y%04%09%0A%AD%B3n%0D%FB%E9%17%1Ad0f%D70%E1%25%96%02%04%D2I%B7%F6%EE%A2%2BL%D8%3D%F3A%96%ED%26%A6%0F_%13M%2B%AC%D8%9A%22D%7C%F8%AC%0AZ%91%5Dv%85%F2%C8%7B%E7%FD%AF%9D%FB%C4%D34%D3%D6%E5%18a%C4%3D%93%A0%B7%9C%B6%C9%A6S%BA%D3w%D8%F9d%E1%11GB%15T%B8g%BE%F0%F1%99%D3%9C!cO%7Bg%3A%B3%7DHC%F1%F71%C6JT%22%E9U%AF_%60%5C%9E%D6%0B%2F%19d%D4P%13%13%BF%E1%C6%C4%CC%22%CB%AA%EC%2F~%5Dq%15%C3%AC%B0b%BD%EA%AC%A1%1B%C6%AD%ACE%16%85%A6%98%8A%9F%AA%A7%5Eh%95U%3BO)%A5%BD%F4%0E3%3C%CAh\'%9D)%A4d%91u%CD%B5s%AF%CF%19%B7%B2ZhI%22%E9%8E%BB%F8%A9Yf%85%3A%E8%006%D8%18%60%A0%8A*%2F%5E%0F%1E%133%9F%FC%5EzC%84l%DE%0Dc%FC%FC%9D~%C1~%03%97%96%03%F2QP%E0%18%00%00%00%00IEND%AEB%60%82"/>\n',
     webPage: "remoteimagedata.html",
     checkForAllowed: function img_checkAllowed(element) {
       return element.QueryInterface(Ci.nsIImageLoadingContent)
                     .imageBlockingStatus == Ci.nsIContentPolicy.ACCEPT;
-    }
-  }
+    },
+  },
 ];
 
 // These two constants are used to build the message body.
 var msgBodyStart = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
-'<html>\n' +
-'<head>\n' +
-'\n' +
+"<html>\n" +
+"<head>\n" +
+"\n" +
 '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
-'</head>\n' +
+"</head>\n" +
 '<body bgcolor="#ffffff" text="#000000">\n';
 
-var msgBodyEnd = '</body>\n</html>\n';
+var msgBodyEnd = "</body>\n</html>\n";
 
-var setupModule = function (module) {
+function setupModule(module) {
   for (let dep of MODULE_REQUIRES) {
     collector.getModule(dep).installInto(module);
   }
 
   folder = create_folder("generalContentPolicy");
-};
+}
 
 function addToFolder(aSubject, aBody, aFolder) {
-
   let msgId = Cc["@mozilla.org/uuid-generator;1"]
                           .getService(Ci.nsIUUIDGenerator)
-                          .generateUUID() +"@mozillamessaging.invalid";
+                          .generateUUID() + "@mozillamessaging.invalid";
 
   let source = "From - Sat Nov  1 12:39:54 2008\n" +
                "X-Mozilla-Status: 0001\n" +
                "X-Mozilla-Status2: 00000000\n" +
                "Message-ID: <" + msgId + ">\n" +
                "Date: Wed, 11 Jun 2008 20:32:02 -0400\n" +
                "From: Tester <tests@mozillamessaging.invalid>\n" +
                "User-Agent: Thunderbird 3.0a2pre (Macintosh/2008052122)\n" +
@@ -369,17 +376,16 @@ function checkAllowForHostsWithPerms(tes
   Services.perms.remove(uri, "image");
   assert_true(Services.perms.testPermission(uri, "image") ==
               Services.perms.UNKNOWN_ACTION);
 
   ++gMsgNo;
 }
 
 function test_generalContentPolicy() {
-  let folderTab = mc.tabmail.currentTabInfo;
   be_in_folder(folder);
 
   assert_nothing_selected();
 
   for (let i = 0; i < TESTS.length; ++i) {
     // Check for denied in mail
     addMsgToFolderAndCheckContent(folder, TESTS[i]);
 
--- a/mail/test/mozmill/content-policy/test-js-content-policy.js
+++ b/mail/test/mozmill/content-policy/test-js-content-policy.js
@@ -4,49 +4,48 @@
 
 /**
  * Tests whether JavaScript in a local/remote message works.
  *
  * @note This assumes an existing local account, and will cause the Trash
  * folder of that account to be emptied multiple times.
  */
 
-// make SOLO_TEST=content-policy/test-js-content-policy.js mozmill-one
-
 "use strict";
 
-var MODULE_NAME = 'test-js-content-policy';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-js-content-policy";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folder = null;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
-var url = collector.addHttpResource('../content-policy/html', 'content');
+var url = collector.addHttpResource("../content-policy/html", "content");
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
   folder = create_folder("jsContentPolicy");
   Services.prefs.setBoolPref("javascript.enabled", true);
-};
+}
 
 function teardownModule(module) {
   Services.prefs.clearUserPref("javascript.enabled");
 }
 
 function addToFolder(aSubject, aBody, aFolder) {
-
   let msgId = Cc["@mozilla.org/uuid-generator;1"]
                           .getService(Ci.nsIUUIDGenerator)
-                          .generateUUID() +"@mozillamessaging.invalid";
+                          .generateUUID() + "@mozillamessaging.invalid";
 
   let source = "From - Sat Nov  1 12:39:54 2008\n" +
                "X-Mozilla-Status: 0001\n" +
                "X-Mozilla-Status2: 00000000\n" +
                "Message-ID: <" + msgId + ">\n" +
                "Date: Wed, 11 Jun 2008 20:32:02 -0400\n" +
                "From: Tester <tests@mozillamessaging.invalid>\n" +
                "User-Agent: Thunderbird 3.0a2pre (Macintosh/2008052122)\n" +
@@ -63,51 +62,51 @@ function addToFolder(aSubject, aBody, aF
 
   aFolder.addMessage(source);
   aFolder.gettingNewMessages = false;
 
   return aFolder.msgDatabase.getMsgHdrForMessageID(msgId);
 }
 
 var jsMsgBody = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
-'<html>\n' +
-'<head>\n' +
-'\n' +
+"<html>\n" +
+"<head>\n" +
+"\n" +
 '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
-'</head>\n' +
+"</head>\n" +
 '<body bgcolor="#ffffff" text="#000000">\n' +
-'this is a test<big><big><big> stuff\n' +
-'<br><br>\n' +
-'</big></big></big>\n' +
-'<noscript>\n'+
-'hello, this content is noscript!\n' +
-'</noscript>\n' +
-'<script>\n'+
-'var jsIsTurnedOn = true;\n' +
-'</script>\n' +
-'\n' +
-'</body>\n' +
-'</html>\n';
+"this is a test<big><big><big> stuff\n" +
+"<br><br>\n" +
+"</big></big></big>\n" +
+"<noscript>\n" +
+"hello, this content is noscript!\n" +
+"</noscript>\n" +
+"<script>\n" +
+"var jsIsTurnedOn = true;\n" +
+"</script>\n" +
+"\n" +
+"</body>\n" +
+"</html>\n";
 
 var gMsgNo = 0;
 
 function checkJsInMail() {
   let msgDbHdr = addToFolder("JS test message " + gMsgNo, jsMsgBody, folder);
 
   // select the newly created message
   let msgHdr = select_click_row(gMsgNo);
 
   if (msgDbHdr != msgHdr)
     throw new Error("Selected Message Header is not the same as generated header");
 
   assert_selected_and_displayed(gMsgNo);
 
   let mc = mozmill.getMail3PaneController();
   // This works because messagepane is type=content-primary in these tests.
-  if (typeof mc.window.content.wrappedJSObject.jsIsTurnedOn != 'undefined')
+  if (typeof mc.window.content.wrappedJSObject.jsIsTurnedOn != "undefined")
     throw new Error("JS is turned on in mail - it shouldn't be.");
 
   let noscript = mc.window.content.wrappedJSObject.document
                    .getElementsByTagName("noscript")[0];
   let display = mc.window.getComputedStyle(noscript).getPropertyValue("display");
   if (display != "inline")
     throw new Error("noscript display should be 'inline'; display=" + display);
 
@@ -117,17 +116,17 @@ function checkJsInMail() {
 function checkJsInNonMessageContent() {
   // Deselect everything so we can load our content
   select_none();
 
   let mc = mozmill.getMail3PaneController();
 
   // load something non-message-like in the message pane
   mc.window.GetMessagePaneFrame().location.href =
-    "data:text/html;charset=utf-8,<script>var jsIsTurnedOn%3Dtrue%3B<%2Fscript>bar"+
+    "data:text/html;charset=utf-8,<script>var jsIsTurnedOn%3Dtrue%3B<%2Fscript>bar" +
                                   "<noscript><p id='noscript-p'>hey this is noscript</p>";
 
   wait_for_message_display_completion();
 
   if (!mc.window.content.wrappedJSObject.jsIsTurnedOn)
     throw new Error("JS is not turned on in content - it should be.");
 
   let noscript = mc.window.content.wrappedJSObject.document
@@ -241,27 +240,25 @@ function checkJsInRemoteContent() {
   let noscript = mc.window.content.wrappedJSObject.document
                    .getElementsByTagName("noscript")[0];
   let display = mc.window.getComputedStyle(noscript).getPropertyValue("display");
   if (display != "none")
     throw new Error("noscript display should be 'none'; display=" + display);
 }
 
 function test_jsContentPolicy() {
-  let folderTab = mc.tabmail.currentTabInfo;
   be_in_folder(folder);
 
   assert_nothing_selected();
 
   // run each test twice to ensure that there aren't any weird side effects,
   // given that these loads all happen in the same docshell
 
   checkJsInMail();
   checkJsInNonMessageContent();
 
   checkJsInMail();
   checkJsInNonMessageContent();
 
   checkJsInFeedContent();
   checkJsInRemoteContent();
   checkJsInFeedTab();
-
 }
--- a/mail/test/mozmill/content-policy/test-plugins-policy.js
+++ b/mail/test/mozmill/content-policy/test-plugins-policy.js
@@ -4,60 +4,68 @@
 
 /**
  * Checks if plugins are enabled in messages correctly or not.
  * As of bug 1508942, plugins are no longer enabled in any context.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-plugins-policy';
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
-                       'compose-helpers', 'content-tab-helpers'];
+var MODULE_NAME = "test-plugins-policy";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "window-helpers",
+  "compose-helpers",
+  "content-tab-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder = null;
 var composeHelper = null;
 var gMsgNo = 0;
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
-var url = collector.addHttpResource('../content-policy/html', 'content');
+var url = collector.addHttpResource("../content-policy/html", "content");
 
 // These two constants are used to build the message body.
 var msgBody = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
-'<html>\n' +
-'<head>\n' +
-'\n' +
+"<html>\n" +
+"<head>\n" +
+"\n" +
 '<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
-'</head>\n' +
+"</head>\n" +
 '<body bgcolor="#ffffff" text="#000000">\n' +
 '<embed id="testelement" type="application/x-test" width="400" height="400" border="1"></embed>\n' +
-'</body>\n</html>\n';
+"</body>\n</html>\n";
 
-var setupModule = function (module) {
-  let fdh = collector.getModule('folder-display-helpers');
+function setupModule(module) {
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
-  composeHelper = collector.getModule('compose-helpers');
+  composeHelper = collector.getModule("compose-helpers");
   composeHelper.installInto(module);
-  let cth = collector.getModule('content-tab-helpers');
+  let cth = collector.getModule("content-tab-helpers");
   cth.installInto(module);
 
   folder = create_folder("pluginPolicy");
-};
+}
 
 function addToFolder(aSubject, aBody, aFolder) {
   let msgId = Cc["@mozilla.org/uuid-generator;1"]
                           .getService(Ci.nsIUUIDGenerator)
-                          .generateUUID() +"@mozillamessaging.invalid";
+                          .generateUUID() + "@mozillamessaging.invalid";
 
   let source = "From - Sat Nov  1 12:39:54 2008\n" +
 
   "X-Mozilla-Status: 0001\n" +
                "X-Mozilla-Status2: 00000000\n" +
                "Message-ID: <" + msgId + ">\n" +
                "Date: Wed, 11 Jun 2008 20:32:02 -0400\n" +
                "From: Tester <tests@mozillamessaging.invalid>\n" +
@@ -80,18 +88,17 @@ function addToFolder(aSubject, aBody, aF
 
 function isPluginLoaded(contentDocument) {
   let element = contentDocument.getElementById("testelement").wrappedJSObject;
 
   try {
     // if setColor throws, then the plugin isn't running
     element.setColor("FFFF0000");
     return true;
-  }
-  catch (ex) {
+  } catch (ex) {
     // Any errors and we'll just return false below - they may be expected.
   }
   return false;
 }
 
 function addMsgToFolderAndCheckContent(loadAllowed) {
   let msgDbHdr = addToFolder("Plugin test message " + gMsgNo, msgBody, folder);
 
@@ -164,22 +171,18 @@ function test_checkPluginsInNonMessageCo
 }
 
 function test_3paneWindowDeniedAgain() {
   select_click_row(0);
 
   assert_selected_and_displayed(0);
 
   // Now check that the content hasn't been loaded
-  if (isPluginLoaded(mozmill.getMail3PaneController().window
-                            .content.document) != false)
-    throw new Error(loadAllowed ?
-                    "Plugin has been unexpectedly blocked in message content" :
-                    "Plugin has not been blocked in message as expected");
-
+  if (isPluginLoaded(mozmill.getMail3PaneController().window.content.document))
+    throw new Error("Plugin has not been blocked in message as expected");
 }
 
 function test_checkStandaloneMessageWindowDenied() {
   checkStandaloneMessageWindow(false);
 }
 
 function test_checkContentTab() {
   // To open a tab we're going to have to cheat and use tabmail so we can load
--- a/mail/test/mozmill/content-policy/test-view-source.js
+++ b/mail/test/mozmill/content-policy/test-view-source.js
@@ -1,22 +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/. */
 
 /**
  * Test that view-source content can be reloaded to change encoding.
  */
 
-// make SOLO_TEST=content-policy/test-view-source.js mozmill-one
-
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-view-source";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var folder = null;
@@ -27,17 +27,17 @@ function setupModule(module) {
   }
 
   folder = create_folder("viewsource");
 }
 
 function addToFolder(aSubject, aBody, aFolder) {
   let msgId = Cc["@mozilla.org/uuid-generator;1"]
                           .getService(Ci.nsIUUIDGenerator)
-                          .generateUUID() +"@invalid";
+                          .generateUUID() + "@invalid";
 
   let source = "From - Sat Nov  1 12:39:54 2008\n" +
                "X-Mozilla-Status: 0001\n" +
                "X-Mozilla-Status2: 00000000\n" +
                "Message-ID: <" + msgId + ">\n" +
                "Date: Wed, 11 Jun 2008 20:32:02 -0400\n" +
                "From: Tester <tests@mozillamessaging.invalid>\n" +
                "MIME-Version: 1.0\n" +
--- a/mail/test/mozmill/content-tabs/html/test-lwthemes.html
+++ b/mail/test/mozmill/content-tabs/html/test-lwthemes.html
@@ -4,26 +4,26 @@
 <script>
 var themes = [
   {
     id: "test-01",
     name: "Test 01",
     headerURL: "test.png",
     footerURL: "test.png",
     textcolor: "#fff",
-    accentcolor: "#6b6b6b"
+    accentcolor: "#6b6b6b",
   },
   {
     id: "test-02",
     name: "Test 02",
     headerURL: "test.png",
     footerURL: "test.png",
     textcolor: "#bcf",
-    accentcolor: "#8888FF"
-  }
+    accentcolor: "#8888FF",
+  },
 ];
 
 const INSTALL = "InstallBrowserTheme";
 const PREVIEW = "PreviewBrowserTheme";
 const RESET_PREVIEW = "ResetBrowserThemePreview";
 
 function setTheme(node, theme, action) {
   node.setAttribute("data-browsertheme", JSON.stringify(themes[theme]));
--- a/mail/test/mozmill/content-tabs/test-about-support.js
+++ b/mail/test/mozmill/content-tabs/test-about-support.js
@@ -1,21 +1,30 @@
 /* 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/. */
 
 "use strict";
 
-var MODULE_NAME = 'test-about-support';
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'content-tab-helpers',
-                       'compose-helpers', 'window-helpers'];
+var MODULE_NAME = "test-about-support";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "content-tab-helpers",
+  "compose-helpers",
+  "window-helpers",
+];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+// eslint-disable-next-line mozilla/reject-importGlobalProperties
 Cu.importGlobalProperties(["DOMParser"]);
 
 var warningText = new Map();
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
@@ -106,17 +115,17 @@ function open_send_via_email(aTab) {
 function find_private_element(aTab) {
   // We use the identity name as an example of a private-only element.
   // It is currently the second td element with class="data-private" in the table.
   // The content string must be something unique that is not found anywhere else.
   let elem = aTab.browser.contentDocument
                  .querySelector("#accounts-table td.data-private~td.data-private");
   assert_true(elem != null);
   assert_true(elem.textContent.length > 0);
-  assert_equals(get_content_tab_element_display(aTab,elem), "none");
+  assert_equals(get_content_tab_element_display(aTab, elem), "none");
   return elem;
 }
 
 /*
  * Tests
  */
 
 /**
@@ -253,18 +262,17 @@ function test_private_data() {
  * If it is plain text string, just check in text is anywhere in it.
  *
  * @param aDocument  A node tree or a string of plain text data.
  * @param aText      The text to find in the document.
  */
 function check_text_in_body(aDocument, aText) {
   if (typeof(aDocument) == "object")
     return (get_element_by_text(aDocument, aText) != null);
-  else
-    return aDocument.includes(aText);
+  return aDocument.includes(aText);
 }
 
 /**
  * Test (well, sort of) the copy to clipboard function with public data.
  */
 function test_copy_to_clipboard_public() {
   let tab = open_about_support();
   let privateElem = find_private_element(tab);
--- a/mail/test/mozmill/content-tabs/test-addons-mgr.js
+++ b/mail/test/mozmill/content-tabs/test-addons-mgr.js
@@ -1,47 +1,47 @@
 /* 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/. */
 
-// make SOLO_TEST=content-tabs/test-addons-mgr.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-addons-mgr";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers",
-                       "window-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers", "window-helpers"];
 
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 }
 
 function test_open_addons_with_url() {
-  mc.window.openAddonsMgr('addons://list/theme');
+  mc.window.openAddonsMgr("addons://list/theme");
   mc.sleep(0);
 
   let tab = mc.tabmail.currentTabInfo;
-  wait_for_content_tab_load(tab, 'about:addons', 10000);
-  assert_true(content_tab_e(tab, 'category-theme').selected,
+  wait_for_content_tab_load(tab, "about:addons", 10000);
+  assert_true(content_tab_e(tab, "category-theme").selected,
               "Themes category should be selected!");
 
   mc.tabmail.switchToTab(0); // switch to 3pane
 
-  mc.window.openAddonsMgr('addons://list/plugin');
+  mc.window.openAddonsMgr("addons://list/plugin");
   mc.sleep(0);
 
   tab = mc.tabmail.currentTabInfo;
-  wait_for_content_tab_load(tab, 'about:addons', 10000);
-  assert_true(content_tab_e(tab, 'category-plugin').selected,
+  wait_for_content_tab_load(tab, "about:addons", 10000);
+  assert_true(content_tab_e(tab, "category-plugin").selected,
               "Plugins category should be selected!");
 
   mc.tabmail.closeTab(tab);
 }
 
 /**
  * Bug 1462923
  * Check if the "Tools->Add-on Options" menu item works and shows our add-on.
@@ -49,23 +49,23 @@ function test_open_addons_with_url() {
  * however simplistic the preferences XUL document may be.
  */
 function test_addon_prefs() {
   // Open Add-on Options.
   mc.click(mc.eid("button-appmenu"));
   let popups = mc.click_menus_in_sequence(mc.e("appmenu-popup"), [ { id: "appmenu_addons" } ], true);
 
   let foundAddon = false;
-  plan_for_modal_dialog("mozmill-prefs", function (controller) {
+  plan_for_modal_dialog("mozmill-prefs", function(controller) {
      // Add |mc.sleep(1000);| here to see the popup dialog.
     controller.window.close();
   });
 
   // MozMill add-on should be somewhere in the list. When found, click it.
-  for (let item of popups[popups.length-1].children) {
+  for (let item of popups[popups.length - 1].children) {
     if (item.tagName == "menuitem" && item.getAttribute("collapsed") != "true" &&
         item.label == "MozMill") {
       foundAddon = true;
       mc.click(new elib.Elem(item));
       break;
     }
   }
   assert_true(foundAddon);
--- a/mail/test/mozmill/content-tabs/test-content-tab.js
+++ b/mail/test/mozmill/content-tabs/test-content-tab.js
@@ -1,30 +1,38 @@
 /* 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/. */
 
 "use strict";
 
-var MODULE_NAME = 'test-content-tab';
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-dom-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'content-tab-helpers',
-                       'dom-helpers', 'window-helpers'];
+var MODULE_NAME = "test-content-tab";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = [
+  "folder-display-helpers",
+  "content-tab-helpers",
+  "dom-helpers",
+  "window-helpers",
+];
 
 var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
 var mozmill = ChromeUtils.import("chrome://mozmill/content/modules/mozmill.jsm");
 var elementslib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
 // Note: this one adds to '' as we need to make sure that favicon.ico is in the
 // root directory.
-var url = collector.addHttpResource('../content-tabs/html', '');
+var url = collector.addHttpResource("../content-tabs/html", "");
 var whatsUrl = url + "whatsnew.html";
 
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 }
 
@@ -143,25 +151,25 @@ function test_content_tab_default_favico
   assert_tab_has_title(tab, "What's New Content Test 1");
   // Check the location of the favicon, this should be the site favicon in this
   // test.
   assert_content_tab_has_favicon(tab, url + "favicon.ico");
 }
 
 function test_content_tab_onbeforeunload() {
   let count = mc.tabmail.tabContainer.childNodes.length;
-  let tab = mc.tabmail.tabInfo[count-1];
-  tab.browser.contentWindow.addEventListener("beforeunload", function (event) {
+  let tab = mc.tabmail.tabInfo[count - 1];
+  tab.browser.contentWindow.addEventListener("beforeunload", function(event) {
     event.returnValue = "Green llama in your car";
   });
 
   const interactionPref = "dom.require_user_interaction_for_beforeunload";
   Services.prefs.setBoolPref(interactionPref, false);
 
-  plan_for_modal_dialog("commonDialog", function (controller) {
+  plan_for_modal_dialog("commonDialog", function(controller) {
     controller.window.document.documentElement.getButton("accept").doCommand();
   });
   mc.tabmail.closeTab(tab);
   wait_for_modal_dialog();
 
   Services.prefs.clearUserPref(interactionPref);
 }
 
--- a/mail/test/mozmill/content-tabs/test-install-xpi.js
+++ b/mail/test/mozmill/content-tabs/test-install-xpi.js
@@ -1,44 +1,46 @@
 /* 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/. */
 
 "use strict";
 
-var MODULE_NAME = 'test-install-xpi';
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['window-helpers', 'folder-display-helpers',
-                       'content-tab-helpers'];
+var MODULE_NAME = "test-install-xpi";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["window-helpers", "folder-display-helpers", "content-tab-helpers"];
 
 var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var mozmill = ChromeUtils.import("chrome://mozmill/content/modules/mozmill.jsm");
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
-var url = collector.addHttpResource('../content-tabs/html', 'content-tabs');
+var url = collector.addHttpResource("../content-tabs/html", "content-tabs");
 
 var gDocument;
 var gNewTab;
 
-var setupModule = function (module) {
-  let wh = collector.getModule('window-helpers');
+function setupModule(module) {
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let cth = collector.getModule('content-tab-helpers');
+  let cth = collector.getModule("content-tab-helpers");
   cth.installInto(module);
 
   gDocument = mc.window.document;
   gNewTab = open_content_tab_with_url(url + "installxpi.html",
       "specialTabs.siteClickHandler(event, new RegExp('^" + url + "'));");
-};
+}
 
 var teardownModule = function(module) {
   mc.tabmail.closeTab(gNewTab);
 };
 
 function waitForNotification(id, buttonToClickSelector, callback) {
   let path = `
     /id("messengerWindow")/id("mainPopupSet")/id("notification-popup")/id("${id}-notification")
--- a/mail/test/mozmill/cookies/test-cookies.js
+++ b/mail/test/mozmill/cookies/test-cookies.js
@@ -5,29 +5,32 @@
 /**
  * Test file to check that cookies are correctly enabled in Thunderbird.
  *
  * XXX: Still need to check remote content in messages.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-cookies';
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
+var MODULE_NAME = "test-cookies";
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ['window-helpers', 'content-tab-helpers', 'folder-display-helpers'];
+var MODULE_REQUIRES = ["window-helpers", "content-tab-helpers", "folder-display-helpers"];
 
 // RELATIVE_ROOT messes with the collector, so we have to bring the path back
 // so we get the right path for the resources.
-var url = collector.addHttpResource('../cookies/html', 'cookies');
+var url = collector.addHttpResource("../cookies/html", "cookies");
 
 function setupModule(module) {
   let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
   let cth = collector.getModule("content-tab-helpers");
   cth.installInto(module);
 }
 
 /**
  * Test deleting junk messages with no messages marked as junk.
  */
@@ -44,10 +47,10 @@ function test_load_cookie_result_page() 
   let cookie = mc.window.content.wrappedJSObject.theCookie;
 
   dump("Cookie is: " + cookie + "\n");
 
   if (!cookie)
     throw new Error("Document has no cookie :-(");
 
   if (cookie != "name=CookieTest")
-    throw new Error("Cookie set incorrectly, expected: name=CookieTest, got: " +cookie + "\n");
+    throw new Error("Cookie set incorrectly, expected: name=CookieTest, got: " + cookie + "\n");
 }
--- a/mail/test/mozmill/downloads/test-about-downloads.js
+++ b/mail/test/mozmill/downloads/test-about-downloads.js
@@ -1,29 +1,35 @@
 /* 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/. */
 
 /**
  * Test about:downloads.
  */
 
-// make SOLO_TEST=downloads/test-about-downloads.js mozmill-one
+"use strict";
 
-"use strict";
+/* import-globals-from ../shared-modules/test-attachment-helpers.js */
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-dom-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-prompt-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
 var MODULE_NAME = "test-about-downloads";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = [ 'attachment-helpers',
-                        'content-tab-helpers',
-                        'dom-helpers',
-                        'folder-display-helpers',
-                        'prompt-helpers',
-                        'window-helpers' ];
+var MODULE_REQUIRES = [
+  "attachment-helpers",
+  "content-tab-helpers",
+  "dom-helpers",
+  "folder-display-helpers",
+  "prompt-helpers",
+  "window-helpers",
+];
 
 var elementslib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 var downloads = ChromeUtils.import("resource://gre/modules/Downloads.jsm");
 
 var downloadsTab;
 
 var attachmentFileNames = [
   "Attachment#1.txt",
@@ -57,43 +63,43 @@ var downloadsView = {
     let succeededPromises = [];
     for (let download of this.items.keys()) {
       let succeededPromise = download.whenSucceeded();
       succeededPromises.push(succeededPromise);
     }
     let finished = false;
     Promise.all(succeededPromises).then(() => finished = true, Cu.reportError);
     mc.waitFor(() => finished, "Timeout waiting for downloads to complete.");
-  }
+  },
 };
 
 function prepare_messages() {
   let folder = create_folder("about:downloads");
-  let msgSet = make_new_sets_in_folder(folder, [
+  make_new_sets_in_folder(folder, [
     {
       count: 1,
       attachments: [{
         filename: attachmentFileNames[0],
-        body: "Body"
-      }]
+        body: "Body",
+      }],
     },
     {
       count: 1,
       attachments: [{
         filename: attachmentFileNames[1],
-        body: "Body"
-      }]
+        body: "Body",
+      }],
     },
     {
       count: 1,
       attachments: [{
         filename: attachmentFileNames[2],
-        body: "Body"
-      }]
-    }
+        body: "Body",
+      }],
+    },
   ]);
   be_in_folder(folder);
 }
 
 function prepare_downloads_view() {
   let success = false;
   downloads.Downloads.getList(downloads.Downloads.ALL)
                      .then(list => list.addView(downloadsView))
@@ -200,17 +206,17 @@ function test_remove_file() {
 
   // select first element
   mc.click(new elementslib.Elem(firstElement));
   mc.rightClick(new elementslib.Elem(firstElement));
 
   let contextMenu = content_tab_e(downloadsTab, "msgDownloadsContextMenu");
   wait_for_popup_to_open(contextMenu);
   mc.click_menus_in_sequence(contextMenu, [
-                               { command: "msgDownloadsCmd_remove" }
+                               { command: "msgDownloadsCmd_remove" },
                              ]);
   mc.waitFor(() => downloadsView.count == 2,
              "Timeout waiting for removing a saved attachment file.");
 
   let child = list.firstChild;
   while (child) {
     assert_not_equals(removingFileName, child.querySelector(".fileName").getAttribute("value"));
     child = child.nextSibling;
@@ -234,17 +240,17 @@ function test_remove_multiple_files() {
   // select two elements
   mc.click(new elementslib.Elem(firstElement));
   list.selectItemRange(firstElement, secondElement);
   mc.rightClick(new elementslib.Elem(firstElement));
 
   let contextMenu = content_tab_e(downloadsTab, "msgDownloadsContextMenu");
   wait_for_popup_to_open(contextMenu);
   mc.click_menus_in_sequence(contextMenu, [
-                               { command: "msgDownloadsCmd_remove" }
+                               { command: "msgDownloadsCmd_remove" },
                              ]);
   mc.waitFor(() => downloadsView.count == 1,
              "Timeout waiting for removing two saved attachment files.");
 
   let child = list.firstChild;
   while (child) {
     for (let name of removingFileNames) {
       assert_not_equals(name, child.querySelector(".fileName").getAttribute("value"));
@@ -261,17 +267,17 @@ function test_clear_all_files() {
   downloadsView.waitForFinish();
 
   mc.click(content_tab_eid(downloadsTab, "msgDownloadsRichListBox"));
   mc.rightClick(content_tab_eid(downloadsTab, "msgDownloadsRichListBox"));
 
   let contextMenu = content_tab_e(downloadsTab, "msgDownloadsContextMenu");
   wait_for_popup_to_open(contextMenu);
   mc.click_menus_in_sequence(contextMenu, [
-                               { command: "msgDownloadsCmd_clearDownloads" }
+                               { command: "msgDownloadsCmd_clearDownloads" },
                              ]);
   mc.waitFor(() => downloadsView.count == 0,
              "Timeout waiting for clearing all saved attachment files.");
 
   let empty = content_tab_e(downloadsTab, "msgDownloadsListEmptyDescription");
   assert_false(empty.hidden, "msgDownloadsListEmptyDescription is not visible");
 }
 
@@ -281,16 +287,16 @@ function teardownTest() {
                        for (let download of downloadsView.items.keys()) {
                          list.remove(download);
                        }
                      })
                      .then(null, Cu.reportError);
   mc.waitFor(() => downloadsView.count == 0,
              "Timeout waiting for clearing all saved attachment files.");
   let empty = content_tab_e(downloadsTab, "msgDownloadsListEmptyDescription");
-  mc.waitFor(() => empty.hidden == false,
+  mc.waitFor(() => empty.hidden === false,
              "Timeout waiting for msgDownloadsListEmptyDescription is visible.");
 }
 
 function teardownModule(module) {
   close_tab(downloadsTab);
   gMockFilePickReg.unregister();
 }
--- a/mail/test/mozmill/folder-display/test-archive-messages.js
+++ b/mail/test/mozmill/folder-display/test-archive-messages.js
@@ -1,30 +1,32 @@
 /* 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/. */
 
 "use strict";
 
-var MODULE_NAME = 'test-archive-messages';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-archive-messages";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folder;
 
 /**
  * The number of messages in the thread we use to test.
  */
 var NUM_MESSAGES_IN_THREAD = 6;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folder = create_folder("ThreadedMessages");
   let thread = create_thread(NUM_MESSAGES_IN_THREAD);
   add_sets_to_folders([folder], [thread]);
   thread = create_thread(NUM_MESSAGES_IN_THREAD);
   add_sets_to_folders([folder], [thread]);
 }
@@ -88,17 +90,17 @@ function test_batch_archiver() {
   let child1 = select_click_row(1);
   select_click_row(0);
   archive_messages([root2]);
   assert_selected_and_displayed(child1);
 
   /* Test archiving a partial selection */
   let child2 = select_click_row(1);
   let child3 = select_click_row(2);
-  let child4 = select_click_row(3);
+  select_click_row(3);
 
   select_shift_click_row(2);
   select_shift_click_row(1);
   select_shift_click_row(0);
 
   archive_messages([child1, child3]);
   assert_message_not_in_view([child1, child3]);
   assert_selected_and_displayed(child2);
--- a/mail/test/mozmill/folder-display/test-close-window-on-delete.js
+++ b/mail/test/mozmill/folder-display/test-close-window-on-delete.js
@@ -3,48 +3,50 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that the close message window on delete option works.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-close-window-on-delete';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-close-window-on-delete";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folder = create_folder("CloseWindowOnDeleteA");
 
   make_new_sets_in_folder(folder, [{count: 10}]);
 }
 
 /**
  * Delete a message and check that the message window is closed
  * where appropriate.
  */
 function disabled_test_close_message_window_on_delete_from_message_window() {
   set_close_message_on_delete(true);
   be_in_folder(folder);
 
   // select the first message
-  let firstMessage = select_click_row(0);
+  select_click_row(0);
   // display it
   let msgc = open_selected_message_in_new_window();
 
-  let secondMessage = select_click_row(1);
+  select_click_row(1);
   let msgc2 = open_selected_message_in_new_window();
 
   let preCount = folder.getTotalMessages(false);
   msgc.window.focus();
   plan_for_window_close(msgc);
   press_delete(msgc);
   if (folder.getTotalMessages(false) != preCount - 1)
     throw new Error("didn't delete a message before closing window");
@@ -62,22 +64,22 @@ function disabled_test_close_message_win
  * Delete a message when multiple windows are open to the message, and the
  * message is deleted from one of them.
  */
 function disabled_test_close_multiple_message_windows_on_delete_from_message_window() {
   set_close_message_on_delete(true);
   be_in_folder(folder);
 
   // select the first message
-  let firstMessage = select_click_row(0);
+  select_click_row(0);
   // display it
   let msgc = open_selected_message_in_new_window();
   let msgcA = open_selected_message_in_new_window();
 
-  let secondMessage = select_click_row(1);
+  select_click_row(1);
   let msgc2 = open_selected_message_in_new_window();
 
   let preCount = folder.getTotalMessages(false);
   msgc.window.focus();
   plan_for_window_close(msgc);
   plan_for_window_close(msgcA);
   press_delete(msgc);
 
@@ -98,22 +100,22 @@ function disabled_test_close_multiple_me
  * Delete a message when multiple windows are open to the message, and the
  * message is deleted from the 3-pane window.
  */
 function disabled_test_close_multiple_message_windows_on_delete_from_3pane_window() {
   set_close_message_on_delete(true);
   be_in_folder(folder);
 
   // select the first message
-  let firstMessage = select_click_row(0);
+  select_click_row(0);
   // display it
   let msgc = open_selected_message_in_new_window();
   let msgcA = open_selected_message_in_new_window();
 
-  let secondMessage = select_click_row(1);
+  select_click_row(1);
   let msgc2 = open_selected_message_in_new_window();
 
   let preCount = folder.getTotalMessages(false);
   mc.window.focus();
   plan_for_window_close(msgc);
   plan_for_window_close(msgcA);
   select_click_row(0);
   press_delete(mc);
@@ -135,21 +137,21 @@ function disabled_test_close_multiple_me
  * Delete a message and check that the message tab is closed
  * where appropriate.
  */
 function test_close_message_tab_on_delete_from_message_tab() {
   set_close_message_on_delete(true);
   be_in_folder(folder);
 
   // select the first message
-  let firstMessage = select_click_row(0);
+  select_click_row(0);
   // display it
   let msgc = open_selected_message_in_new_tab(true);
 
-  let secondMessage = select_click_row(1);
+  select_click_row(1);
   let msgc2 = open_selected_message_in_new_tab(true);
 
   let preCount = folder.getTotalMessages(false);
   switch_tab(msgc);
   press_delete();
 
   if (folder.getTotalMessages(false) != preCount - 1)
     throw new Error("didn't delete a message before closing tab");
@@ -168,22 +170,22 @@ function test_close_message_tab_on_delet
  * Delete a message when multiple windows are open to the message, and the
  * message is deleted from one of them.
  */
 function disabled_test_close_multiple_message_tabs_on_delete_from_message_tab() {
   set_close_message_on_delete(true);
   be_in_folder(folder);
 
   // select the first message
-  let firstMessage = select_click_row(0);
+  select_click_row(0);
   // display it
   let msgc = open_selected_message_in_new_tab(true);
-  let msgcA = open_selected_message_in_new_tab(true);
+  open_selected_message_in_new_tab(true);
 
-  let secondMessage = select_click_row(1);
+  select_click_row(1);
   let msgc2 = open_selected_message_in_new_tab(true);
 
   let preCount = folder.getTotalMessages(false);
   switch_tab(msgc);
   press_delete();
 
   if (folder.getTotalMessages(false) != preCount - 1)
     throw new Error("didn't delete a message before closing tab");
@@ -202,22 +204,22 @@ function disabled_test_close_multiple_me
  * Delete a message when multiple tabs are open to the message, and the
  * message is deleted from the 3-pane window.
  */
 function disabled_test_close_multiple_message_tabs_on_delete_from_3pane_window() {
   set_close_message_on_delete(true);
   be_in_folder(folder);
 
   // select the first message
-  let firstMessage = select_click_row(0);
+  select_click_row(0);
   // display it
-  let msgc = open_selected_message_in_new_tab(true);
-  let msgcA = open_selected_message_in_new_tab(true);
+  open_selected_message_in_new_tab(true);
+  open_selected_message_in_new_tab(true);
 
-  let secondMessage = select_click_row(1);
+  select_click_row(1);
   let msgc2 = open_selected_message_in_new_tab(true);
 
   let preCount = folder.getTotalMessages(false);
   mc.window.focus();
   select_click_row(0);
   press_delete(mc);
 
   if (folder.getTotalMessages(false) != preCount - 1)
@@ -237,22 +239,22 @@ function disabled_test_close_multiple_me
  * Delete a message when multiple windows and tabs are open to the message, and
  * the message is deleted from the 3-pane window.
  */
 function disabled_test_close_multiple_windows_tabs_on_delete_from_3pane_window() {
   set_close_message_on_delete(true);
   be_in_folder(folder);
 
   // select the first message
-  let firstMessage = select_click_row(0);
+  select_click_row(0);
   // display it
-  let msgc = open_selected_message_in_new_tab(true);
+  open_selected_message_in_new_tab(true);
   let msgcA = open_selected_message_in_new_window();
 
-  let secondMessage = select_click_row(1);
+  select_click_row(1);
   let msgc2 = open_selected_message_in_new_tab(true);
   let msgc2A = open_selected_message_in_new_window();
 
   let preCount = folder.getTotalMessages(false);
   mc.window.focus();
   plan_for_window_close(msgcA);
   select_click_row(0);
   press_delete(mc);
--- a/mail/test/mozmill/folder-display/test-columns.js
+++ b/mail/test/mozmill/folder-display/test-columns.js
@@ -1,31 +1,31 @@
 /* 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/. */
 
-"use strict";
-
-var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
-
-// needed to zero inter-folder processing delay
-var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
-
 /*
  * Test column default logic and persistence logic.  Persistence comes in both
  *  tab-switching (because of the multiplexed implementation) and
  *  folder-switching forms.
  */
 
-// make mozmill-one SOLO_TEST=folder-display/test-columns.js
+"use strict";
+
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var MODULE_NAME = 'test-columns';
+var MODULE_NAME = "test-columns";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
+
+// needed to zero inter-folder processing delay
+var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
 var folderInbox, folderSent, folderVirtual, folderA, folderB;
 // INBOX_DEFAULTS sans 'dateCol' but gains 'tagsCol'
 var columnsB;
 // GLODA_DEFAULTS sans 'locationCol' but gains 'accountCol'
 var glodaColumns;
 
 // these are for the reset/apply to other/apply to other+child tests.
@@ -35,61 +35,61 @@ var gColumnStateUpdated = false;
 
 var useCorrespondent;
 var INBOX_DEFAULTS;
 var SENT_DEFAULTS;
 var VIRTUAL_DEFAULTS;
 var GLODA_DEFAULTS;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   useCorrespondent =
     Services.prefs.getBoolPref("mail.threadpane.use_correspondents");
   INBOX_DEFAULTS = [
     "threadCol",
     "flaggedCol",
     "attachmentCol",
     "subjectCol",
     "unreadButtonColHeader",
     useCorrespondent ? "correspondentCol" : "senderCol",
     "junkStatusCol",
-    "dateCol"
+    "dateCol",
   ];
   SENT_DEFAULTS = [
     "threadCol",
     "flaggedCol",
     "attachmentCol",
     "subjectCol",
     "unreadButtonColHeader",
     useCorrespondent ? "correspondentCol" : "recipientCol",
     "junkStatusCol",
-    "dateCol"
+    "dateCol",
   ];
   VIRTUAL_DEFAULTS = [
     "threadCol",
     "flaggedCol",
     "attachmentCol",
     "subjectCol",
     "unreadButtonColHeader",
     useCorrespondent ? "correspondentCol" : "senderCol",
     "junkStatusCol",
     "dateCol",
-    "locationCol"
+    "locationCol",
   ];
   GLODA_DEFAULTS = [
     "threadCol",
     "flaggedCol",
     "subjectCol",
     useCorrespondent ? "correspondentCol" : "senderCol",
     "dateCol",
-    "locationCol"
+    "locationCol",
   ];
 
   // create the source
   folderSource = create_folder("ColumnsApplySource");
 }
 
 /**
  * Get the currently visible threadTree columns.
@@ -389,17 +389,17 @@ function test_reset_to_inbox() {
   show_column("sizeCol");
   assert_visible_columns(conExtra);
 
   // reset!
   invoke_column_picker_option([{anonid: "menuitem"}]);
 }
 
 function subtest_say_yes(cwc) {
-  cwc.window.document.documentElement.getButton('accept').doCommand();
+  cwc.window.document.documentElement.getButton("accept").doCommand();
 }
 
 function _apply_to_folder_common(aChildrenToo, folder) {
   if (aChildrenToo)
     plan_for_observable_event("msg-folder-columns-propagated");
   plan_for_modal_dialog("commonDialog", subtest_say_yes);
   invoke_column_picker_option([{class: "applyTo-menu"},
                                {class: aChildrenToo ?
@@ -491,17 +491,17 @@ function test_apply_to_folder_no_childre
   folderChild2 = folderParent.getChildNamed("Child2");
 
   be_in_folder(folderSource);
 
   invoke_column_picker_option([{anonid: "menuitem"}]); // reset order!
   // Hide the columns that were added in other tests, since reset now
   // only resets the order.
   hide_column("tagsCol");
-  hide_column("sizeCol")
+  hide_column("sizeCol");
 
   // permute!
   let conExtra = [...INBOX_DEFAULTS];
   if (useCorrespondent) {
     conExtra[5] = "senderCol";
     hide_column("correspondentCol");
     show_column("senderCol");
   } else {
@@ -576,17 +576,17 @@ function FakeCollection() {
 function plan_for_columns_state_update() {
   gColumnStateUpdated = false;
 }
 
 function wait_for_columns_state_updated() {
   const STATE_PREF = "mailnews.database.global.views.global";
   let columns_state_updated = function() {
     gColumnStateUpdated = true;
-  }
+  };
   Services.prefs.addObserver(STATE_PREF, columns_state_updated);
   mc.waitFor(() => gColumnStateUpdated, "Timeout waiting for columns state updated.");
   Services.prefs.removeObserver(STATE_PREF, columns_state_updated);
 }
 
 function test_column_defaults_gloda_collection() {
   let fakeCollection = new FakeCollection();
   mc.tabmail.openTab("glodaList", { collection: fakeCollection });
--- a/mail/test/mozmill/folder-display/test-deletion-from-virtual-folders.js
+++ b/mail/test/mozmill/folder-display/test-deletion-from-virtual-folders.js
@@ -3,36 +3,38 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that deleting messages works from a virtual folder.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-deletion-from-virtual-folders';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-deletion-from-virtual-folders";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var baseFolder, folder, lastMessageFolder;
 
 var tabFolder, tabMessage, tabMessageBackground, curMessage, nextMessage;
 
 var setNormal;
 
 /**
  * The message window controller.
  */
 var msgc;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   baseFolder = create_folder("DeletionFromVirtualFoldersA");
   // For setTagged, we want exactly as many messages as we plan to delete, so
   // that we can test that the message window and tabs close when they run out
   // of things to display.
   let [, setTagged] = make_new_sets_in_folder(baseFolder, [{count: 4},
                                                            {count: 4}]);
@@ -41,23 +43,23 @@ function setupModule(module) {
   [setNormal] = make_new_sets_in_folder(inboxFolder, [{count: 4}]);
 
   // Add the view picker to the toolbar
   let toolbar = mc.e("mail-bar3");
   toolbar.insertItem("mailviews-container", null);
   mc.assertNode(mc.eid("mailviews-container"));
 }
 
-/// Check whether this message is displayed in the folder tab
+// Check whether this message is displayed in the folder tab
 var VERIFY_FOLDER_TAB = 0x1;
-/// Check whether this message is displayed in the foreground message tab
+// Check whether this message is displayed in the foreground message tab
 var VERIFY_MESSAGE_TAB = 0x2;
-/// Check whether this message is displayed in the background message tab
+// Check whether this message is displayed in the background message tab
 var VERIFY_BACKGROUND_MESSAGE_TAB = 0x4;
-/// Check whether this message is displayed in the message window
+// Check whether this message is displayed in the message window
 var VERIFY_MESSAGE_WINDOW = 0x8;
 var VERIFY_ALL = 0xF;
 
 /**
  * Verify that the message is displayed in the given tabs. The index is
  * optional.
  */
 function _verify_message_is_displayed_in(aFlags, aMessage, aIndex) {
--- a/mail/test/mozmill/folder-display/test-deletion-with-multiple-displays.js
+++ b/mail/test/mozmill/folder-display/test-deletion-with-multiple-displays.js
@@ -7,29 +7,31 @@
  *  that tab/window as well as all other tabs/windows.  We also test that the
  *  message tab title updates appropriately through all of this. We do all of
  *  this both for tabs that have ever been opened in the foreground, and tabs
  *  that haven't (and thus might have fake selections).
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-deletion-with-multiple-displays';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-deletion-with-multiple-displays";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folder, lastMessageFolder, oneBeforeFolder, oneAfterFolder,
     multipleDeletionFolder1, multipleDeletionFolder2, multipleDeletionFolder3,
     multipleDeletionFolder4;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folder = create_folder("DeletionA");
   lastMessageFolder = create_folder("DeletionB");
   oneBeforeFolder = create_folder("DeletionC");
   oneAfterFolder = create_folder("DeletionD");
   multipleDeletionFolder1 = create_folder("DeletionE");
   multipleDeletionFolder2 = create_folder("DeletionF");
@@ -86,23 +88,23 @@ function _open_message_in_all_four_displ
 
   // - Open the window with the message
   // need to go back to the folder tab.  (well, should.)
   switch_tab(tabFolder);
   msgc = open_selected_message_in_new_window();
   assert_selected_and_displayed(msgc, curMessage);
 }
 
-/// Check whether this message is displayed in the folder tab
+// Check whether this message is displayed in the folder tab
 var VERIFY_FOLDER_TAB = 0x1;
-/// Check whether this message is displayed in the foreground message tab
+// Check whether this message is displayed in the foreground message tab
 var VERIFY_MESSAGE_TAB = 0x2;
-/// Check whether this message is displayed in the background message tab
+// Check whether this message is displayed in the background message tab
 var VERIFY_BACKGROUND_MESSAGE_TAB = 0x4;
-/// Check whether this message is displayed in the message window
+// Check whether this message is displayed in the message window
 var VERIFY_MESSAGE_WINDOW = 0x8;
 var VERIFY_ALL = 0xF;
 
 /**
  * Verify that the message is displayed in the given tabs. The index is
  * optional.
  */
 function _verify_message_is_displayed_in(aFlags, aMessage, aIndex) {
--- a/mail/test/mozmill/folder-display/test-display-name.js
+++ b/mail/test/mozmill/folder-display/test-display-name.js
@@ -4,18 +4,20 @@
 
 /*
  * Test that the display names in email addresses are correctly shown in the
  * thread pane.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-address-book-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+
 var MODULE_NAME = "test-display-name";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "address-book-helpers"];
 
 var folder;
 
 var messages = [
   // Basic From header tests
   { name: "from_display_name_unquoted",
@@ -175,17 +177,17 @@ function check_display_name(index, colum
       columnIndex = 6;
       break;
     default:
       throw new Error("unknown column name: " + columnName);
   }
 
   // Select the nth message
   be_in_folder(folder);
-  let curMessage = select_click_row(index);
+  select_click_row(index);
 
   let tree = mc.folderDisplay.tree;
   let cellText = tree.view.getCellText(index, tree.columns[columnIndex]);
 
   assert_equals(cellText, expectedName, columnName);
 }
 
 // Generate a test for each message in |messages|.
--- a/mail/test/mozmill/folder-display/test-displaying-messages-in-folder-tabs.js
+++ b/mail/test/mozmill/folder-display/test-displaying-messages-in-folder-tabs.js
@@ -6,21 +6,23 @@
  * Test displaying messages in folder tabs. This is supposed to test a variety
  * of situations, including:
  * - dropping view filters to select the message
  * - displaying the message in an existing folder tab
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-search-window-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-displaying-messages-in-folder-tabs";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
-                       "search-window-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "search-window-helpers"];
 
 var folderA;
 var folderB;
 var folderC;
 
 var folderTab;
 
 var msgHdrsInFolderA = [], msgHdrsInFolderB = [];
@@ -387,9 +389,9 @@ function test_display_message_scrolls_to
   _verify_display_in_existing_tab(preCount, folderC, msgHdr);
 }
 
 /**
  * Clean up and remove the view picker.
  */
 function test_cleanup() {
   remove_from_toolbar(mc.e("mail-bar3"), "mailviews-container");
-};
+}
--- a/mail/test/mozmill/folder-display/test-folder-pane-visibility.js
+++ b/mail/test/mozmill/folder-display/test-folder-pane-visibility.js
@@ -4,27 +4,29 @@
 
 /*
  * Test that the folder pane collapses properly, stays collapsed amongst tab
  * changes, and that persistence works (to a first approximation).
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-folder-pane-visibility";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folder = create_folder("FolderPaneVisibility");
   make_new_sets_in_folder(folder, [{count: 3}]);
 }
 
 /**
  * When displaying a folder, assert that the folder pane is visible and all the
@@ -70,20 +72,19 @@ function assert_folder_pane_hidden(aFold
   // force the view menu to update.
   mc.window.view_init();
   let paneMenuItem = mc.e("menu_showFolderPane");
   // - the folder pane splitter should or should not be collapsed, depending on
   //   aFolderPaneIllegal
   if (aFolderPaneIllegal) {
     if (mc.e("folderpane_splitter").collapsed === false)
       throw new Error("folderpane_splitter should be collapsed!");
-    //if (paneMenuItem.getAttribute("disabled") != "true")
+    // if (paneMenuItem.getAttribute("disabled") != "true")
     //  throw new Error("The Folder Pane menu item should be disabled.");
-  }
-  else {
+  } else {
     if (mc.e("folderpane_splitter").collapsed === true)
       throw new Error("folderpane_splitter should not be collapsed!");
     if (paneMenuItem.getAttribute("checked") == "true")
       throw new Error("The Folder Pane menu item should not be checked.");
   }
 }
 
 function toggle_folder_pane() {
@@ -193,18 +194,17 @@ function test_folder_pane_persistence_ge
 
   // helper to open tabs with the folder pane in the desired states (1 for
   //  visible, 0 for hidden)
   function openTabs(aConfig) {
     let curState;
     for (let [iTab, folderPaneVisible] of aConfig.entries()) {
       if (iTab == 0) {
         curState = folderPaneVisible;
-      }
-      else {
+      } else {
         open_folder_in_new_tab(folder);
         if (curState != folderPaneVisible) {
           toggle_folder_pane();
           curState = folderPaneVisible;
         }
       }
     }
   }
@@ -225,17 +225,17 @@ function test_folder_pane_persistence_ge
         assert_folder_pane_hidden();
     }
   }
 
   let configs = [
     // 1st time: [+ - - + +]
     [1, 0, 0, 1, 1],
     // 2nd time: [- + + - -]
-    [0, 1, 1, 0, 0]
+    [0, 1, 1, 0, 0],
   ];
 
   for (let config of configs) {
     openTabs(config);
     verifyTabs(config); // make sure openTabs did its job right
     let state = mc.tabmail.persistTabs();
     closeTabs();
     // toggle the state for the current tab so we can be sure that it knows how
--- a/mail/test/mozmill/folder-display/test-folder-toolbar.js
+++ b/mail/test/mozmill/folder-display/test-folder-toolbar.js
@@ -4,53 +4,52 @@
 
 /*
  * Test that opening new folder and message tabs has the expected result and
  *  that closing them doesn't break anything.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-folder-toolbar";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folderA, folderB;
 
-function setupModule(module)
-{
+function setupModule(module) {
   let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
   let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folderA = create_folder("FolderToolbarA");
   // we need one message to select and open
   folderB = create_folder("FolderToolbarB");
   make_new_sets_in_folder(folderB, [{count: 1}]);
 }
 
-function test_add_folder_toolbar()
-{
+function test_add_folder_toolbar() {
   // It should not be present by default
   let folderLoc = mc.eid("locationFolders");
   mc.assertNodeNotExist(folderLoc);
 
   // But it should show up when we call
   add_to_toolbar(mc.e("mail-bar3"), "folder-location-container");
   folderLoc = mc.eid("locationFolders");
   mc.assertNode(folderLoc);
 
   assert_equals(!!folderLoc.node.label, true,
                 "Uninitialized Folder doesn't have a default label.");
 }
 
-function test_folder_toolbar_shows_correct_item()
-{
+function test_folder_toolbar_shows_correct_item() {
   add_to_toolbar(mc.e("mail-bar3"), "folder-location-container");
   let folderLoc = mc.eid("locationFolders");
 
   // Start in folder a.
   let tabFolderA = be_in_folder(folderA);
   assert_folder_selected_and_displayed(folderA);
   assert_nothing_selected();
   assert_equals(folderLoc.node.label, "FolderToolbarA",
@@ -75,29 +74,28 @@ function test_folder_toolbar_shows_corre
   switch_tab(tabFolderB);
   assert_folder_selected_and_displayed(folderB);
   assert_nothing_selected();
   assert_equals(folderLoc.node.label, "FolderToolbarB",
                 "Switching back to FolderB's tab doesn't update toolbar.");
   close_tab(tabFolderB);
 }
 
-function test_folder_toolbar_disappears_on_message_tab()
-{
+function test_folder_toolbar_disappears_on_message_tab() {
   add_to_toolbar(mc.e("mail-bar3"), "folder-location-container");
   be_in_folder(folderB);
   let folderLoc = mc.eid("locationFolders");
   mc.assertNode(folderLoc);
   assert_equals(folderLoc.node.label, "FolderToolbarB",
                 "We should have started in FolderB.");
   assert_equals(folderLoc.node.collapsed, false,
                 "The toolbar should be shown.");
 
   // Select one message
-  let msgHdr = select_click_row(0);
+  select_click_row(0);
   // Open it
   let messageTab = open_selected_message_in_new_tab();
 
   assert_equals(mc.e("folder-location-container").collapsed, true,
                 "The toolbar should be hidden.");
 
   // Clean up, close the tab
   close_tab(messageTab);
--- a/mail/test/mozmill/folder-display/test-invalid-db-folder-load.js
+++ b/mail/test/mozmill/folder-display/test-invalid-db-folder-load.js
@@ -5,31 +5,33 @@
 /*
  * Test that clicking on a folder with an invalid or missing .msf file
  * regenerates the.msf file and loads the view.
  * Also, check that rebuilding the index on a loaded folder reloads the folder.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-invalid-db-folder-load';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-invalid-db-folder-load";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folder;
 var setA;
 var curMessage;
 
 var nsMsgViewSortType = Ci.nsMsgViewSortType;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folder = create_folder("InvalidMSF");
   [setA] = make_new_sets_in_folder(folder, [{count: 3}]);
 }
 
 /**
  *
--- a/mail/test/mozmill/folder-display/test-mail-views.js
+++ b/mail/test/mozmill/folder-display/test-mail-views.js
@@ -1,29 +1,31 @@
 /* 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/. */
 
 "use strict";
 
-var MODULE_NAME = 'test-mail-views';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-mail-views";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var baseFolder, savedFolder;
 var setUntagged, setTagged;
 
 var {MailViewConstants} = ChromeUtils.import("resource:///modules/MailViewManager.jsm");
 var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
 
 var setupModule = function(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   // Create a folder with some messages that have no tags and some that are
   //  tagged Important ($label1).
   baseFolder = create_folder("MailViewA");
   [setUntagged, setTagged] = make_new_sets_in_folder(baseFolder,
                                                      [{}, {}]);
   setTagged.addTag("$label1"); // Important, by default
--- a/mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
+++ b/mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
@@ -6,22 +6,23 @@
  * This tests some commands on messages via the UI. But we specifically check,
  * whether the commands have an effect in the message store on disk, i.e. the
  * markings on the messages are stored in the msgStore, not only in the database.
  * For now, it checks for bug 840418.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-compose-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
 var MODULE_NAME = "test-message-commands-on-msgstore";
-
 var RELATIVE_ROOT = "../shared-modules";
-var MODULE_REQUIRES = ["folder-display-helpers",
-                         "compose-helpers",
-                         "window-helpers"];
+var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var {IOUtils} = ChromeUtils.import("resource:///modules/IOUtils.js");
 
 var statusHeader = "X-Mozilla-Status: ";
 
 var gInbox;
@@ -44,23 +45,23 @@ function setupModule(module) {
   be_in_folder(gInbox);
   let curMessage = select_click_row(0);
   press_delete(mc);
   assert_not_equals(curMessage, select_click_row(0));
 
   let urlListener = {
     compactDone: false,
 
-    OnStartRunningUrl: function (aUrl) {
+    OnStartRunningUrl(aUrl) {
     },
-    OnStopRunningUrl: function (aUrl, aExitCode) {
+    OnStopRunningUrl(aUrl, aExitCode) {
       assert_equals(aExitCode, 0);
       assert_true(gInbox.msgDatabase.summaryValid);
       this.compactDone = true;
-    }
+    },
   };
 
   // Compaction adds the X-Mozilla-Status rows into the messages
   // that we will need later on.
   assert_true(gInbox.msgStore.supportsCompaction);
   gInbox.compact(urlListener, null);
 
   mc.waitFor(function() { return urlListener.compactDone; },
@@ -83,17 +84,17 @@ function check_status(aMsgHdr, aOffset, 
     aStatusOffset = aMsgHdr.statusOffset;
 
   let folder = (aMsgHdr == null) ? gInbox : aMsgHdr.folder;
 
   let mboxstring = IOUtils.loadFileToString(folder.filePath);
 
   let expectedStatusString = aStatus.toString(16);
   while (expectedStatusString.length < 4) {
-    expectedStatusString = '0' + expectedStatusString;
+    expectedStatusString = "0" + expectedStatusString;
   }
 
   assert_equals(mboxstring.substr(aOffset + aStatusOffset, statusHeader.length),
                 statusHeader,
                 "The header '" + statusHeader + "' not found at offset: " + aOffset + ", statusOffset: " + aStatusOffset);
   assert_equals(mboxstring.substr(aOffset + aStatusOffset + statusHeader.length, 4),
                 expectedStatusString);
 }
--- a/mail/test/mozmill/folder-display/test-message-commands.js
+++ b/mail/test/mozmill/folder-display/test-message-commands.js
@@ -5,44 +5,46 @@
 /**
  * This tests various commands on messages. This is primarily for commands
  * that can't be tested with xpcshell tests because they're handling in the
  * front end - which is why Archive is the only command currently tested.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-message-commands';
+/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'content-tab-helpers',
-                       'window-helpers'];
+var MODULE_NAME = "test-message-commands";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers", "window-helpers"];
 
 var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
 var unreadFolder, shiftDeleteFolder, threadDeleteFolder;
 var archiveSrcFolder = null;
 var archiveURI;
 
 var acctMgr;
 var tagArray;
 
 var setupModule = function(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let cth = collector.getModule('content-tab-helpers');
+  let cth = collector.getModule("content-tab-helpers");
   cth.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
-  unreadFolder = create_folder('UnreadFolder');
-  shiftDeleteFolder = create_folder('ShiftDeleteFolder');
-  threadDeleteFolder = create_folder('ThreadDeleteFolder');
-  archiveSrcFolder = create_folder('ArchiveSrc');
+  unreadFolder = create_folder("UnreadFolder");
+  shiftDeleteFolder = create_folder("ShiftDeleteFolder");
+  threadDeleteFolder = create_folder("ThreadDeleteFolder");
+  archiveSrcFolder = create_folder("ArchiveSrc");
 
   make_new_sets_in_folder(unreadFolder, [{count: 2}]);
   make_new_sets_in_folder(shiftDeleteFolder, [{count: 3}]);
   add_sets_to_folders([threadDeleteFolder],
                       [create_thread(3), create_thread(3), create_thread(3)]);
 
   // Create messages from 20 different months, which will mean 2 different
   // years as well.
@@ -157,17 +159,16 @@ function test_mark_n_read_mixed() {
   curMessages[1].markRead(false);
   mark_read_via_menu(0, true);
   check_read_status(curMessages, true);
 
   curMessages[0].markRead(false);
   curMessages[1].markRead(true);
   mark_read_via_menu(0, true);
   check_read_status(curMessages, true);
-
 }
 
 function test_mark_n_unread_mixed() {
   be_in_folder(unreadFolder);
   select_click_row(0);
   let curMessages = select_shift_click_row(1);
 
   curMessages[0].markRead(false);
@@ -265,83 +266,83 @@ function test_mark_all_read() {
   assert_true(allReadDisabled, "Mark All Read menu item should be disabled!");
 }
 
 function test_shift_delete_prompt() {
   be_in_folder(shiftDeleteFolder);
   let curMessage = select_click_row(0);
 
   // First, try shift-deleting and then cancelling at the prompt.
-  Services.prefs.setBoolPref('mail.warn_on_shift_delete', true);
-  plan_for_modal_dialog('commonDialog', function(controller) {
-    controller.window.document.documentElement.getButton('cancel').doCommand();
+  Services.prefs.setBoolPref("mail.warn_on_shift_delete", true);
+  plan_for_modal_dialog("commonDialog", function(controller) {
+    controller.window.document.documentElement.getButton("cancel").doCommand();
   });
   // We don't use press_delete here because we're not actually deleting this
   // time!
-  mc.keypress(null, 'VK_DELETE', {shiftKey: true});
-  wait_for_modal_dialog('commonDialog');
+  mc.keypress(null, "VK_DELETE", {shiftKey: true});
+  wait_for_modal_dialog("commonDialog");
   // Make sure we didn't actually delete the message.
   assert_equals(curMessage, select_click_row(0));
 
   // Second, try shift-deleting and then accepting the deletion.
-  plan_for_modal_dialog('commonDialog', function(controller) {
-    controller.window.document.documentElement.getButton('accept').doCommand();
+  plan_for_modal_dialog("commonDialog", function(controller) {
+    controller.window.document.documentElement.getButton("accept").doCommand();
   });
   press_delete(mc, {shiftKey: true});
-  wait_for_modal_dialog('commonDialog');
+  wait_for_modal_dialog("commonDialog");
   // Make sure we really did delete the message.
   assert_not_equals(curMessage, select_click_row(0));
 
   // Finally, try shift-deleting when we turned off the prompt.
-  Services.prefs.setBoolPref('mail.warn_on_shift_delete', false);
+  Services.prefs.setBoolPref("mail.warn_on_shift_delete", false);
   curMessage = select_click_row(0);
   press_delete(mc, {shiftKey: true});
-  wait_for_modal_dialog('commonDialog');
+  wait_for_modal_dialog("commonDialog");
   // Make sure we really did delete the message.
   assert_not_equals(curMessage, select_click_row(0));
 
-  Services.prefs.clearUserPref('mail.warn_on_shift_delete');
+  Services.prefs.clearUserPref("mail.warn_on_shift_delete");
 }
 
 function test_thread_delete_prompt() {
   be_in_folder(threadDeleteFolder);
   make_display_threaded();
   collapse_all_threads();
 
   let curMessage = select_click_row(0);
   // First, try deleting and then cancelling at the prompt.
-  Services.prefs.setBoolPref('mail.warn_on_collapsed_thread_operation', true);
-  plan_for_modal_dialog('commonDialog', function(controller) {
-    controller.window.document.documentElement.getButton('cancel').doCommand();
+  Services.prefs.setBoolPref("mail.warn_on_collapsed_thread_operation", true);
+  plan_for_modal_dialog("commonDialog", function(controller) {
+    controller.window.document.documentElement.getButton("cancel").doCommand();
   });
   // We don't use press_delete here because we're not actually deleting this
   // time!
-  mc.keypress(null, 'VK_DELETE', {});
-  wait_for_modal_dialog('commonDialog');
+  mc.keypress(null, "VK_DELETE", {});
+  wait_for_modal_dialog("commonDialog");
   // Make sure we didn't actually delete the message.
   assert_equals(curMessage, select_click_row(0));
 
   // Second, try deleting and then accepting the deletion.
-  plan_for_modal_dialog('commonDialog', function(controller) {
-    controller.window.document.documentElement.getButton('accept').doCommand();
+  plan_for_modal_dialog("commonDialog", function(controller) {
+    controller.window.document.documentElement.getButton("accept").doCommand();
   });
   press_delete(mc);
-  wait_for_modal_dialog('commonDialog');
+  wait_for_modal_dialog("commonDialog");
   // Make sure we really did delete the message.
   assert_not_equals(curMessage, select_click_row(0));
 
   // Finally, try shift-deleting when we turned off the prompt.
-  Services.prefs.setBoolPref('mail.warn_on_collapsed_thread_operation', false);
+  Services.prefs.setBoolPref("mail.warn_on_collapsed_thread_operation", false);
   curMessage = select_click_row(0);
   press_delete(mc);
-  wait_for_modal_dialog('commonDialog');
+  wait_for_modal_dialog("commonDialog");
   // Make sure we really did delete the message.
   assert_not_equals(curMessage, select_click_row(0));
 
-  Services.prefs.clearUserPref('mail.warn_on_collapsed_thread_operation');
+  Services.prefs.clearUserPref("mail.warn_on_collapsed_thread_operation");
 }
 
 function test_yearly_archive() {
   yearly_archive(false);
 }
 
 function yearly_archive(keep_structure) {
   be_in_folder(archiveSrcFolder);
@@ -522,21 +523,21 @@ function test_tag_keys() {
   check_tag_in_message(curMessage, tagArray[0], false);
   check_tag_in_message(curMessage, tagArray[1], false);
 }
 
 function test_tag_keys_disabled_in_content_tab() {
   be_in_folder(unreadFolder);
   let curMessage = select_click_row(0);
 
-  mc.window.openAddonsMgr('addons://list/theme');
+  mc.window.openAddonsMgr("addons://list/theme");
   mc.sleep(0);
 
   let tab = mc.tabmail.currentTabInfo;
-  wait_for_content_tab_load(tab, 'about:addons', 15000);
+  wait_for_content_tab_load(tab, "about:addons", 15000);
 
   // Make sure pressing the "1" key in a content tab doesn't tag a message
   check_tag_in_message(curMessage, tagArray[0], false);
   mc.keypress(null, "1", {});
   check_tag_in_message(curMessage, tagArray[0], false);
 }
 
 function teardownModule() {
--- a/mail/test/mozmill/folder-display/test-message-pane-visibility.js
+++ b/mail/test/mozmill/folder-display/test-message-pane-visibility.js
@@ -4,27 +4,29 @@
 
 /*
  * Test that the message pane collapses properly, stays collapsed amongst tab
  *  changes, and that persistence works (to a first approximation).
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-message-pane-visibility';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-message-pane-visibility";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folder = create_folder("MessagePaneVisibility");
   make_new_sets_in_folder(folder, [{count: 3}]);
 }
 
 /**
  * By default, the message pane should be visible.  Make sure that this state of
@@ -62,17 +64,16 @@ function test_toggle_message_pane_on() {
   assert_message_pane_visible();
 }
 
 /**
  * Make sure that the message tab isn't broken by being invoked from a folder tab
  *  with a collapsed message pane.
  */
 function test_collapsed_message_pane_does_not_break_message_tab() {
-
   be_in_folder(folder);
 
   // - toggle message pane off
   toggle_message_pane();
   assert_message_pane_hidden();
 
   // - open message tab, make sure the message pane is visible
   select_click_row(0);
@@ -165,18 +166,17 @@ function test_message_pane_persistence_g
 
   // helper to open tabs with the message pane in the desired states (1 for
   //  visible, 0 for hidden)
   function openTabs(aConfig) {
     let curState;
     for (let [iTab, messagePaneVisible] of aConfig.entries()) {
       if (iTab == 0) {
         curState = messagePaneVisible;
-      }
-      else {
+      } else {
         open_folder_in_new_tab(folder);
         if (curState != messagePaneVisible) {
           toggle_message_pane();
           curState = messagePaneVisible;
         }
       }
     }
   }
@@ -197,17 +197,17 @@ function test_message_pane_persistence_g
         assert_message_pane_hidden();
     }
   }
 
   let configs = [
     // 1st time: [+ - - + +]
     [1, 0, 0, 1, 1],
     // 2nd time: [- + + - -]
-    [0, 1, 1, 0, 0]
+    [0, 1, 1, 0, 0],
   ];
   for (let config of configs) {
     openTabs(config);
     verifyTabs(config); // make sure openTabs did its job right
 
     // Switch to the first tab, so that we don't cause a double message load
     // while restoring tabs (one by the first tab, one by the currently selected
     // one). This is fine because we only restore tabs at startup, and we know
@@ -223,11 +223,10 @@ function test_message_pane_persistence_g
     mc.tabmail.restoreTabs(state);
     verifyTabs(config);
     closeTabs();
 
     // toggle the first tab again.  This sets - properly for the second pass and
     //  restores it to + for when we are done.
     toggle_message_pane();
   }
-
 }
 
--- a/mail/test/mozmill/folder-display/test-message-reloads.js
+++ b/mail/test/mozmill/folder-display/test-message-reloads.js
@@ -4,18 +4,19 @@
 
 /*
  * Test that message reloads happen properly when the message pane is hidden,
  * and then made visible again.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+
 var MODULE_NAME = "test-message-reloads";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers"];
 
 var folder;
 
 function setupModule(module) {
   let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
--- a/mail/test/mozmill/folder-display/test-message-size.js
+++ b/mail/test/mozmill/folder-display/test-message-size.js
@@ -5,33 +5,34 @@
 
 /*
  * Test that the size column of in the message list is formatted properly (e.g.
    0.1 KB, 1.2 KB, 12.3 KB, 123 KB, and likewise for MB and GB).
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-message-size';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers'];
+var MODULE_NAME = "test-message-size";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers"];
 
 var folder;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
 
   folder = create_folder("MessageSizeA");
 
   // Create messages with sizes in the byte, KB, and MB ranges.
   let bytemsg = create_message({body: {body: " "}});
 
-  let kbstring = "x ".repeat(1024/2);
+  let kbstring = "x ".repeat(1024 / 2);
   let kbmsg = create_message({body: {body: kbstring}});
 
   let mbstring = kbstring.repeat(1024);
   let mbmsg = create_message({body: {body: mbstring}});
 
   add_message_to_folder(folder, bytemsg);
   add_message_to_folder(folder, kbmsg);
   add_message_to_folder(folder, mbmsg);
@@ -47,19 +48,19 @@ function _help_test_message_size(index, 
   let sizeCol = tree.columns.sizeCol;
   let sizeStr = tree.view.getCellText(index, sizeCol);
 
   // Note: this assumes that the numeric part of the size string is first
   let realSize = curMessage.messageSize;
   let abbrSize = parseFloat(sizeStr);
 
   if (isNaN(abbrSize))
-    throw new Error("formatted size is not numeric: '"+sizeStr+"'");
-  if (Math.abs(realSize/Math.pow(1024, unit) - abbrSize) > 0.5)
-    throw new Error("size mismatch: '"+realSize+"' and '"+sizeStr+"'");
+    throw new Error("formatted size is not numeric: '" + sizeStr + "'");
+  if (Math.abs(realSize / Math.pow(1024, unit) - abbrSize) > 0.5)
+    throw new Error("size mismatch: '" + realSize + "' and '" + sizeStr + "'");
 }
 
 function test_byte_message_size() {
   _help_test_message_size(0, 1);
 }
 
 function test_kb_message_size() {
   _help_test_message_size(1, 1);
--- a/mail/test/mozmill/folder-display/test-message-window.js
+++ b/mail/test/mozmill/folder-display/test-message-window.js
@@ -4,28 +4,30 @@
 
 /*
  * Test that we can open and close a standalone message display window from the
  *  folder pane.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-message-window';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-message-window";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var folderA, folderB;
 var curMessage;
 
 function setupModule(module) {
-  let fdh = collector.getModule('folder-display-helpers');
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folderA = create_folder("MessageWindowA");
   folderB = create_folder("MessageWindowB");
   // create three messages in the folder to display
   let msg1 = create_thread(1);
   let msg2 = create_thread(1);
   let thread1 = create_thread(2);
@@ -90,21 +92,20 @@ function test_delete_single_message() {
 /**
  * Delete the current message, and verify that it only deletes
  * a single message, not the messages in the collapsed thread
  */
 function test_del_collapsed_thread() {
   press_delete(msgc);
   if (folderA.getTotalMessages(false) != 4)
     throw new Error("should have only deleted one message");
-
 }
 
 function subtest_say_yes(cwc) {
-  cwc.window.document.documentElement.getButton('accept').doCommand();
+  cwc.window.document.documentElement.getButton("accept").doCommand();
 }
 
 /**
  * Hit n enough times to mark all messages in folder A read, and then accept the
  * modal dialog saying that we should move to the next folder. Then, assert that
  * the message displayed in the standalone message window is folder B's first
  * message (since all messages in folder B were unread).
  */
--- a/mail/test/mozmill/folder-display/test-opening-messages-without-a-backing-view.js
+++ b/mail/test/mozmill/folder-display/test-opening-messages-without-a-backing-view.js
@@ -5,43 +5,45 @@
 /*
  * Test that messages without a backing view are opened correctly. Examples of
  * messages without a backing view are those opened from the command line or
  * desktop search integration results.
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-opening-messages-without-a-backing-view';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-opening-messages-without-a-backing-view";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
 // One folder's enough
 var folder = null;
 
 // A list of the message headers in this folder
 var msgHdrsInFolder = null;
 
 // Number of messages to open for multi-message tests
 var NUM_MESSAGES_TO_OPEN = 5;
 
-var setupModule = function (module) {
-  let fdh = collector.getModule('folder-display-helpers');
+function setupModule(module) {
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folder = create_folder("OpeningMessagesNoBackingViewA");
   make_new_sets_in_folder(folder, [{count: 10}]);
   // We don't obey mail view persistence unless the view picker is there
   add_to_toolbar(mc.e("mail-bar3"), "mailviews-container");
-};
+}
 
 /**
  * Test opening a single message without a backing view in a new tab.
  */
 function test_open_single_message_without_backing_view_in_tab() {
   set_open_message_behavior("NEW_TAB");
   let folderTab = mc.tabmail.currentTabInfo;
   let preCount = mc.tabmail.tabContainer.childNodes.length;
--- a/mail/test/mozmill/folder-display/test-opening-messages.js
+++ b/mail/test/mozmill/folder-display/test-opening-messages.js
@@ -13,36 +13,38 @@
  *   amount of additional work and are hard to test. We're also assuming here
  *   that multiple messages opened in windows are just the same function called
  *   repeatedly.)
  * - reusing an existing window to show another message
  */
 
 "use strict";
 
-var MODULE_NAME = 'test-opening-messages';
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
 
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
+var MODULE_NAME = "test-opening-messages";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
 
 // One folder's enough
 var folder = null;
 
 // Number of messages to open for multi-message tests
 var NUM_MESSAGES_TO_OPEN = 5;
 
-var setupModule = function (module) {
-  let fdh = collector.getModule('folder-display-helpers');
+function setupModule(module) {
+  let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
-  let wh = collector.getModule('window-helpers');
+  let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   folder = create_folder("OpeningMessagesA");
   make_new_sets_in_folder(folder, [{count: 10}]);
-};
+}
 
 /**
  * Test opening a single message in a new tab.
  */
 function test_open_single_message_in_tab() {
   set_open_message_behavior("NEW_TAB");
   let folderTab = mc.tabmail.currentTabInfo;
   let preCount = mc.tabmail.tabContainer.childNodes.length;
@@ -191,16 +193,16 @@ function check_message_pane_in_window_fu
   let messengerWindowHeight = aWC.e("messengerWindow").getBoundingClientRect().height;
   let messengerChildren = aWC.e("messengerWindow").children;
   let childrenHeightsSum = 0;
   let childrenHeightsStr = "";
   for (let child of messengerChildren) {
     try {
       let childRect = child.getBoundingClientRect();
       childrenHeightsSum += childRect.height;
-      childrenHeightsStr += '"' + child.id + '": ' + childRect.height + ', ';
+      childrenHeightsStr += '"' + child.id + '": ' + childRect.height + ", ";
     } catch (ex) {}
   }
 
   assert_equals(Math.round(messengerWindowHeight), Math.round(childrenHeightsSum),
     "messenger window height not equal to the sum of children heights: " +
     childrenHeightsStr);
 }
--- a/mail/test/mozmill/folder-display/test-pane-focus.js
+++ b/mail/test/mozmill/folder-display/test-pane-focus.js
@@ -3,18 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Test that cycling through the focus of the 3pane's panes works correctly.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+
 var MODULE_NAME = "test-pane-focus";
-
 var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers"];
 
 var folder;
 
 function setupModule(module) {
   let fdh = collector.getModule("folder-display-helpers");
   fdh.installInto(module);
@@ -33,17 +34,17 @@ function setupModule(module) {
 /**
  * Get the currently-focused pane in the 3pane. One of the folder pane, thread
  * pane, or message pane (single- or multi-message).
  *
  * @return the focused pane
  */
 function get_focused_pane() {
   let panes = [
-    "threadTree", "folderTree", "messagepane", "multimessage"
+    "threadTree", "folderTree", "messagepane", "multimessage",
   ].map(id => mc.e(id));
 
   let currentNode = mc.window.top.document.activeElement;
 
   while (currentNode) {
     if (panes.includes(currentNode))
       return currentNode;
 
--- a/mail/test/mozmill/folder-display/test-recent-menu.js
+++ b/mail/test/mozmill/folder-display/test-recent-menu.js
@@ -5,25 +5,27 @@
 /**
  * This tests the move/copy to recent folder menus to make sure
  * that they get updated when messages are moved to folders, and
  * don't get updated when we archive.
  */
 
 "use strict";
 
+/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
+/* import-globals-from ../shared-modules/test-window-helpers.js */
+
+var MODULE_NAME = "test-recent-menu";
+var RELATIVE_ROOT = "../shared-modules";
+var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
+
 var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
 var {fixIterator} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 
-var MODULE_NAME = 'test-recent-menu';
-
-var RELATIVE_ROOT = '../shared-modules';
-var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
-
 var folder1, folder2;
 var gInitRecentMenuCount;
 
 var setupModule = function(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
@@ -34,17 +36,17 @@ var setupModule = function(module) {
     folder.setStringProperty("MRMTime", "0");
   }
 
   // Try to make these folders first in alphabetic order
   folder1 = create_folder("aaafolder1");
   folder2 = create_folder("aaafolder2");
 
   make_new_sets_in_folder(folder1, [{count: 3}]);
-}
+};
 
 function test_move_message() {
   be_in_folder(folder1);
   let msgHdr = select_click_row(0);
   // This will cause the initial build of the move recent context menu,
   // which should be empty and disabled.
   right_click_on_row(0);
   let popups = mc.click_menus_in_sequence(mc.e("mailContext"),