Bug 1605030 - Remove mozmill tests from the tree. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 23 Dec 2019 20:24:14 +1300
changeset 37818 69a27f586f5d74851f560e697573ca58591b92fa
parent 37817 ad993f1c0a1d72e8d239bca5d0c3b2c9464a15d8
child 37819 9486adad80ffba8a056700e97f30628396787c51
push id397
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:16:13 +0000
reviewersmkmelin
bugs1605030
Bug 1605030 - Remove mozmill tests from the tree. r=mkmelin
mail/test/browser/moz.build
mail/test/browser/shared-modules/EventUtils.jsm
mail/test/browser/shared-modules/arrays.jsm
mail/test/browser/shared-modules/controller.jsm
mail/test/browser/shared-modules/dom.jsm
mail/test/browser/shared-modules/elementslib.jsm
mail/test/browser/shared-modules/events.jsm
mail/test/browser/shared-modules/frame.jsm
mail/test/browser/shared-modules/httpd.jsm
mail/test/browser/shared-modules/init.jsm
mail/test/browser/shared-modules/jum.jsm
mail/test/browser/shared-modules/moz.build
mail/test/browser/shared-modules/mozmill.jsm
mail/test/browser/shared-modules/os.jsm
mail/test/browser/shared-modules/securable-module.jsm
mail/test/browser/shared-modules/strings.jsm
mail/test/browser/shared-modules/utils.jsm
mail/test/mozmill/.eslintrc.js
mail/test/mozmill/Makefile.in
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/account/xml/example.com
mail/test/mozmill/account/xml/momo.invalid
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/attachment.txt
mail/test/mozmill/attachment/bug1358565.eml
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/data/testFile1
mail/test/mozmill/cloudfile/data/testFile2
mail/test/mozmill/cloudfile/data/testFile3
mail/test/mozmill/cloudfile/data/testFile4
mail/test/mozmill/cloudfile/html/settings-with-link.xhtml
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/attachment.txt
mail/test/mozmill/composition/base64-encoded-msg.eml
mail/test/mozmill/composition/base64-with-whitespace.eml
mail/test/mozmill/composition/body-greek.eml
mail/test/mozmill/composition/body-utf16.eml
mail/test/mozmill/composition/charset-cp932.eml
mail/test/mozmill/composition/content-utf8-alt-rel.eml
mail/test/mozmill/composition/content-utf8-alt-rel2.eml
mail/test/mozmill/composition/content-utf8-rel-alt.eml
mail/test/mozmill/composition/content-utf8-rel-only.eml
mail/test/mozmill/composition/feed-message.eml
mail/test/mozmill/composition/format-flowed.eml
mail/test/mozmill/composition/format1-altering.eml
mail/test/mozmill/composition/format1-plain.eml
mail/test/mozmill/composition/format2-style-attr.eml
mail/test/mozmill/composition/format3-style-tag.eml
mail/test/mozmill/composition/long-html-line.eml
mail/test/mozmill/composition/mime-encoded-subject.eml
mail/test/mozmill/composition/multipart-charset.eml
mail/test/mozmill/composition/tb-logo.png
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/composition/testmsg.eml
mail/test/mozmill/content-policy/html/mailtolink.html
mail/test/mozmill/content-policy/html/pass.png
mail/test/mozmill/content-policy/html/plugin.html
mail/test/mozmill/content-policy/html/remote-noscript.html
mail/test/mozmill/content-policy/html/remoteimage.html
mail/test/mozmill/content-policy/html/remoteimagedata.html
mail/test/mozmill/content-policy/html/remotevideo.html
mail/test/mozmill/content-policy/html/video.ogv
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/blocklist.xml
mail/test/mozmill/content-tabs/html/blocklistHard.xml
mail/test/mozmill/content-tabs/html/blocklist_details.html
mail/test/mozmill/content-tabs/html/corrupt.xpi
mail/test/mozmill/content-tabs/html/dummy.xml
mail/test/mozmill/content-tabs/html/favicon.ico
mail/test/mozmill/content-tabs/html/installxpi.html
mail/test/mozmill/content-tabs/html/installxpi.xpi
mail/test/mozmill/content-tabs/html/plugin.html
mail/test/mozmill/content-tabs/html/plugin_crashed_help.html
mail/test/mozmill/content-tabs/html/plugin_update.html
mail/test/mozmill/content-tabs/html/test-lwthemes.html
mail/test/mozmill/content-tabs/html/test.png
mail/test/mozmill/content-tabs/html/webextension.xpi
mail/test/mozmill/content-tabs/html/whatsnew.html
mail/test/mozmill/content-tabs/html/whatsnew.png
mail/test/mozmill/content-tabs/html/whatsnew1.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/content-tabs/wrapper.py
mail/test/mozmill/cookies/html/cookietest1.html
mail/test/mozmill/cookies/html/cookietest2.html
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-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-extension/chrome.manifest
mail/test/mozmill/folder-tree-modes/test-extension/manifest.json
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-tree-modes/wrapper.py
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/instrumentation/wrapper.py
mail/test/mozmill/junk-commands/test-junk-commands.js
mail/test/mozmill/keyboard/test-spacehit.js
mail/test/mozmill/message-header/evil-attached.eml
mail/test/mozmill/message-header/evil.eml
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/bug594646_newline_charset_8bit.eml
mail/test/mozmill/message-reader/bug594646_newline_charset_b64.eml
mail/test/mozmill/message-reader/bug594646_newline_charset_qp.eml
mail/test/mozmill/message-reader/bug594646_newline_httpequiv_8bit.eml
mail/test/mozmill/message-reader/bug594646_newline_httpequiv_b64.eml
mail/test/mozmill/message-reader/bug594646_newline_httpequiv_qp.eml
mail/test/mozmill/message-reader/bug594646_reference.eml
mail/test/mozmill/message-reader/bug594646_reversed_order_8bit.eml
mail/test/mozmill/message-reader/bug594646_reversed_order_b64.eml
mail/test/mozmill/message-reader/bug594646_reversed_order_qp.eml
mail/test/mozmill/message-reader/test-bug594646.js
mail/test/mozmill/message-window/emptySubject.eml
mail/test/mozmill/message-window/evil.eml
mail/test/mozmill/message-window/test-alt-HTML-missing.eml
mail/test/mozmill/message-window/test-alt-plain-HTML-reversed.eml
mail/test/mozmill/message-window/test-alt-plain-missing.eml
mail/test/mozmill/message-window/test-alt-rel-text.eml
mail/test/mozmill/message-window/test-alt-rel-with-attach.eml
mail/test/mozmill/message-window/test-alt-rel.eml
mail/test/mozmill/message-window/test-alt-rogue.eml
mail/test/mozmill/message-window/test-alt-rogue2.eml
mail/test/mozmill/message-window/test-alt.eml
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-rel-alt.eml
mail/test/mozmill/message-window/test-triple-alt.eml
mail/test/mozmill/message-window/test-vcard-actions.js
mail/test/mozmill/message-window/test-vcard-icon.eml
mail/test/mozmill/message-window/test-view-plaintext.js
mail/test/mozmill/moz.build
mail/test/mozmill/mozmilltests.list
mail/test/mozmill/multiple-identities/readme.txt
mail/test/mozmill/multiple-identities/test-display-names.js
mail/test/mozmill/newmailaccount/html/badSuggestFromName
mail/test/mozmill/newmailaccount/html/config.xml
mail/test/mozmill/newmailaccount/html/configCorrupt.xml
mail/test/mozmill/newmailaccount/html/configError.xml
mail/test/mozmill/newmailaccount/html/emptySuggestFromName
mail/test/mozmill/newmailaccount/html/providerList
mail/test/mozmill/newmailaccount/html/providerListBad
mail/test/mozmill/newmailaccount/html/providerListIncomplete
mail/test/mozmill/newmailaccount/html/providerListNoOtherLangs
mail/test/mozmill/newmailaccount/html/providerListWildcard
mail/test/mozmill/newmailaccount/html/registration.html
mail/test/mozmill/newmailaccount/html/registrationCorrupt.html
mail/test/mozmill/newmailaccount/html/registrationError.html
mail/test/mozmill/newmailaccount/html/suggestFromName
mail/test/mozmill/newmailaccount/html/target.html
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/override-main-menu-collapse/wrapper.py
mail/test/mozmill/pref-window/test-font-chooser.js
mail/test/mozmill/pref-window/wrapper.py
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/runtest.py
mail/test/mozmill/runtestlist.py
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/smime/Bob.p12
mail/test/mozmill/smime/README.md
mail/test/mozmill/smime/TestCA.pem
mail/test/mozmill/smime/multipart-alternative.eml
mail/test/mozmill/smime/test-smime-multipart-alternative.js
mail/test/mozmill/startup-firstrun/test-menubar-collapsed.js
mail/test/mozmill/startup-firstrun/wrapper.py
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
mail/test/resources/installmozmill.py
mail/test/resources/jsbridge/MANIFEST.in
mail/test/resources/jsbridge/jsbridge/__init__.py
mail/test/resources/jsbridge/jsbridge/extension/bootstrap.js
mail/test/resources/jsbridge/jsbridge/extension/chrome.manifest
mail/test/resources/jsbridge/jsbridge/extension/chrome/content/modules/events.js
mail/test/resources/jsbridge/jsbridge/extension/chrome/content/modules/init.js
mail/test/resources/jsbridge/jsbridge/extension/chrome/content/modules/server.js
mail/test/resources/jsbridge/jsbridge/extension/chrome/content/overlay.js
mail/test/resources/jsbridge/jsbridge/extension/manifest.json
mail/test/resources/jsbridge/jsbridge/jsobjects.py
mail/test/resources/jsbridge/jsbridge/network.py
mail/test/resources/jsbridge/setup.py
mail/test/resources/mozmill/MANIFEST.in
mail/test/resources/mozmill/mozmill/__init__.py
mail/test/resources/mozmill/mozmill/extension/bootstrap.js
mail/test/resources/mozmill/mozmill/extension/chrome.manifest
mail/test/resources/mozmill/mozmill/extension/content/modules/controller.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/elementslib.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/events.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/frame.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/init.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/jum.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/mozmill.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/utils.jsm
mail/test/resources/mozmill/mozmill/extension/content/overlay.js
mail/test/resources/mozmill/mozmill/extension/content/prefs.xhtml
mail/test/resources/mozmill/mozmill/extension/content/stdlib/EventUtils.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/arrays.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/dom.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/httpd.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/os.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/securable-module.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/strings.jsm
mail/test/resources/mozmill/mozmill/extension/manifest.json
mail/test/resources/mozmill/setup.py
--- a/mail/test/browser/moz.build
+++ b/mail/test/browser/moz.build
@@ -38,34 +38,16 @@ BROWSER_CHROME_MANIFESTS += [
     'tabmail/browser.ini',
     'utils/browser.ini',
 ]
 
 DIRS += [
     'shared-modules',
 ]
 
-TESTING_JS_MODULES.mozmill += [
-    '../resources/mozmill/mozmill/extension/content/modules/controller.jsm',
-    '../resources/mozmill/mozmill/extension/content/modules/elementslib.jsm',
-    '../resources/mozmill/mozmill/extension/content/modules/events.jsm',
-    '../resources/mozmill/mozmill/extension/content/modules/frame.jsm',
-    '../resources/mozmill/mozmill/extension/content/modules/init.jsm',
-    '../resources/mozmill/mozmill/extension/content/modules/jum.jsm',
-    '../resources/mozmill/mozmill/extension/content/modules/mozmill.jsm',
-    '../resources/mozmill/mozmill/extension/content/modules/utils.jsm',
-    '../resources/mozmill/mozmill/extension/content/stdlib/arrays.jsm',
-    '../resources/mozmill/mozmill/extension/content/stdlib/dom.jsm',
-    '../resources/mozmill/mozmill/extension/content/stdlib/EventUtils.jsm',
-    '../resources/mozmill/mozmill/extension/content/stdlib/httpd.jsm',
-    '../resources/mozmill/mozmill/extension/content/stdlib/os.jsm',
-    '../resources/mozmill/mozmill/extension/content/stdlib/securable-module.jsm',
-    '../resources/mozmill/mozmill/extension/content/stdlib/strings.jsm',
-]
-
 TEST_HARNESS_FILES.testing.mochitest.fakeserver += [
     '../../../mailnews/test/fakeserver/auth.js',
     '../../../mailnews/test/fakeserver/imapd.js',
     '../../../mailnews/test/fakeserver/maild.js',
     '../../../mailnews/test/fakeserver/nntpd.js',
     '../../../mailnews/test/fakeserver/pop3d.js',
     '../../../mailnews/test/fakeserver/smtpd.js',
 ]
rename from mail/test/resources/mozmill/mozmill/extension/content/stdlib/EventUtils.jsm
rename to mail/test/browser/shared-modules/EventUtils.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/stdlib/arrays.jsm
rename to mail/test/browser/shared-modules/arrays.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/modules/controller.jsm
rename to mail/test/browser/shared-modules/controller.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/stdlib/dom.jsm
rename to mail/test/browser/shared-modules/dom.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/modules/elementslib.jsm
rename to mail/test/browser/shared-modules/elementslib.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/modules/events.jsm
rename to mail/test/browser/shared-modules/events.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/modules/frame.jsm
rename to mail/test/browser/shared-modules/frame.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/stdlib/httpd.jsm
rename to mail/test/browser/shared-modules/httpd.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/modules/init.jsm
rename to mail/test/browser/shared-modules/init.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/modules/jum.jsm
rename to mail/test/browser/shared-modules/jum.jsm
--- a/mail/test/browser/shared-modules/moz.build
+++ b/mail/test/browser/shared-modules/moz.build
@@ -1,30 +1,45 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 TESTING_JS_MODULES.mozmill += [
     'AccountManagerHelpers.jsm',
     'AddressBookHelpers.jsm',
+    'arrays.jsm',
     'AttachmentHelpers.jsm',
     'CloudfileHelpers.jsm',
     'ComposeHelpers.jsm',
     'ContentTabHelpers.jsm',
+    'controller.jsm',
     'CustomizationHelpers.jsm',
+    'dom.jsm',
     'DOMHelpers.jsm',
+    'elementslib.jsm',
+    'events.jsm',
+    'EventUtils.jsm',
     'FolderDisplayHelpers.jsm',
+    'frame.jsm',
+    'httpd.jsm',
+    'init.jsm',
+    'jum.jsm',
     'JunkHelpers.jsm',
     'KeyboardHelpers.jsm',
     'MessageHelpers.jsm',
     'MockObjectHelpers.jsm',
     'MouseEventHelpers.jsm',
+    'mozmill.jsm',
     'NewMailAccountHelpers.jsm',
     'NNTPHelpers.jsm',
     'NotificationBoxHelpers.jsm',
+    'os.jsm',
     'PrefTabHelpers.jsm',
     'PromptHelpers.jsm',
     'QuickFilterBarHelpers.jsm',
     'SearchWindowHelpers.jsm',
+    'securable-module.jsm',
+    'strings.jsm',
     'SubscribeWindowHelpers.jsm',
+    'utils.jsm',
     'WindowHelpers.jsm',
 ]
rename from mail/test/resources/mozmill/mozmill/extension/content/modules/mozmill.jsm
rename to mail/test/browser/shared-modules/mozmill.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/stdlib/os.jsm
rename to mail/test/browser/shared-modules/os.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/stdlib/securable-module.jsm
rename to mail/test/browser/shared-modules/securable-module.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/stdlib/strings.jsm
rename to mail/test/browser/shared-modules/strings.jsm
rename from mail/test/resources/mozmill/mozmill/extension/content/modules/utils.jsm
rename to mail/test/browser/shared-modules/utils.jsm
deleted file mode 100644
--- a/mail/test/mozmill/.eslintrc.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-module.exports = {
-  globals: {
-    __file__: true,
-    collector: true,
-    elementslib: true,
-    mozmill: true,
-  },
-  rules: {
-    "func-names": "off",
-  },
-};
deleted file mode 100644
--- a/mail/test/mozmill/Makefile.in
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# 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/.
-
-include $(moztopsrcdir)/config/rules.mk
-
-# We're installing to _tests/mozmill
-_DEST_DIR = $(DEPTH)/_tests/mozmill
-
-$(_DEST_DIR):
-	$(NSINSTALL) -D $@
-
-
-# Copy MozMill and its dependencies over, and set up a virtualenv. The
-# virtualenv directory is outside because we don't want to bundle it up during
-# stage-package.
-VIRTUALENV_DIR = $(topobjdir)/_virtualenvs/init
-mozmill-virtualenv: $(_DEST_DIR)
-	unset MACOSX_DEPLOYMENT_TARGET && \
-	$(PYTHON) $(_DEST_DIR)/resources/installmozmill.py $(VIRTUALENV_DIR)
-
-ifndef MOZ_AUTOMATION
-# We don't run mozmill tests as part of the build in automation, so skip
-# creating a virtualenv for them.
-libs:: mozmill-virtualenv
-endif
-
-PKG_STAGE = $(DIST)/test-stage
-
-stage-package:
-	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/
-	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/fakeserver
-	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/resources
-	@(cd $(commtopsrcdir)/mail/test/mozmill && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/ && tar -xf -)
-	@(cd $(DEPTH)/_tests/mozmill/fakeserver && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/fakeserver && tar -xf -)
-	@(cd $(DEPTH)/_tests/mozmill/resources && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/resources && tar -xf -)
deleted file mode 100644
--- a/mail/test/mozmill/account/test-ab-whitelist.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/* 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 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 {
-  click_account_tree_row,
-  get_account_tree_row,
-  open_advanced_settings,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var {
-  assert_equals,
-  assert_false,
-  assert_true,
-  FAKE_SERVER_HOSTNAME,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var gOldWhiteList = null;
-var gKeyString = null;
-
-var gAccount = null;
-
-function setupModule(module) {
-  let server = MailServices.accounts.FindServer(
-    "tinderbox",
-    FAKE_SERVER_HOSTNAME,
-    "pop3"
-  );
-  gAccount = MailServices.accounts.FindAccountForServer(server);
-  let serverKey = server.key;
-
-  gKeyString = "mail.server." + serverKey + ".whiteListAbURI";
-  gOldWhiteList = Services.prefs.getCharPref(gKeyString);
-  Services.prefs.setCharPref(gKeyString, "");
-}
-
-function teardownModule(module) {
-  Services.prefs.setCharPref(gKeyString, gOldWhiteList);
-}
-
-/* First, test that when we initially load the account manager, that
- * we're not whitelisting any address books.  Then, we'll check all
- * address books and save.
- */
-function subtest_check_whitelist_init_and_save(amc) {
-  // Ok, the advanced settings window is open.  Let's choose
-  // the junkmail settings.
-  let accountRow = get_account_tree_row(gAccount.key, "am-junk.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  let doc = amc.window.document.getElementById("contentFrame").contentDocument;
-
-  // At this point, we shouldn't have anything checked, but we should have
-  // the two default address books (Personal and Collected) displayed
-  let list = doc.getElementById("whiteListAbURI");
-  assert_equals(
-    2,
-    list.getRowCount(),
-    "There was an unexpected number of address books"
-  );
-
-  // Now we'll check both address books
-  for (let i = 0; i < list.getRowCount(); i++) {
-    let abNode = list.getItemAtIndex(i);
-    amc.click(new elib.Elem(abNode.firstElementChild));
-  }
-
-  // And close the dialog
-  amc.window.document.getElementById("accountManager").acceptDialog();
-}
-
-/* Next, we'll make sure that the address books we checked in
- * subtest_check_whitelist_init_and_save were properly saved.
- * Then, we'll clear the address books and save.
- */
-function subtest_check_whitelist_load_and_clear(amc) {
-  let accountRow = get_account_tree_row(gAccount.key, "am-junk.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  let doc = amc.window.document.getElementById("contentFrame").contentDocument;
-  let list = doc.getElementById("whiteListAbURI");
-  let whiteListURIs = Services.prefs.getCharPref(gKeyString).split(" ");
-
-  for (let i = 0; i < list.getRowCount(); i++) {
-    let abNode = list.getItemAtIndex(i);
-    assert_equals(
-      "true",
-      abNode.firstElementChild.getAttribute("checked"),
-      "Should have been checked"
-    );
-    // Also ensure that the address book URI was properly saved in the
-    // prefs
-    assert_true(whiteListURIs.includes(abNode.getAttribute("value")));
-    // Now un-check that address book
-    amc.click(new elib.Elem(abNode.firstElementChild));
-  }
-
-  // And close the dialog
-  amc.window.document.getElementById("accountManager").acceptDialog();
-}
-
-/* Finally, we'll make sure that the address books we cleared
- * were actually cleared.
- */
-function subtest_check_whitelist_load_cleared(amc) {
-  let accountRow = get_account_tree_row(gAccount.key, "am-junk.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  let doc = amc.window.document.getElementById("contentFrame").contentDocument;
-  let list = doc.getElementById("whiteListAbURI");
-  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) {}
-
-  for (let i = 0; i < list.getRowCount(); i++) {
-    let abNode = list.getItemAtIndex(i);
-    assert_equals(
-      "false",
-      abNode.firstElementChild.getAttribute("checked"),
-      "Should not have been checked"
-    );
-    // Also ensure that the address book URI was properly cleared in the
-    // prefs
-    assert_false(whiteListURIs.includes(abNode.getAttribute("value")));
-  }
-
-  // And close the dialog
-  amc.window.document.getElementById("accountManager").acceptDialog();
-}
-
-function test_address_book_whitelist() {
-  open_advanced_settings(subtest_check_whitelist_init_and_save);
-  open_advanced_settings(subtest_check_whitelist_load_and_clear);
-  open_advanced_settings(subtest_check_whitelist_load_cleared);
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/test-account-actions.js
+++ /dev/null
@@ -1,196 +0,0 @@
-/* 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 {
-  click_account_tree_row,
-  get_account_tree_row,
-  open_advanced_settings,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var {
-  assert_equals,
-  assert_not_equals,
-  assert_true,
-  close_popup,
-  wait_for_popup_to_open,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var imapAccount, nntpAccount, originalAccountCount;
-
-function setupModule(module) {
-  // There may be pre-existing accounts from other tests.
-  originalAccountCount = MailServices.accounts.allServers.length;
-  // There already should be a Local Folders account created.
-  // It is needed for this test.
-  assert_true(MailServices.accounts.localFoldersServer);
-
-  // Create an IMAP server
-  let imapServer = MailServices.accounts
-    .createIncomingServer("nobody", "example.com", "imap")
-    .QueryInterface(Ci.nsIImapIncomingServer);
-
-  let identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox@example.com";
-
-  imapAccount = MailServices.accounts.createAccount();
-  imapAccount.incomingServer = imapServer;
-  imapAccount.addIdentity(identity);
-
-  // Create a NNTP server
-  let nntpServer = MailServices.accounts
-    .createIncomingServer(null, "example.nntp.invalid", "nntp")
-    .QueryInterface(Ci.nsINntpIncomingServer);
-
-  identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox2@example.com";
-
-  nntpAccount = MailServices.accounts.createAccount();
-  nntpAccount.incomingServer = nntpServer;
-  nntpAccount.addIdentity(identity);
-  // Now there should be 2 more accounts.
-  assert_equals(
-    MailServices.accounts.allServers.length,
-    originalAccountCount + 2
-  );
-}
-
-function teardownModule(module) {
-  // Remove our test accounts to leave the profile clean.
-  MailServices.accounts.removeAccount(nntpAccount);
-  MailServices.accounts.removeAccount(imapAccount);
-  // There should be only the original accounts left.
-  assert_equals(MailServices.accounts.allServers.length, originalAccountCount);
-}
-
-/**
- * Check that the account actions for the account are enabled or disabled appropriately.
- *
- * @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
-) {
-  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");
-  assert_not_equals(actionAddMailAccount, undefined);
-  assert_equals(
-    !actionAddMailAccount.getAttribute("disabled"),
-    aIsAddAccountEnabled
-  );
-
-  let actionAddOtherAccount = amc.e("accountActionsAddOtherAccount");
-  assert_not_equals(actionAddOtherAccount, undefined);
-  assert_equals(
-    !actionAddOtherAccount.getAttribute("disabled"),
-    aIsAddAccountEnabled
-  );
-
-  let actionSetDefault = amc.e("accountActionsDropdownSetDefault");
-  assert_not_equals(actionSetDefault, undefined);
-  assert_equals(
-    !actionSetDefault.getAttribute("disabled"),
-    aIsSetAsDefaultEnabled
-  );
-
-  let actionRemove = amc.e("accountActionsDropdownRemove");
-  assert_not_equals(actionRemove, undefined);
-  assert_equals(!actionRemove.getAttribute("disabled"), aIsRemoveEnabled);
-
-  close_popup(amc, amc.eid("accountActionsDropdown"));
-}
-
-function test_account_actions() {
-  // IMAP account: can be default, can be removed.
-  open_advanced_settings(function(amc) {
-    subtest_check_account_actions(amc, imapAccount.key, true, true, true);
-  });
-
-  // NNTP (News) account: can't be default, can be removed.
-  open_advanced_settings(function(amc) {
-    subtest_check_account_actions(amc, nntpAccount.key, false, true, true);
-  });
-
-  // Local Folders account: can't be removed, can't be default.
-  var localFoldersAccount = MailServices.accounts.FindAccountForServer(
-    MailServices.accounts.localFoldersServer
-  );
-  open_advanced_settings(function(amc) {
-    subtest_check_account_actions(
-      amc,
-      localFoldersAccount.key,
-      false,
-      false,
-      true
-    );
-  });
-  // SMTP server row: can't be removed, can't be default.
-  open_advanced_settings(function(amc) {
-    subtest_check_account_actions(amc, null, false, false, true);
-  });
-
-  // on the IMAP account, disable Delete Account menu item
-  let disableItemPref = "mail.disable_button.delete_account";
-
-  // Set the pref on the default branch, otherwise .getBoolPref on it throws.
-  Services.prefs.getDefaultBranch("").setBoolPref(disableItemPref, true);
-  Services.prefs.lockPref(disableItemPref);
-
-  open_advanced_settings(function(amc) {
-    subtest_check_account_actions(amc, imapAccount.key, true, false, true);
-  });
-
-  Services.prefs.unlockPref(disableItemPref);
-  Services.prefs.getDefaultBranch("").deleteBranch(disableItemPref);
-
-  // on the IMAP account, disable Set as Default menu item
-  disableItemPref = "mail.disable_button.set_default_account";
-
-  Services.prefs.getDefaultBranch("").setBoolPref(disableItemPref, true);
-  Services.prefs.lockPref(disableItemPref);
-
-  open_advanced_settings(function(amc) {
-    subtest_check_account_actions(amc, imapAccount.key, false, true, true);
-  });
-
-  Services.prefs.unlockPref(disableItemPref);
-  Services.prefs.getDefaultBranch("").deleteBranch(disableItemPref);
-
-  // on the IMAP account, disable Add new Account menu items
-  disableItemPref = "mail.disable_new_account_addition";
-
-  Services.prefs.getDefaultBranch("").setBoolPref(disableItemPref, true);
-  Services.prefs.lockPref(disableItemPref);
-
-  open_advanced_settings(function(amc) {
-    subtest_check_account_actions(amc, imapAccount.key, true, true, false);
-  });
-
-  Services.prefs.unlockPref(disableItemPref);
-  Services.prefs.getDefaultBranch("").deleteBranch(disableItemPref);
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/test-account-deletion.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/* 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/. */
-
-/**
- * This test checks proper deletion of an account from the Account manager.
- */
-
-"use strict";
-
-var { open_advanced_settings, remove_account } = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var { assert_equals, assert_false, assert_true } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-
-var gPopAccount, gImapAccount, gOriginalAccountCount;
-
-function setupModule(module) {
-  // There may be pre-existing accounts from other tests.
-  gOriginalAccountCount = MailServices.accounts.allServers.length;
-
-  // Create a POP server
-  let popServer = MailServices.accounts
-    .createIncomingServer("nobody", "pop.foo.invalid", "pop3")
-    .QueryInterface(Ci.nsIPop3IncomingServer);
-
-  let identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox@pop.foo.invalid";
-
-  gPopAccount = MailServices.accounts.createAccount();
-  gPopAccount.incomingServer = popServer;
-  gPopAccount.addIdentity(identity);
-
-  // Create an IMAP server
-  let imapServer = MailServices.accounts
-    .createIncomingServer("nobody", "imap.foo.invalid", "imap")
-    .QueryInterface(Ci.nsIImapIncomingServer);
-
-  identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox@imap.foo.invalid";
-
-  gImapAccount = MailServices.accounts.createAccount();
-  gImapAccount.incomingServer = imapServer;
-  gImapAccount.addIdentity(identity);
-
-  assert_equals(
-    MailServices.accounts.allServers.length,
-    gOriginalAccountCount + 2
-  );
-}
-
-function teardownModule(module) {
-  // There should be only the original accounts left.
-  assert_equals(MailServices.accounts.allServers.length, gOriginalAccountCount);
-}
-
-function test_account_data_deletion() {
-  open_advanced_settings(function(amc) {
-    subtest_account_data_deletion1(amc);
-  });
-
-  open_advanced_settings(function(amc) {
-    subtest_account_data_deletion2(amc);
-  });
-}
-
-/**
- * Bug 274452
- * Check if files of an account are preserved.
- *
- * @param amc  The account options controller.
- */
-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());
-
-  remove_account(gPopAccount, amc, true, false);
-  gPopAccount = null;
-  assert_true(accountDir.exists());
-}
-
-/**
- * Bug 274452
- * Check if files of an account can be deleted.
- *
- * @param amc  The account options controller.
- */
-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());
-
-  remove_account(gImapAccount, amc, true, true);
-  gImapAccount = null;
-  assert_false(accountDir.exists());
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/test-account-port-setting.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/* 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"
-);
-
-var {
-  click_account_tree_row,
-  get_account_tree_row,
-  open_advanced_settings,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var { FAKE_SERVER_HOSTNAME, mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { input_value, delete_all_existing } = ChromeUtils.import(
-  "resource://testing-common/mozmill/KeyboardHelpers.jsm"
-);
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.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.
-];
-
-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.FindServer(
-    "tinderbox",
-    FAKE_SERVER_HOSTNAME,
-    "pop3"
-  );
-  let account = MailServices.accounts.FindAccountForServer(server);
-
-  let accountRow = get_account_tree_row(account.key, "am-server.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  let iframe = amc.window.document.getElementById("contentFrame");
-  let portElem = iframe.contentDocument.getElementById("server.port");
-  portElem.focus();
-
-  if (portElem.value != PORT_NUMBERS_TO_TEST[gTestNumber - 1]) {
-    throw new Error(
-      "Port Value is not " +
-        PORT_NUMBERS_TO_TEST[gTestNumber - 1] +
-        " as expected, it is: " +
-        portElem.value
-    );
-  }
-
-  if (!aDontSet) {
-    delete_all_existing(amc, new elib.Elem(portElem));
-    input_value(amc, PORT_NUMBERS_TO_TEST[gTestNumber]);
-
-    mc.sleep(0);
-  }
-
-  mc.click(
-    new elib.Elem(
-      amc.window.document.getElementById("accountManager").getButton("accept")
-    )
-  );
-}
-
-function subtest_check_port_number(amc) {
-  subtest_check_set_port_number(amc, true);
-}
-
-function test_account_port_setting() {
-  for (
-    gTestNumber = 1;
-    gTestNumber < PORT_NUMBERS_TO_TEST.length;
-    ++gTestNumber
-  ) {
-    open_advanced_settings(subtest_check_set_port_number);
-  }
-
-  open_advanced_settings(subtest_check_port_number);
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/test-account-settings-infrastructure.js
+++ /dev/null
@@ -1,461 +0,0 @@
-/* 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/. */
-
-/**
- * This test checks proper operation of the account settings panes infrastructure
- * 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";
-
-var elib = ChromeUtils.import(
-  "chrome://mozmill/content/modules/elementslib.jsm"
-);
-
-var {
-  click_account_tree_row,
-  get_account_tree_row,
-  open_advanced_settings,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var {
-  assert_equals,
-  assert_false,
-  assert_true,
-  FAKE_SERVER_HOSTNAME,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var gPopAccount, gImapAccount, gOriginalAccountCount;
-
-function setupModule(module) {
-  // There may be pre-existing accounts from other tests.
-  gOriginalAccountCount = MailServices.accounts.allServers.length;
-
-  // Create a POP server
-  let popServer = MailServices.accounts
-    .createIncomingServer("nobody", "pop.invalid", "pop3")
-    .QueryInterface(Ci.nsIPop3IncomingServer);
-
-  let identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox@pop.invalid";
-
-  gPopAccount = MailServices.accounts.createAccount();
-  gPopAccount.incomingServer = popServer;
-  gPopAccount.addIdentity(identity);
-
-  // Create an IMAP server
-  let imapServer = MailServices.accounts
-    .createIncomingServer("nobody", "imap.invalid", "imap")
-    .QueryInterface(Ci.nsIImapIncomingServer);
-
-  identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox@imap.invalid";
-
-  gImapAccount = MailServices.accounts.createAccount();
-  gImapAccount.incomingServer = imapServer;
-  gImapAccount.addIdentity(identity);
-
-  // Now there should be one more account.
-  assert_equals(
-    MailServices.accounts.allServers.length,
-    gOriginalAccountCount + 2
-  );
-}
-
-function teardownModule(module) {
-  // Remove our test accounts to leave the profile clean.
-  MailServices.accounts.removeAccount(gPopAccount);
-  MailServices.accounts.removeAccount(gImapAccount);
-
-  // There should be only the original accounts left.
-  assert_equals(MailServices.accounts.allServers.length, gOriginalAccountCount);
-}
-
-/**
- * Bug 525024.
- * Check that the options in the server pane are properly preserved across
- * pane switches.
- */
-function test_account_dot_IDs() {
-  open_advanced_settings(function(amc) {
-    subtest_check_account_dot_IDs(amc);
-  });
-}
-
-/**
- * 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) {
-  let accountRow = get_account_tree_row(
-    gPopAccount.key,
-    "am-server.xhtml",
-    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);
-  amc.check(new elib.Elem(loginCheck), true);
-
-  accountRow = get_account_tree_row(gPopAccount.key, "am-junk.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  accountRow = get_account_tree_row(gPopAccount.key, "am-server.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  // Re-assign iframe.contentDocument because it was lost when changing panes
-  // (uses loadURI to load a new document).
-  iframe = amc.e("contentFrame").contentDocument;
-
-  // Check by element properties.
-  loginCheck = iframe.getElementById("server.loginAtStartUp");
-  assert_true(loginCheck.checked);
-
-  // Check for correct value in the accountValues array, that will be saved into prefs.
-  let rawCheckValue = amc.window.getAccountValue(
-    gPopAccount,
-    amc.window.getValueArrayFor(gPopAccount),
-    "server",
-    "loginAtStartUp",
-    null,
-    false
-  );
-
-  assert_true(rawCheckValue);
-
-  // The "server.login.At.StartUp" value does not exist yet, so the value should be 'null'.
-  rawCheckValue = amc.window.getAccountValue(
-    gPopAccount,
-    amc.window.getValueArrayFor(gPopAccount),
-    "server",
-    "login.At.StartUp",
-    null,
-    false
-  );
-  assert_equals(rawCheckValue, null);
-
-  // Change the ID so that "server.login.At.StartUp" exists now.
-  loginCheck.id = "server.login.At.StartUp";
-
-  accountRow = get_account_tree_row(gPopAccount.key, "am-junk.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  accountRow = get_account_tree_row(gPopAccount.key, "am-server.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  // Check for correct value in the accountValues array, that will be saved into prefs.
-  // We can't check by element property here, because the am-server.xhtml pane was
-  // reloaded and the element now has the original ID of "server.loginAtStartUp".
-  rawCheckValue = amc.window.getAccountValue(
-    gPopAccount,
-    amc.window.getValueArrayFor(gPopAccount),
-    "server",
-    "login.At.StartUp",
-    null,
-    false
-  );
-
-  assert_true(rawCheckValue);
-}
-
-/**
- * Test for bug 807101.
- * Check if form controls are properly disabled when their attached prefs are locked.
- */
-function test_account_locked_prefs() {
-  open_advanced_settings(function(amc) {
-    subtest_check_locked_prefs_addressing(amc);
-  });
-
-  open_advanced_settings(function(amc) {
-    subtest_check_locked_prefs_server(amc);
-  });
-}
-
-/**
- * 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) {
-  let accountRow = get_account_tree_row(
-    gPopAccount.key,
-    "am-addressing.xhtml",
-    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");
-  assert_false(useLDAPdirectory.selected);
-
-  // So the server selector is disabled.
-  let LDAPdirectory = iframe.getElementById("identity.directoryServer");
-  assert_true(LDAPdirectory.disabled);
-
-  // And the Edit button too.
-  let LDAPeditButton = iframe.getElementById("editButton");
-  assert_true(LDAPeditButton.disabled);
-
-  // Now toggle the 'different LDAP server' on. The server selector
-  // and edit button should enable.
-  amc.radio(new elib.Elem(useLDAPdirectory));
-  assert_false(LDAPdirectory.disabled);
-  assert_false(LDAPeditButton.disabled);
-
-  // Lock the pref for the server selector.
-  let prefstring = LDAPdirectory.getAttribute("prefstring");
-  let controlPref = prefstring.replace(
-    "%identitykey%",
-    gPopAccount.defaultIdentity.key
-  );
-  Services.prefs.getDefaultBranch("").setBoolPref(controlPref, "xxx");
-  Services.prefs.lockPref(controlPref);
-
-  // Refresh the pane by switching to another one.
-  accountRow = get_account_tree_row(gPopAccount.key, "am-junk.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  accountRow = get_account_tree_row(
-    gPopAccount.key,
-    "am-addressing.xhtml",
-    amc
-  );
-  click_account_tree_row(amc, accountRow);
-
-  // Re-assign iframe.contentDocument because it was lost when changing panes
-  // (uses loadURI to load a new document).
-  iframe = amc.e("contentFrame").contentDocument;
-
-  // We are now back and the 'different LDAP server' should still be selected
-  // (the setting was saved).
-  useLDAPdirectory = iframe.getElementById("directories");
-  assert_true(useLDAPdirectory.selected);
-
-  // But now the server selector should be disabled due to locked pref.
-  LDAPdirectory = iframe.getElementById("identity.directoryServer");
-  assert_true(LDAPdirectory.disabled);
-
-  // The edit button still enabled (does not depend on the same pref lock)
-  LDAPeditButton = iframe.getElementById("editButton");
-  assert_false(LDAPeditButton.disabled);
-
-  // Unlock the pref to clean up.
-  Services.prefs.unlockPref(controlPref);
-  Services.prefs.getDefaultBranch("").deleteBranch(controlPref);
-}
-
-/**
- * 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) {
-  let accountRow = get_account_tree_row(
-    gPopAccount.key,
-    "am-server.xhtml",
-    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);
-  assert_false(leaveOnServer.checked);
-
-  // Second level deleteByAge checkbox, disabled by default.
-  let deleteByAge = iframe.getElementById("pop3.deleteByAgeFromServer");
-  assert_true(deleteByAge.disabled);
-  assert_false(deleteByAge.checked);
-
-  // Third level daysToLeave textbox, disabled by default.
-  let daysToLeave = iframe.getElementById("pop3.numDaysToLeaveOnServer");
-  assert_true(daysToLeave.disabled);
-
-  // When leaveOnServer is checked, only deleteByAge will get enabled.
-  amc.check(new elib.Elem(leaveOnServer), true);
-  assert_true(leaveOnServer.checked);
-  assert_false(deleteByAge.disabled);
-  assert_true(daysToLeave.disabled);
-
-  // When deleteByAge is checked, daysToLeave will get enabled.
-  amc.check(new elib.Elem(deleteByAge), true);
-  assert_true(deleteByAge.checked);
-  assert_false(daysToLeave.disabled);
-
-  // Lock the pref deleteByAge checkbox (middle of the element hierarchy).
-  let prefstring = deleteByAge.getAttribute("prefstring");
-  let controlPref = prefstring.replace(
-    "%serverkey%",
-    gPopAccount.incomingServer.key
-  );
-  Services.prefs.getDefaultBranch("").setBoolPref(controlPref, true);
-  Services.prefs.lockPref(controlPref);
-
-  // Refresh the pane by switching to another one.
-  accountRow = get_account_tree_row(gPopAccount.key, "am-junk.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  accountRow = get_account_tree_row(gPopAccount.key, "am-server.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  // Re-assign iframe.contentDocument because it was lost when changing panes
-  // (uses loadURI to load a new document).
-  iframe = amc.e("contentFrame").contentDocument;
-
-  // Now leaveOnServer was preserved as checked.
-  leaveOnServer = iframe.getElementById("pop3.leaveMessagesOnServer");
-  assert_false(leaveOnServer.disabled);
-  assert_true(leaveOnServer.checked);
-
-  // Now deleteByAge was preserved as checked but is locked/disabled.
-  deleteByAge = iframe.getElementById("pop3.deleteByAgeFromServer");
-  assert_true(deleteByAge.disabled);
-  assert_true(deleteByAge.checked);
-
-  // Because deleteByAge is checked, daysToLeave should be enabled.
-  daysToLeave = iframe.getElementById("pop3.numDaysToLeaveOnServer");
-  assert_false(daysToLeave.disabled);
-
-  // When leaveOnserver is unchecked, both of deleteByAge and daysToLeave
-  // should get disabled.
-  amc.check(new elib.Elem(leaveOnServer), false);
-  assert_false(leaveOnServer.disabled);
-  assert_false(leaveOnServer.checked);
-
-  assert_true(deleteByAge.disabled);
-  assert_true(deleteByAge.checked);
-  assert_true(daysToLeave.disabled);
-
-  // Unlock the pref to clean up.
-  Services.prefs.unlockPref(controlPref);
-  Services.prefs.getDefaultBranch("").deleteBranch(controlPref);
-}
-
-/**
- * Bug 530142.
- * Check that that if one field is set to a value, switching directly to another
- * account pane showing the same field really loads the value from the new account,
- * even when empty. This is tested on the Reply-To field.
- */
-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) {
-  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, "");
-
-  // Now we set a value into it and switch to another account, the main pane.
-  replyAddress.value = "somewhere@else.com";
-
-  // This test expects the following POP account to exist by default
-  // in the test profile with port number 110 and no security.
-  let firstServer = MailServices.accounts.FindServer(
-    "tinderbox",
-    FAKE_SERVER_HOSTNAME,
-    "pop3"
-  );
-  let firstAccount = MailServices.accounts.FindAccountForServer(firstServer);
-
-  accountRow = get_account_tree_row(firstAccount.key, null, amc);
-  click_account_tree_row(amc, accountRow);
-
-  // the Reply-To field should be empty as this account does not have it set.
-  replyAddress = iframe.contentDocument.getElementById("identity.replyTo");
-  assert_equals(replyAddress.value, "");
-}
-
-/**
- * Test for bug 804091.
- * Check if onchange handlers are properly executed when panes are switched.
- */
-function test_account_onchange_handler() {
-  open_advanced_settings(function(amc) {
-    subtest_check_onchange_handler(amc);
-  });
-}
-
-/**
- * Check if onchange handlers are properly executed when panes are switched.
- *
- * @param amc  the account options controller
- */
-function subtest_check_onchange_handler(amc) {
-  let accountRow = get_account_tree_row(
-    gImapAccount.key,
-    "am-offline.xhtml",
-    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);
-
-  let autoSyncInterval = iframe.getElementById("autosyncInterval");
-  // 1 is the default value and means the 30 is in days.
-  assert_equals(autoSyncInterval.value, 1);
-
-  // Now type in 35 (days).
-  amc.radio(new elib.ID(iframe, "useAutosync.ByAge"));
-  autoSync.select();
-  amc.type(new elib.Elem(autoSync), "35");
-
-  // Immediately switch to another pane and back.
-  accountRow = get_account_tree_row(gImapAccount.key, "am-junk.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  accountRow = get_account_tree_row(gImapAccount.key, "am-offline.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  iframe = amc.e("contentFrame").contentDocument;
-
-  // The pane optimized the entered value a bit. So now we should find 5.
-  autoSync = iframe.getElementById("autosyncValue");
-  assert_equals(autoSync.value, 5);
-
-  // And the unit is 7 days = week.
-  autoSyncInterval = iframe.getElementById("autosyncInterval");
-  assert_equals(autoSyncInterval.value, 7);
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/test-account-tree.js
+++ /dev/null
@@ -1,202 +0,0 @@
-/* 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/. */
-
-/**
- * This test checks proper operation of the account tree in the Account manager.
- */
-
-"use strict";
-
-var {
-  click_account_tree_row,
-  get_account_tree_row,
-  open_advanced_settings,
-  remove_account,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var { assert_equals, assert_false, assert_true } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-
-var gPopAccount, gOriginalAccountCount;
-
-function setupModule(module) {
-  // There may be pre-existing accounts from other tests.
-  gOriginalAccountCount = MailServices.accounts.allServers.length;
-
-  // Create a POP server
-  let popServer = MailServices.accounts
-    .createIncomingServer("nobody", "foo.invalid", "pop3")
-    .QueryInterface(Ci.nsIPop3IncomingServer);
-
-  let identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox@foo.invalid";
-
-  gPopAccount = MailServices.accounts.createAccount();
-  gPopAccount.incomingServer = popServer;
-  gPopAccount.addIdentity(identity);
-
-  // Now there should be one more account.
-  assert_equals(
-    MailServices.accounts.allServers.length,
-    gOriginalAccountCount + 1
-  );
-}
-
-function teardownModule(module) {
-  if (gPopAccount) {
-    // Remove our test account to leave the profile clean.
-    MailServices.accounts.removeAccount(gPopAccount);
-    gPopAccount = null;
-  }
-  // There should be only the original accounts left.
-  assert_equals(MailServices.accounts.allServers.length, gOriginalAccountCount);
-}
-
-/**
- * Test for bug 536248.
- * Check if the account manager dialog remembers the open state of accounts.
- */
-function test_account_open_state() {
-  open_advanced_settings(function(amc) {
-    subtest_check_account_open_state(amc, true);
-  });
-  open_advanced_settings(function(amc) {
-    subtest_check_account_open_state(amc, false);
-  });
-  // After this test all the accounts must be "open".
-}
-
-/**
- * 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) {
-  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);
-
-  accountTree.view.toggleOpenState(accountRow);
-  assert_equals(accountTree.view.isContainerOpen(accountRow), !aWishedState);
-
-  // Whatever the open state of the account was, selecting one of its subpanes
-  // must open it.
-  amc.window.selectServer(gPopAccount.incomingServer, "am-junk.xhtml");
-  assert_true(accountTree.view.isContainerOpen(accountRow));
-
-  // Set the proper state again for continuation of the test.
-  accountTree.view
-    .getItemAtIndex(accountRow)
-    .setAttribute("open", !aWishedState);
-  assert_equals(accountTree.view.isContainerOpen(accountRow), !aWishedState);
-}
-
-/**
- * Bug 740617.
- * Check if the default account is styled in bold.
- *
- */
-function test_default_account_highlight() {
-  open_advanced_settings(function(amc) {
-    subtest_check_default_account_highlight(amc);
-  });
-}
-
-/**
- * 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) {
-  // 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).firstElementChild
-    .firstElementChild;
-  assert_equals(cell.tagName, "treecell");
-
-  // We can't read the computed style of the tree cell directly, so at least see
-  // if the isDefaultServer-true property is set on it. Hopefully the proper style
-  // is attached to this property.
-  let propArray = accountTree.view
-    .getCellProperties(accountRow, accountTree.columns.getColumnAt(0))
-    .split(" ");
-  assert_true(propArray.includes("isDefaultServer-true"));
-
-  // Now select another account that is not default.
-  accountRow = get_account_tree_row(gPopAccount.key, null, amc);
-  click_account_tree_row(amc, accountRow);
-
-  // There should isDefaultServer-true on its tree cell.
-  propArray = accountTree.view
-    .getCellProperties(accountRow, accountTree.columns.getColumnAt(0))
-    .split(" ");
-  assert_false(propArray.includes("isDefaultServer-true"));
-}
-/**
- * Bug 58713.
- * Check if after deleting an account the next one is selected.
- *
- * This test should always be the last one as it removes our specially
- * created gPopAccount.
- */
-function test_selection_after_account_deletion() {
-  open_advanced_settings(function(amc) {
-    subtest_check_selection_after_account_deletion(amc);
-  });
-}
-
-/**
- * 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) {
-  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.children.length; i++) {
-    if ("_account" in accountTreeNode.children[i]) {
-      let curAccount = accountTreeNode.children[i]._account;
-      if (!accountList.includes(curAccount)) {
-        accountList.push(curAccount);
-      }
-    }
-  }
-
-  // Get position of the current account in the account list.
-  let accountIndex = accountList.indexOf(gPopAccount);
-
-  // Remove our account.
-  remove_account(gPopAccount, amc);
-  gPopAccount = null;
-  // Now there should be only the original accounts left.
-  assert_equals(MailServices.accounts.allServers.length, gOriginalAccountCount);
-
-  // See if the currently selected account is the one next in the account list.
-  let accountTree = amc.e("accounttree");
-  let accountRow = accountTree.view.selection.currentIndex;
-  assert_equals(
-    accountTree.view.getItemAtIndex(accountRow)._account,
-    accountList[accountIndex + 1]
-  );
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/test-account-values.js
+++ /dev/null
@@ -1,402 +0,0 @@
-/* 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/. */
-
-/**
- * This test checks proper operation of the account settings panes
- * when certain special or invalid values are entered into the fields.
- */
-
-"use strict";
-
-var elib = ChromeUtils.import(
-  "chrome://mozmill/content/modules/elementslib.jsm"
-);
-
-var {
-  click_account_tree_row,
-  get_account_tree_row,
-  open_advanced_settings,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var { assert_equals, assert_false } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { input_value, delete_all_existing } = ChromeUtils.import(
-  "resource://testing-common/mozmill/KeyboardHelpers.jsm"
-);
-var { plan_for_modal_dialog, wait_for_modal_dialog } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var gPopAccount, gOriginalAccountCount;
-
-function setupModule(module) {
-  // There may be pre-existing accounts from other tests.
-  gOriginalAccountCount = MailServices.accounts.allServers.length;
-
-  // Create a POP server
-  let popServer = MailServices.accounts
-    .createIncomingServer("nobody", "example.invalid", "pop3")
-    .QueryInterface(Ci.nsIPop3IncomingServer);
-
-  let identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox@example.invalid";
-
-  gPopAccount = MailServices.accounts.createAccount();
-  gPopAccount.incomingServer = popServer;
-  gPopAccount.addIdentity(identity);
-
-  // Now there should be one more account.
-  assert_equals(
-    MailServices.accounts.allServers.length,
-    gOriginalAccountCount + 1
-  );
-}
-
-function teardownModule(module) {
-  // Remove our test account to leave the profile clean.
-  MailServices.accounts.removeAccount(gPopAccount);
-  // There should be only the original accounts left.
-  assert_equals(MailServices.accounts.allServers.length, gOriginalAccountCount);
-}
-
-/**
- * Bug 208628.
- * Check that if the CC field is empty, enabling CC will automatically
- * prefill the currently default email address.
- */
-function test_default_CC_address() {
-  open_advanced_settings(function(amc) {
-    subtest_check_default_CC_address(amc);
-  });
-}
-
-/**
- * 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) {
-  let accountRow = get_account_tree_row(
-    gPopAccount.key,
-    "am-copies.xhtml",
-    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");
-  // The CC checkbox is not enabled and the address value is empty.
-  assert_false(ccCheck.checked);
-  assert_equals(ccAddress.value, "");
-  // After ticking the CC checkbox the default address should be prefilled.
-  amc.check(new elib.Elem(ccCheck), true);
-  assert_equals(ccAddress.value, defaultAddress);
-
-  let bccCheck = iframe.contentDocument.getElementById("identity.doBcc");
-  let bccAddress = iframe.contentDocument.getElementById("identity.doBccList");
-  // The BCC checkbox is not enabled but we set the address value to something.
-  assert_false(bccCheck.checked);
-  assert_equals(bccAddress.value, "");
-  let bccUserAddress = "somebody@else.invalid";
-  bccAddress.value = bccUserAddress;
-  // After ticking the BCC checkbox the current value of the address should not change.
-  amc.check(new elib.Elem(bccCheck), true);
-  assert_equals(bccAddress.value, bccUserAddress);
-}
-
-/**
- * Bug 720199.
- * Check if the account name automatically changes when the user changes
- * the username or hostname.
- */
-function test_account_name() {
-  // We already have a POP account ready.
-  // Create also a NNTP server.
-  let nntpServer = MailServices.accounts
-    .createIncomingServer(null, "example.nntp.invalid", "nntp")
-    .QueryInterface(Ci.nsINntpIncomingServer);
-
-  let identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox2@example.invalid";
-
-  let nntpAccount = MailServices.accounts.createAccount();
-  nntpAccount.incomingServer = nntpServer;
-  nntpAccount.addIdentity(identity);
-
-  assert_equals(
-    gPopAccount.incomingServer.prettyName,
-    "nobody on example.invalid"
-  );
-  assert_equals(nntpAccount.incomingServer.prettyName, "example.nntp.invalid");
-
-  // The automatic account name update works only if the name is
-  // in the form of user@host.
-  gPopAccount.incomingServer.prettyName = "nobody@example.invalid";
-
-  let newHost = "some.host.invalid";
-  let newUser = "somebody";
-
-  // On NNTP there is no user name so just set new hostname.
-  open_advanced_settings(function(amc) {
-    subtest_check_account_name(nntpAccount, newHost, null, amc);
-  });
-
-  // And see if the account name is updated to it.
-  assert_equals(nntpAccount.incomingServer.prettyName, newHost);
-
-  // On POP3 there is both user name and host name.
-  // Set new host name first.
-  open_advanced_settings(function(amc) {
-    subtest_check_account_name(gPopAccount, newHost, null, amc);
-  });
-
-  // And see if in the account name the host part is updated to it.
-  assert_equals(gPopAccount.incomingServer.prettyName, "nobody@" + newHost);
-
-  // Set new host name first.
-  open_advanced_settings(function(amc) {
-    subtest_check_account_name(gPopAccount, null, newUser, amc);
-  });
-
-  // And see if in the account name the user part is updated.
-  assert_equals(gPopAccount.incomingServer.prettyName, newUser + "@" + newHost);
-
-  newHost = "another.host.invalid";
-  newUser = "anotherbody";
-
-  // Set user name and host name at once.
-  open_advanced_settings(function(amc) {
-    subtest_check_account_name(gPopAccount, newHost, newUser, amc);
-  });
-
-  // And see if in the account name the host part is updated to it.
-  assert_equals(gPopAccount.incomingServer.prettyName, newUser + "@" + newHost);
-
-  // Now have an account name where the name does not match the hostname.
-  gPopAccount.incomingServer.prettyName = newUser + "@example.invalid";
-
-  newHost = "third.host.invalid";
-  // Set the host name again.
-  open_advanced_settings(function(amc) {
-    subtest_check_account_name(gPopAccount, newHost, null, amc);
-  });
-
-  // And the account name should not be touched.
-  assert_equals(
-    gPopAccount.incomingServer.prettyName,
-    newUser + "@example.invalid"
-  );
-
-  MailServices.accounts.removeAccount(nntpAccount);
-}
-
-/**
- * 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) {
-  let accountRow = get_account_tree_row(aAccount.key, "am-server.xhtml", 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);
-
-    // Now change the server host name.
-    hostname.value = aNewHostname;
-  }
-
-  if (aNewUsername) {
-    let username = iframe.contentDocument.getElementById("server.realUsername");
-    assert_equals(username.value, aAccount.incomingServer.realUsername);
-
-    // Now change the server user name.
-    username.value = aNewUsername;
-  }
-
-  if (aNewUsername) {
-    // If username has changed, we get a confirmation dialog.
-    plan_for_modal_dialog("commonDialogWindow", function(cdc) {
-      // Just dismiss it.
-      cdc.window.document.documentElement
-        .querySelector("dialog")
-        .acceptDialog();
-    });
-  }
-  // We really need to save the new values so click OK on the Account settings.
-  amc.window.document.documentElement.querySelector("dialog").acceptDialog();
-  if (aNewUsername) {
-    wait_for_modal_dialog("commonDialogWindow");
-  }
-}
-
-/**
- * Bug 536768.
- * Check if invalid junk target settings (folders) are fixed to sane values.
- */
-function test_invalid_junk_target() {
-  // Set the junk target prefs to invalid values.
-  let branch = Services.prefs.getBranch(
-    "mail.server." + gPopAccount.incomingServer.key + "."
-  );
-  branch.setCharPref("spamActionTargetAccount", "some random non-existent URI");
-  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.
-  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) {
-  let accountRow = get_account_tree_row(gPopAccount.key, "am-junk.xhtml", 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.querySelector("dialog").acceptDialog();
-}
-
-/**
- * Bug 327812.
- * Checks if invalid server hostnames are not accepted.
- */
-function test_invalid_hostname() {
-  let branch = Services.prefs.getBranch(
-    "mail.server." + gPopAccount.incomingServer.key + "."
-  );
-  let origHostname = branch.getCharPref("realhostname");
-
-  open_advanced_settings(function(amc) {
-    subtest_check_invalid_hostname(amc, false, origHostname);
-  });
-  open_advanced_settings(function(amc) {
-    subtest_check_invalid_hostname(amc, true, origHostname);
-  });
-
-  // The new bad hostname should not have been saved.
-  let newHostname = branch.getCharPref("realhostname");
-  assert_equals(origHostname, newHostname);
-}
-
-/**
- * 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) {
-  let accountRow = get_account_tree_row(
-    gPopAccount.key,
-    "am-server.xhtml",
-    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";
-
-  if (!aExitSettings) {
-    accountRow = get_account_tree_row(gPopAccount.key, "am-junk.xhtml", amc);
-    click_account_tree_row(amc, accountRow);
-
-    // The invalid hostname should be set back to previous value at this point...
-    accountRow = get_account_tree_row(gPopAccount.key, "am-server.xhtml", amc);
-    click_account_tree_row(amc, accountRow);
-
-    // ...let's check that:
-    iframe = amc.window.document.getElementById("contentFrame");
-    hostname = iframe.contentDocument.getElementById("server.realHostName");
-    assert_equals(hostname.value, aOriginalHostname);
-  } else {
-    // If the hostname is bad, we should get a warning dialog.
-    plan_for_modal_dialog("commonDialogWindow", function(cdc) {
-      // Just dismiss it.
-      cdc.window.document.documentElement
-        .querySelector("dialog")
-        .acceptDialog();
-    });
-
-    // Click OK on the Account settings.
-    amc.window.document.documentElement.querySelector("dialog").acceptDialog();
-
-    wait_for_modal_dialog("commonDialogWindow");
-  }
-}
-
-/**
- * Bug 1426328.
- * Check that the AM will trim user added spaces around text values.
- */
-const badName = "trailing  space ";
-const badEmail = " leading_space@example.com";
-
-function test_trailing_spaces() {
-  open_advanced_settings(function(amc) {
-    subtest_check_trailing_spaces(amc);
-  });
-  assert_equals(gPopAccount.incomingServer.prettyName, badName.trim());
-  assert_equals(gPopAccount.defaultIdentity.email, badEmail.trim());
-}
-
-/**
- * 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) {
-  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));
-  delete_all_existing(amc, new elib.Elem(defaultAddress));
-  input_value(amc, badName, new elib.Elem(accountName));
-  input_value(amc, badEmail, new elib.Elem(defaultAddress));
-
-  assert_equals(accountName.value, badName);
-  assert_equals(defaultAddress.value, badEmail);
-
-  // We really need to save the new values so click OK on the Account settings.
-  amc.window.document.documentElement.querySelector("dialog").acceptDialog();
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/test-archive-options.js
+++ /dev/null
@@ -1,209 +0,0 @@
-/* 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 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 utils = ChromeUtils.import("chrome://mozmill/content/modules/utils.jsm");
-
-var {
-  click_account_tree_row,
-  get_account_tree_row,
-  open_advanced_settings,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var { assert_equals, assert_false, assert_true, mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var {
-  plan_for_modal_dialog,
-  plan_for_window_close,
-  wait_for_modal_dialog,
-  wait_for_window_close,
-} = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-
-var defaultIdentity;
-
-function setupModule(module) {
-  defaultIdentity = MailServices.accounts.defaultAccount.defaultIdentity;
-}
-
-/**
- * Check that the archive options button is enabled or disabled appropriately.
- *
- * @param amc          the account options controller
- * @param aAccountKey  key of the account the check
- * @param isEnabled    true if the button should be enabled, false otherwise
- */
-function subtest_check_archive_options_enabled(amc, aAccountKey, isEnabled) {
-  let accountRow = get_account_tree_row(aAccountKey, "am-copies.xhtml", amc);
-  click_account_tree_row(amc, accountRow);
-
-  let iframe = amc.window.document.getElementById("contentFrame");
-  let button = iframe.contentDocument.getElementById("archiveHierarchyButton");
-
-  assert_equals(button.disabled, !isEnabled);
-}
-
-function test_archive_options_enabled() {
-  let defaultAccount = MailServices.accounts.defaultAccount;
-  // First, create an IMAP server
-  let imapServer = MailServices.accounts
-    .createIncomingServer("nobody", "example.com", "imap")
-    .QueryInterface(Ci.nsIImapIncomingServer);
-
-  let identity = MailServices.accounts.createIdentity();
-  identity.email = "tinderbox@example.com";
-
-  let account = MailServices.accounts.createAccount();
-  account.incomingServer = imapServer;
-  account.addIdentity(identity);
-
-  // Then test that the archive options button is enabled/disabled appropriately
-
-  // Let the default identity archive to our IMAP folder, to ensure that the
-  // archive folder's server is used to determine the enabled/disabled state
-  // of the "archive options" button, *not* the incoming server for that
-  // identity.
-  defaultIdentity.archiveFolder = imapServer.rootFolder.URI;
-
-  imapServer.isGMailServer = false;
-  open_advanced_settings(function(amc) {
-    subtest_check_archive_options_enabled(amc, account.key, true);
-  });
-  open_advanced_settings(function(amc) {
-    subtest_check_archive_options_enabled(amc, defaultAccount.key, true);
-  });
-
-  imapServer.isGMailServer = true;
-  open_advanced_settings(function(amc) {
-    subtest_check_archive_options_enabled(amc, account.key, false);
-  });
-  open_advanced_settings(function(amc) {
-    subtest_check_archive_options_enabled(amc, defaultAccount.key, false);
-  });
-
-  MailServices.accounts.removeAccount(account);
-}
-
-function subtest_initial_state(identity) {
-  plan_for_modal_dialog("Mailnews:archiveOptions", function(ac) {
-    assert_equals(
-      ac.e("archiveGranularity").selectedIndex,
-      identity.archiveGranularity
-    );
-    assert_equals(
-      ac.e("archiveKeepFolderStructure").checked,
-      identity.archiveKeepFolderStructure
-    );
-  });
-  mc.window.openDialog(
-    "chrome://messenger/content/am-archiveoptions.xhtml",
-    "",
-    "centerscreen,chrome,modal,titlebar,resizable=yes",
-    identity
-  );
-  wait_for_modal_dialog("Mailnews:archiveOptions");
-}
-
-function test_open_archive_options() {
-  for (let granularity = 0; granularity < 3; granularity++) {
-    defaultIdentity.archiveGranularity = granularity;
-    for (let kfs = 0; kfs < 2; kfs++) {
-      defaultIdentity.archiveKeepFolderStructure = kfs;
-      subtest_initial_state(defaultIdentity);
-    }
-  }
-}
-
-function subtest_save_state(identity, granularity, kfs) {
-  plan_for_modal_dialog("Mailnews:archiveOptions", function(ac) {
-    ac.e("archiveGranularity").selectedIndex = granularity;
-    ac.e("archiveKeepFolderStructure").checked = kfs;
-    ac.keypress(null, "VK_RETURN", {});
-    ac.window.document.querySelector("dialog").acceptDialog();
-  });
-  mc.window.openDialog(
-    "chrome://messenger/content/am-archiveoptions.xhtml",
-    "",
-    "centerscreen,chrome,modal,titlebar,resizable=yes",
-    identity
-  );
-  wait_for_modal_dialog("Mailnews:archiveOptions");
-}
-
-function test_save_archive_options() {
-  defaultIdentity.archiveGranularity = 0;
-  defaultIdentity.archiveKeepFolderStructure = false;
-  subtest_save_state(defaultIdentity, 1, true);
-
-  assert_equals(defaultIdentity.archiveGranularity, 1);
-  assert_equals(defaultIdentity.archiveKeepFolderStructure, true);
-}
-
-function subtest_check_archive_enabled(amc, archiveEnabled) {
-  defaultIdentity.archiveEnabled = archiveEnabled;
-
-  click_account_tree_row(amc, 2);
-
-  let iframe = amc.window.document.getElementById("contentFrame");
-  let checkbox = iframe.contentDocument.getElementById(
-    "identity.archiveEnabled"
-  );
-
-  assert_equals(checkbox.checked, archiveEnabled);
-}
-
-function test_archive_enabled() {
-  open_advanced_settings(function(amc) {
-    subtest_check_archive_enabled(amc, true);
-  });
-
-  open_advanced_settings(function(amc) {
-    subtest_check_archive_enabled(amc, false);
-  });
-}
-
-function subtest_disable_archive(amc) {
-  defaultIdentity.archiveEnabled = true;
-  click_account_tree_row(amc, 2);
-
-  let iframe = amc.window.document.getElementById("contentFrame");
-  let checkbox = iframe.contentDocument.getElementById(
-    "identity.archiveEnabled"
-  );
-
-  assert_true(checkbox.checked);
-  assert_false(checkbox.disabled);
-  amc.click(new elib.Elem(checkbox));
-  utils.waitFor(
-    () => !checkbox.checked,
-    "Archive checkbox didn't toggle to unchecked"
-  );
-  plan_for_window_close(amc);
-  amc.window.document.getElementById("accountManager").acceptDialog();
-  wait_for_window_close();
-
-  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"];
deleted file mode 100644
--- a/mail/test/mozmill/account/test-mail-account-setup-wizard.js
+++ /dev/null
@@ -1,294 +0,0 @@
-/* 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"
-);
-
-var {
-  open_advanced_settings_from_account_wizard,
-  open_mail_account_setup_wizard,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var { assert_equals, mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { input_value, delete_all_existing } = ChromeUtils.import(
-  "resource://testing-common/mozmill/KeyboardHelpers.jsm"
-);
-var { gMockPromptService } = ChromeUtils.import(
-  "resource://testing-common/mozmill/PromptHelpers.jsm"
-);
-
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-
-var user = {
-  name: "Yamato Nadeshiko",
-  email: "yamato.nadeshiko@example.com",
-  password: "abc12345",
-  incomingHost: "testin.example.com",
-  outgoingHost: "testout.example.com",
-};
-
-// Remove an account in the Account Manager, but not via the UI.
-function remove_account_internal(amc, aAccount, aOutgoing) {
-  let win = amc.window;
-
-  try {
-    // Remove the account and incoming server
-    let serverId = aAccount.incomingServer.serverURI;
-    MailServices.accounts.removeAccount(aAccount);
-    aAccount = null;
-    if (serverId in win.accountArray) {
-      delete win.accountArray[serverId];
-    }
-    win.selectServer(null, null);
-
-    // Remove the outgoing server
-    let smtpKey = aOutgoing.key;
-    MailServices.smtp.deleteServer(aOutgoing);
-    win.replaceWithDefaultSmtpServer(smtpKey);
-  } catch (ex) {
-    throw new Error("failure to remove account: " + ex + "\n");
-  }
-}
-
-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) {
-    // 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.click(awc.eid("next_button"));
-
-    // XXX: This should probably use a notification, once we fix bug 561143.
-    awc.waitFor(
-      () => awc.window.gEmailConfigWizard._currentConfig != null,
-      "Timeout waiting for current config to become non-null",
-      8000,
-      600
-    );
-
-    // Register the prompt service to handle the confirm() dialog
-    gMockPromptService.register();
-    gMockPromptService.returnValue = true;
-
-    // Open the advanced settings (Account Manager) to create the account
-    // immediately.  We use an invalid email/password so the setup will fail
-    // anyway.
-    open_advanced_settings_from_account_wizard(subtest_verify_account, awc);
-
-    let promptState = gMockPromptService.promptState;
-    assert_equals("confirm", promptState.method);
-
-    // Clean up
-    gMockPromptService.unregister();
-    Services.prefs.clearUserPref(pref_name);
-  });
-}
-
-function subtest_verify_account(amc) {
-  amc.waitFor(
-    () => amc.window.currentAccount != null,
-    "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],
-    },
-    "outgoing server username": {
-      actual: outgoing.username,
-      expected: user.email,
-    },
-    "incoming server hostname": {
-      // Note: N in the hostName is uppercase
-      actual: incoming.hostName,
-      expected: user.incomingHost,
-    },
-    "outgoing server hostname": {
-      // And this is lowercase
-      actual: outgoing.hostname,
-      expected: user.outgoingHost,
-    },
-    "user real name": { actual: identity.fullName, expected: user.name },
-    "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 +
-            "."
-        );
-      }
-    }
-  } finally {
-    remove_account_internal(amc, account, outgoing);
-  }
-}
-
-/**
- * Make sure that we don't re-set the information we get from the config
- * file if the password is incorrect.
- */
-function test_bad_password_uses_old_settings() {
-  // Set the pref to load a local autoconfig file, that will fetch the
-  // ../account/xml/example.com which contains the settings for the
-  // @example.com email account (see the 'user' object).
-  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) {
-    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();
-
-      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;
-        },
-        "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,
-        "Outgoing server changed!"
-      );
-      assert_equals(
-        awc.e("incoming_hostname").value,
-        user.incomingHost,
-        "incoming server changed!"
-      );
-    } finally {
-      // Clean up
-      Services.prefs.clearUserPref(pref_name);
-      awc.e("cancel_button").click();
-    }
-  });
-}
-
-function test_remember_password() {
-  remember_password_test(true);
-  remember_password_test(false);
-}
-
-/**
- * Test remember_password checkbox behavior with
- * signon.rememberSignons set to "aPrefValue"
- */
-function remember_password_test(aPrefValue) {
-  // 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) {
-    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 {
-        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
-      );
-    } finally {
-      // close the wizard
-      awc.e("cancel_button").click();
-    }
-  });
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/test-retest-config.js
+++ /dev/null
@@ -1,121 +0,0 @@
-/* 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"
-);
-
-var { open_mail_account_setup_wizard } = ChromeUtils.import(
-  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
-);
-var { assert_true, mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { input_value, delete_all_existing } = ChromeUtils.import(
-  "resource://testing-common/mozmill/KeyboardHelpers.jsm"
-);
-var { close_window } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var user = {
-  name: "test",
-  email: "test@momo.invalid",
-  altEmail: "test2@momo.invalid",
-};
-
-function setupModule(module) {
-  Services.prefs.setCharPref("mail.wizard.logging.dump", "All");
-
-  let url = collector.addHttpResource("../account/xml", "accountconfig");
-  Services.prefs.setCharPref("mailnews.auto_config_url", url);
-  collector.httpd.registerContentType("invalid", "text/xml");
-}
-
-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) {
-    // 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 && !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;
-      },
-      "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", {});
-    awc.e("email").focus();
-    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;
-      },
-      "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.
-    assert_true(
-      awc.e("manual-edit_area").hidden,
-      "We're not back to the original state!"
-    );
-
-    close_window(awc);
-  });
-}
deleted file mode 100644
--- a/mail/test/mozmill/account/xml/example.com
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<clientConfig>
-  <emailProvider id="example.com">
-    <domain>example.com</domain>
-    <displayName>Example</displayName>
-    <displayShortName>Example</displayShortName>
-    <incomingServer type="pop3">
-      <hostname>testin.%EMAILDOMAIN%</hostname>
-      <port>995</port>
-      <socketType>SSL</socketType>
-      <username>%EMAILLOCALPART%</username>
-      <authentication>plain</authentication>
-    </incomingServer>
-    <outgoingServer type="smtp">
-      <hostname>testout.%EMAILDOMAIN%</hostname>
-      <port>587</port>
-      <socketType>STARTTLS</socketType>
-      <username>%EMAILADDRESS%</username>
-      <authentication>plain</authentication>
-      <addThisServer>true</addThisServer>
-      <useGlobalPreferredServer>false</useGlobalPreferredServer>
-    </outgoingServer>
-  </emailProvider>
-</clientConfig>
deleted file mode 100644
--- a/mail/test/mozmill/account/xml/momo.invalid
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<clientConfig version="1.1">
-  <emailProvider id="momo.invalid">
-    <domain>momo.invalid</domain>
-    <displayName>MoMo Mail</displayName>
-    <displayShortName>Yahoo</displayShortName>
-    <incomingServer type="pop3">
-      <hostname>pop.mail.momo.invalid</hostname>
-      <port>995</port>
-      <socketType>SSL</socketType>
-      <username>%EMAILLOCALPART%</username>
-      <authentication>password-cleartext</authentication>
-    </incomingServer>
-    <incomingServer type="imap">
-      <hostname>imap.mail.momo.invalid</hostname>
-      <port>993</port>
-      <socketType>SSL</socketType>
-      <username>%EMAILLOCALPART%</username>
-      <authentication>password-cleartext</authentication>
-    </incomingServer>
-    <outgoingServer type="smtp">
-      <hostname>smtp.mail.momo.invalid</hostname>
-      <port>465</port>
-      <socketType>SSL</socketType>
-      <username>%EMAILLOCALPART%</username>
-      <authentication>password-cleartext</authentication>
-    </outgoingServer>
-  </emailProvider>
-</clientConfig>
deleted file mode 100644
--- a/mail/test/mozmill/addrbook/test-address-book-panes.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/* 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 for the address book.
- */
-
-"use strict";
-
-var {
-  close_address_book_window,
-  open_address_book_window,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
-);
-
-var abController;
-
-function setupModule(module) {
-  // Open the address book main window
-  abController = open_address_book_window();
-}
-
-function teardownModule(module) {
-  // Make sure the panes are all visible now that we're
-  // done these tests.
-  toggle_directory_pane();
-  toggle_contact_pane();
-
-  assert_directory_pane_visibility(true);
-  assert_contact_pane_visibility(true);
-
-  close_address_book_window(abController);
-}
-
-/**
- * Helper function to toggle a pane.
- *
- * @param splitterId the id of the splitter to toggle
- */
-function _help_toggle_pane(splitterId) {
-  abController.window.togglePaneSplitter(splitterId);
-}
-
-/**
- * Helper function to check consistency of a pane's state.
- *
- * @param paneId the id of the pane in question
- * @param menuitemId the id of the menuitem corresponding to the pane
- * @param visible true if the pane should be visible, false otherwise
- */
-function _help_assert_pane_visibility(paneId, menuitemId, visible) {
-  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");
-}
-
-/**
- * Toggle the contact pane.
- */
-function toggle_contact_pane() {
-  _help_toggle_pane("results-splitter");
-}
-
-/**
- * Check that the directory pane is visible or hidden.
- *
- * @param visible true if the pane should be visible, false otherwise
- */
-function assert_directory_pane_visibility(visible) {
-  _help_assert_pane_visibility("dirTreeBox", "menu_showDirectoryPane", visible);
-}
-
-/**
- * Check that the contact pane is visible or hidden.
- *
- * @param visible true if the pane should be visible, false otherwise
- */
-function assert_contact_pane_visibility(visible) {
-  _help_assert_pane_visibility(
-    "CardViewOuterBox",
-    "menu_showCardPane",
-    visible
-  );
-}
-
-function test_hide_directory_pane() {
-  toggle_directory_pane();
-  assert_directory_pane_visibility(false);
-}
-
-function test_show_directory_pane() {
-  toggle_directory_pane();
-  assert_directory_pane_visibility(true);
-}
-
-function test_hide_contact_pane() {
-  toggle_contact_pane();
-  assert_contact_pane_visibility(false);
-}
-
-function test_show_contact_pane() {
-  toggle_contact_pane();
-  assert_contact_pane_visibility(true);
-}
-
-function test_persist_panes() {
-  toggle_directory_pane();
-  toggle_contact_pane();
-
-  close_address_book_window(abController);
-  abController = open_address_book_window();
-
-  assert_directory_pane_visibility(false);
-  assert_contact_pane_visibility(false);
-}
deleted file mode 100644
--- a/mail/test/mozmill/addrbook/test-address-book.js
+++ /dev/null
@@ -1,403 +0,0 @@
-/* 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 for the address book.
- */
-
-"use strict";
-
-var {
-  close_address_book_window,
-  create_address_book,
-  create_contact,
-  create_ldap_address_book,
-  create_mailing_list,
-  get_name_of_address_book_element_at,
-  is_address_book_collapsed,
-  load_contacts_into_address_book,
-  load_contacts_into_mailing_list,
-  open_address_book_window,
-  select_address_book,
-  select_contacts,
-  set_address_books_collapsed,
-  set_address_books_expanded,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
-);
-var { wait_for_compose_window } = ChromeUtils.import(
-  "resource://testing-common/mozmill/ComposeHelpers.jsm"
-);
-var {
-  assert_equals,
-  assert_false,
-  assert_not_equals,
-  assert_true,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { gMockPromptService } = ChromeUtils.import(
-  "resource://testing-common/mozmill/PromptHelpers.jsm"
-);
-var { plan_for_new_window } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
-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) {
-  // Open the address book main window
-  abController = open_address_book_window();
-
-  // Let's add some new address books.  I'll add them
-  // out of order to properly test the alphabetical
-  // ordering of the address books.
-  ldapBook = create_ldap_address_book("LDAP Book");
-  addrBook3 = create_address_book("AB 3");
-  addrBook1 = create_address_book("AB 1");
-  addrBook4 = create_address_book("AB 4");
-  addrBook2 = create_address_book("AB 2");
-
-  mListA = create_mailing_list("ML A");
-  addrBook1.addMailList(mListA);
-
-  mListB = create_mailing_list("ML B");
-  addrBook2.addMailList(mListB);
-
-  mListC = create_mailing_list("ML C");
-  addrBook3.addMailList(mListC);
-
-  mListD = create_mailing_list("ML D");
-  addrBook3.addMailList(mListD);
-
-  // There are 8 address book lists (All, Personal, AB 1, AB 2, AB 3, AB 4, LDAP Book
-  // and Collected Address Book.  So let's ensure that those address books
-  // exist in the tree view before executing our tests.
-  abController.waitFor(
-    () => abController.window.gDirectoryTreeView.rowCount == 8,
-    "Timeout waiting for all 8 rows in address books list to show up in the tree view",
-    1000,
-    10
-  );
-}
-
-function teardownModule(module) {
-  close_address_book_window(abController);
-}
-
-/* Test that the address book manager automatically sorts
- * address books.
- *
- * Currently, we sort address books as follows:
- * 1. All Address Books
- * 2. Personal Address Book
- * 3. Mork Address Books
- * 4. LDAP / Other Address Books
- * 5. Collected Address Book
- *
- * With the All, Personal and Collapsed address books existing
- * automatically, our address books *should* be in this order:
- *
- * All Address Books
- * Personal Address Book
- * AB 1
- *    ML A
- * AB 2
- *    ML B
- * AB 3
- *    ML C
- *    ML D
- * AB 4
- * LDAP Book
- * Collected Address Book
- **/
-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++) {
-    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() {
-  // 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_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_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() {
-  // 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"
-  );
-  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_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_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);
-  // The contact should have been deleted.
-  assert_equals(
-    abController.window.gAbView.rowCount,
-    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() {
-  // 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"
-  );
-  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;
-
-  // 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_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(confirmMultiple, 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_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(confirmMultiple, promptState.text);
-  // The contact should have been deleted.
-  assert_equals(
-    abController.window.gAbView.rowCount,
-    totalEntries - toDelete.length
-  );
-
-  gMockPromptService.unregister();
-}
-
-/* Tests that attempting to delete a mailing list causes a
- * confirmation dialog to be brought up, and that deletion
- * actually works if the user clicks "OK".
- */
-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);
-
-  // Make sure it got added.
-  assert_true(addrBook1.hasDirectory(addedList));
-
-  // Let's click "cancel" on the confirm dialog box
-  // first.
-  gMockPromptService.returnValue = false;
-
-  abController.window.AbDeleteDirectory(addedList.URI);
-
-  let promptState = gMockPromptService.promptState;
-  assert_not_equals(null, promptState, "Expected a prompt state");
-
-  // Test that the confirmation dialog was brought up.
-  assert_equals("confirm", promptState.method);
-
-  // Ensure that the mailing list was not removed.
-  assert_true(addrBook1.hasDirectory(addedList));
-
-  // This time, let's click "OK" on the confirm dialog box
-  gMockPromptService.reset();
-  gMockPromptService.returnValue = true;
-
-  abController.window.AbDeleteDirectory(addedList.URI);
-
-  // Test that the confirmation dialog was brought up.
-  promptState = gMockPromptService.promptState;
-  assert_not_equals(null, promptState, "Expected a prompt state");
-  assert_equals("confirm", promptState.method);
-
-  // Ensure that the mailing list was removed.
-  assert_false(addrBook1.hasDirectory(addedList));
-
-  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);
-
-  // 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),
-  ];
-
-  load_contacts_into_mailing_list(addedList, contacts);
-
-  // Ensure that addrBook1 is expanded
-  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
-  // window...
-  plan_for_new_window("msgcompose");
-  // ... and click the "Write" button
-  abController.click(abController.eid("button-newmessage"));
-  let composeWin = wait_for_compose_window(abController);
-  let to = composeWin.window.gMsgCompose.compFields.to;
-
-  // Make sure we're writing to all contacts in the mailing list.
-  for (let contact of contacts) {
-    assert_true(to.includes(contact.primaryEmail));
-    assert_true(to.includes(contact.displayName));
-  }
-}
deleted file mode 100644
--- a/mail/test/mozmill/addrbook/test-update-mailing-list.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/* 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 if a contact's address is updated, then the address is also
- * updated in mailing lists that that contact belongs to.
- */
-
-"use strict";
-
-var {
-  accept_contact_changes,
-  close_address_book_window,
-  create_address_book,
-  create_contact,
-  create_mailing_list,
-  delete_address_book,
-  edit_selected_contact,
-  open_address_book_window,
-  select_address_book,
-  select_contacts,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AddressBookHelpers.jsm"
-);
-var { assert_equals, mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-var { MailServices } = ChromeUtils.import(
-  "resource:///modules/MailServices.jsm"
-);
-
-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_address_book("Some Address Book");
-  // And a contact...
-  let contact = create_contact(kOldAddress, "Some Contact", true);
-  // And our mailing list.
-  let ml = create_mailing_list("Some Mailing List");
-
-  // Add the mailing list to the address book, and then the card to the
-  // address book, and finally, the card to the mailing list.
-  ml = ab.addMailList(ml);
-  contact = ml.addCard(contact);
-
-  // Open the address book, select our contact...
-  let abw = open_address_book_window(mc);
-  select_address_book(ab);
-  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
-  // to see whether or not the mailing list contact was updated,
-  // we have to get a fresh copy of the address book...
-  ab = MailServices.ab.getDirectory(ab.URI);
-
-  // Ensure that the primary email address for the contact changed
-  // in the mailing list as well.
-  assert_equals(
-    1,
-    ml.addressLists.length,
-    "There should only be one contact in the mailing list"
-  );
-  let mlContact = ml.addressLists.queryElementAt(0, Ci.nsIAbCard);
-  assert_equals(kNewAddress, mlContact.primaryEmail);
-
-  // Destroy the address book that we created.
-  delete_address_book(ab);
-
-  close_address_book_window(abw);
-}
deleted file mode 100644
--- a/mail/test/mozmill/attachment/attachment.txt
+++ /dev/null
@@ -1,1 +0,0 @@
-This is a test attachment! It sure is exciting!
deleted file mode 100644
--- a/mail/test/mozmill/attachment/bug1358565.eml
+++ /dev/null
@@ -1,62 +0,0 @@
-Date: Thu, 22 Feb 2017 10:00:00 -0300
-From: <nobody@example.com>
-MIME-Version: 1.0
-To: <nobody2@example.com>
-Content-Type: multipart/alternative; boundary="------alternative"
-Subject: thunderbird bug
-
-
---------alternative
-Content-Type: text/plain;
-	charset=US-ASCII;
-	format=flowed
-Content-Transfer-Encoding: 7bit
-
-text plain part.
-
---------alternative
-Content-Type: multipart/related;
-	boundary="------related";
-	type="text/html"
-
---------related
-Content-Type: text/html;
-	charset=US-ASCII
-Content-Transfer-Encoding: 7bit
-
-<html><body>HTML part<br><img src="cid:bug.png"></body></html>
---------related
-Content-Disposition: inline;
-	filename=bug.png
-Content-Transfer-Encoding: base64
-Content-Type: image/jpeg;
-	name="bug.png"
-Content-Id: <bug.png>
-
-iVBORw0KGgoAAAANSUhEUgAAAHYAAABNCAYAAABzGpB/AAAABGdBTUEAALGPC/xhBQAAAAFzUkdC
-AK7OHOkAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAS/SURBVHja7Zy/TexAEIdPJKQkhDQAJRBQAhk5
-GQWQ0QARBSBRAVRAAQRkpERIFEAJfvqeZOnOzHj/2l4fv5+00ruz18/M55kd787eppP2UhuZQGAl
-gZUEVhJYSWAFVib4o2BPTk66zWaz056fn2U5gZUEVhJYSWAFVmAFVpYTWElgJYGVBFZgBVZgZTmB
-lVYP9v39vbu9ve1OT0+7w8PDnT585loc57y/pM/Pz+7h4aG7urrqjo+Pd+xycXHR3dzcdK+vr93P
-z09bYL++vrrz8/Nf5401zs8FbN3T9fV1kSH4m4bX5P8pEbDOzs6ibQL0l5eXXUDGeR8fH9ODfXx8
-7A4ODpKg9o1+9/f3ewcWz8M7c2xCo2/vvYuABUruzW+3VLgtgyXsDsNtTiNELwLWMgQeSIjFyP05
-QLu8vPw15pYkZK2CxcvGoHLs7u6ue3p6+g+HRujlO6sf4/KsYIfhl39jWMbaMQHZC9t8H+rfOli8
-zAPKeBsSkGO8fTKw23COjo6ibno70aKPdcOxcFoEixd6IfX7+7tqKJ8M7DbgnMwWuJbnxnpta2C9
-EExGnPMKE4I7OdiSiQov8eI9d21gPW+NAeDp7e1tGbAkSaWyEqoYY7YG1npXJSEqlTdmTwo2ZVz1
-hHda114TWMKm9Tfwfamw8axg8bQaYnzOCfEtgbXCMB5cQyRds4KtEYZ7WUlUaJxtCaw1w8T7Z7U5
-3znBlhqx9PotgbWyVxKfVYKtuWy3drC1s2GBbQCslzjVlMAuABYDC6zACqzA7gFYa0FAYPcA7Jon
-KLzkabVZccxEfa4xaaEVoynA0r/W606N6dbSBycLLBURNcR1cqYrp7gnqxgvBuxUCwCrniu2Vndi
-pitzvSv1XmKuCUSrYqKGvIK4SVd3SsdZbz2WspuQvFWh2NKa2CEhBqznVaXh2AvDk4Mlm80VACwP
-iY0EHoicUtaxvzEGLBUSVt/c6omQt85SQZG7yuMVl6eAsVaFeDBSvdbz/pTwboXjkrHWq06cDWwO
-XA9qagTwrpNyP6G66Fiw3rppDlyvzGb2KsXeAKFXFI6PPSSpY5IXjmnsHRrzXI4NEzD6TFGl2Ff2
-hyoVOT4Mv4vXFW97HQbjeF8szmev3LR0bLRgDGFtF68TdvFo68GsUVcc2tZBDRMPAOu1wOFh5rNV
-28R33vg96cwTN5W7Z6cG1N7zQg9NqNGf69TaCeAVoKVu71h0704JXPrFvNqERIjPhdtDzZ1S9OCy
-LbLGhqxF54oxbCgkWvt7ct85Pc+1ZrHG2nBLSu1tlITblC2UnDvcQjkp2BTPwVgYwxrDgEnYrQnU
-Ajy28ZrvOT7lPViA+03PlneSNY/VSC0OVppGucuCAtuwStZ7BbZhMeZa4VtgVy4ru44tRhfYRuVN
-TsQWowtso7KmKFPWeQW2QXlrsSkLCgLbYAj2piVTfvJAYCuJbLV0MxavN95PFKTu4BPYyhMJTA0C
-IaUEldDrLdYPFwUEdiGw1nsnoEmGho3XmdB8Mh6cszteYCcGW7p8l/uTBwLbKFi8vKQYTmAriYyV
-8JqyVOf9JF9K9iuwM0OmCKFfrvNgc4zW/7Zi1QgiDHs6NMgEAisJrCSwksBK8foHNXX2LMmMFTgA
-AAAASUVORK5CYII=
---------related--
-
---------alternative--
deleted file mode 100644
--- a/mail/test/mozmill/attachment/test-attachment-events.js
+++ /dev/null
@@ -1,437 +0,0 @@
-/* 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/. */
-
-/**
- * Ensures that attachment events are fired properly
- */
-
-"use strict";
-
-var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
-
-var { select_attachments } = ChromeUtils.import(
-  "resource://testing-common/mozmill/AttachmentHelpers.jsm"
-);
-var { assert_equals, assert_true, mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var {
-  add_attachments,
-  close_compose_window,
-  open_compose_new_mail,
-} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
-var { gMockPromptService } = ChromeUtils.import(
-  "resource://testing-common/mozmill/PromptHelpers.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";
-var kAttachmentRenamed = "attachment-renamed";
-
-var gPath;
-
-function setupModule(module) {
-  gPath = os.getFileForPath(__file__);
-}
-
-/**
- * Test that the attachments-added event is fired when we add a single
- * attachment.
- */
-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_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_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_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
- * of files all at once.
- */
-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);
-  cw.e("attachmentBucket").addEventListener(kAttachmentsAdded, listener);
-
-  add_attachments(cw, attachmentUrls, null, false);
-
-  // Make sure we only saw a single attachments-added for this group
-  // of files.
-  assert_equals(1, eventCount);
-
-  // Now make sure we got passed the right subjects for the event
-  let subjects = lastEvent.detail;
-  assert_true(subjects instanceof Ci.nsIMutableArray);
-  assert_equals(2, subjects.length);
-
-  for (let attachment of fixIterator(subjects, Ci.nsIMsgAttachment)) {
-    assert_true(attachmentUrls.includes(attachment.url));
-  }
-
-  // Close the compose window - let's try again with 3 attachments.
-  cw.e("attachmentBucket").removeEventListener(kAttachmentsAdded, listener);
-  close_compose_window(cw);
-
-  attachmentUrls = [
-    "http://www.example.com/1",
-    "http://www.example.com/2",
-    "http://www.example.com/3",
-  ];
-
-  // Open the compose window and attach the files, and ensure that we saw
-  // the attachments-added event
-  cw = open_compose_new_mail(mc);
-  cw.e("attachmentBucket").addEventListener(kAttachmentsAdded, listener);
-
-  add_attachments(cw, attachmentUrls, null, false);
-  assert_equals(2, eventCount);
-
-  // Make sure that we got the right subjects back
-  subjects = lastEvent.detail;
-  assert_true(subjects instanceof Ci.nsIMutableArray);
-  assert_equals(3, subjects.length);
-
-  for (let attachment of fixIterator(subjects, Ci.nsIMsgAttachment)) {
-    assert_true(attachmentUrls.includes(attachment.url));
-  }
-
-  // Make sure we don't fire the event again if we try to attach the same
-  // files.
-  add_attachments(cw, attachmentUrls, null, false);
-  assert_equals(2, eventCount);
-
-  cw.e("attachmentBucket").removeEventListener(kAttachmentsAdded, listener);
-  close_compose_window(cw);
-}
-
-/**
- * Test that the attachments-removed event is fired when removing a
- * single file.
- */
-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_attachments(cw, "http://www.example.com/1");
-
-  // Now select that attachment and delete it
-  select_attachments(cw, 0);
-  // We need to hold a reference to removedAttachment here because
-  // the delete routine nulls it out from the attachmentitem.
-  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_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"
-  );
-
-  cw.e("attachmentBucket").removeEventListener(kAttachmentsRemoved, listener);
-  close_compose_window(cw);
-}
-
-/**
- * Test that the attachments-removed event is fired when removing multiple
- * files all at once.
- */
-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",
-  ]);
-
-  // Select all three attachments, and remove them.
-  let removedAttachmentItems = select_attachments(cw, 0, 2);
-
-  let removedAttachmentUrls = removedAttachmentItems.map(
-    aAttachment => aAttachment.attachment.url
-  );
-
-  cw.window.goDoCommand("cmd_delete");
-
-  // We should have seen the attachments-removed event exactly once.
-  assert_equals(1, eventCount);
-
-  // Now let's make sure we got passed back the right attachment items
-  // as the event subject
-  let subjects = lastEvent.detail;
-  assert_true(subjects instanceof Ci.nsIMutableArray);
-  assert_equals(3, subjects.length);
-
-  for (let attachment of fixIterator(subjects, Ci.nsIMsgAttachment)) {
-    assert_true(removedAttachmentUrls.includes(attachment.url));
-  }
-
-  // Ok, let's attach and remove some again to ensure that we still see the event.
-  add_attachments(cw, ["http://www.example.com/1", "http://www.example.com/2"]);
-
-  select_attachments(cw, 0, 1);
-  cw.window.goDoCommand("cmd_delete");
-  assert_equals(2, eventCount);
-
-  cw.e("attachmentBucket").removeEventListener(kAttachmentsRemoved, listener);
-  close_compose_window(cw);
-}
-
-/**
- * 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 listener = function(event) {
-    eventCount++;
-  };
-
-  // 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",
-  ]);
-
-  // Choose no attachments
-  cw.e("attachmentBucket").clearSelection();
-  // Run the delete command
-  cw.window.goDoCommand("cmd_delete");
-  // Make sure we didn't see the attachments_removed event.
-  assert_equals(0, eventCount);
-  cw.e("attachmentBucket").removeEventListener(kAttachmentsRemoved, listener);
-
-  close_compose_window(cw);
-}
-
-/**
- * Test that we see the attachment-renamed event when an attachments
- * name is changed.
- */
-function test_attachment_renamed() {
-  // Here's what we'll rename some files to.
-  const kRenameTo1 = "Renamed-1";
-  const kRenameTo2 = "Renamed-2";
-  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;
-
-  // Open up the compose window, attach some files, choose the first
-  // attachment, and choose to rename it.
-  let cw = open_compose_new_mail(mc);
-  cw.e("attachmentBucket").addEventListener(kAttachmentRenamed, listener);
-
-  add_attachments(cw, [
-    "http://www.example.com/1",
-    "http://www.example.com/2",
-    "http://www.example.com/3",
-  ]);
-
-  select_attachments(cw, 0);
-  cw.window.goDoCommand("cmd_renameAttachment");
-
-  // Ensure that we saw the attachment-renamed event
-  assert_equals(1, eventCount);
-  // Ensure that the event mentions the right attachment
-  let renamedAttachment1 = lastEvent.target.attachment;
-  let originalName1 = lastEvent.detail;
-  assert_true(renamedAttachment1 instanceof Ci.nsIMsgAttachment);
-  assert_equals(kRenameTo1, renamedAttachment1.name);
-  assert_true(renamedAttachment1.url.includes("http://www.example.com/1"));
-  assert_equals("www.example.com/1", originalName1);
-
-  // Ok, let's try renaming the same attachment.
-  gMockPromptService.reset();
-  gMockPromptService.inoutValue = kRenameTo2;
-  gMockPromptService.returnValue = true;
-
-  select_attachments(cw, 0);
-  cw.window.goDoCommand("cmd_renameAttachment");
-
-  assert_equals(2, eventCount);
-  let renamedAttachment2 = lastEvent.target.attachment;
-  let originalName2 = lastEvent.detail;
-  assert_true(renamedAttachment2 instanceof Ci.nsIMsgAttachment);
-  assert_equals(kRenameTo2, renamedAttachment2.name);
-  assert_true(renamedAttachment2.url.includes("http://www.example.com/1"));
-  assert_equals(kRenameTo1, originalName2);
-
-  // Ok, let's rename another attachment
-  gMockPromptService.reset();
-  gMockPromptService.inoutValue = kRenameTo3;
-  gMockPromptService.returnValue = true;
-
-  // We'll select the second attachment this time.
-  select_attachments(cw, 1);
-  cw.window.goDoCommand("cmd_renameAttachment");
-
-  // Ensure we saw the attachment-renamed event
-  assert_equals(3, eventCount);
-  // Ensure that the event mentions the right attachment
-  let renamedAttachment3 = lastEvent.target.attachment;
-  let originalName3 = lastEvent.detail;
-  assert_true(renamedAttachment3 instanceof Ci.nsIMsgAttachment);
-  assert_equals(kRenameTo3, renamedAttachment3.name);
-  assert_true(renamedAttachment3.url.includes("http://www.example.com/2"));
-  assert_equals("www.example.com/2", originalName3);
-
-  // Unregister the Mock Prompt service, and remove our observer.
-  cw.e("attachmentBucket").removeEventListener(kAttachmentRenamed, listener);
-
-  close_compose_window(cw);
-  gMockPromptService.unregister();
-}
-
-/**
- * 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 listener = function(event) {
-    eventCount++;
-  };
-
-  // Register the Mock Prompt Service to return the empty string when
-  // prompted.
-  gMockPromptService.reset();
-  gMockPromptService.register();
-  gMockPromptService.inoutValue = "";
-  gMockPromptService.returnValue = true;
-
-  // Open the compose window, attach some files, select one, and chooes to
-  // rename it.
-  let cw = open_compose_new_mail(mc);
-  cw.e("attachmentBucket").addEventListener(kAttachmentRenamed, listener);
-
-  add_attachments(cw, [
-    "http://www.example.com/1",
-    "http://www.example.com/2",
-    "http://www.example.com/3",
-  ]);
-
-  select_attachments(cw, 0);
-  cw.window.goDoCommand("cmd_renameAttachment");
-
-  // Ensure that we didn't see the attachment-renamed event.
-  assert_equals(0, eventCount);
-  cw.e("attachmentBucket").removeEventListener(kAttachmentRenamed, listener);
-  close_compose_window(cw);
-  gMockPromptService.unregister();
-}
deleted file mode 100644
--- a/mail/test/mozmill/attachment/test-attachment-in-plain-msg.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* 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 os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
-
-var { wait_for_element_visible } = ChromeUtils.import(
-  "resource://testing-common/mozmill/DOMHelpers.jsm"
-);
-var {
-  assert_equals,
-  assert_false,
-  assert_true,
-  open_message_from_file,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { close_window } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-/**
- * Bug 1358565
- * Check that a non-empty image is shown as attachment and is detected as non-empty
- * when message is viewed as plain text.
- */
-async function test_attachment_not_empty() {
-  Services.prefs.setBoolPref("mailnews.display.prefer_plaintext", true);
-
-  let thisFilePath = os.getFileForPath(__file__);
-  let file = os.getFileForPath(os.abspath("./bug1358565.eml", thisFilePath));
-
-  let msgc = open_message_from_file(file);
-
-  wait_for_element_visible(msgc, "attachmentToggle");
-  msgc.click(msgc.eid("attachmentToggle"));
-
-  wait_for_element_visible(msgc, "attachmentList");
-  assert_equals(msgc.e("attachmentList").itemCount, 1);
-
-  let attachmentElem = msgc.e("attachmentList").getItemAtIndex(0);
-  assert_equals(attachmentElem.attachment.contentType, "image/jpeg");
-  assert_equals(attachmentElem.attachment.name, "bug.png");
-  assert_true(attachmentElem.attachment.hasFile);
-  assert_false(
-    await attachmentElem.attachment.isEmpty(),
-    "Attachment incorrectly determined empty"
-  );
-
-  close_window(msgc);
-
-  Services.prefs.clearUserPref("mailnews.display.prefer_plaintext");
-}
deleted file mode 100644
--- a/mail/test/mozmill/attachment/test-attachment-menus.js
+++ /dev/null
@@ -1,535 +0,0 @@
-/* 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 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"
-);
-
-var {
-  create_body_part,
-  create_deleted_attachment,
-  create_detached_attachment,
-  create_enclosure_attachment,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AttachmentHelpers.jsm"
-);
-var {
-  add_message_to_folder,
-  be_in_folder,
-  close_popup,
-  create_folder,
-  create_message,
-  mc,
-  select_click_row,
-  wait_for_popup_to_open,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-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 detachedName = "./attachment.txt";
-var missingName = "./nonexistent.txt";
-var deletedName = "deleted.txt";
-
-// create some messages that have various types of attachments
-var messages = [
-  {
-    name: "regular_attachment",
-    attachments: [{ body: textAttachment, filename: "ubik.txt", format: "" }],
-    menuStates: [{ open: true, save: true, detach: true, delete_: true }],
-    allMenuStates: { open: true, save: true, detach: true, delete_: true },
-  },
-  {
-    name: "detached_attachment",
-    bodyPart: null,
-    menuStates: [{ open: true, save: true, detach: false, delete_: false }],
-    allMenuStates: { open: true, save: true, detach: false, delete_: false },
-  },
-  {
-    name: "detached_attachment_with_missing_file",
-    bodyPart: null,
-    menuStates: [{ open: false, save: false, detach: false, delete_: false }],
-    allMenuStates: { open: false, save: false, detach: false, delete_: false },
-  },
-  {
-    name: "deleted_attachment",
-    bodyPart: null,
-    menuStates: [{ open: false, save: false, detach: false, delete_: false }],
-    allMenuStates: { open: false, save: false, detach: false, delete_: false },
-  },
-  {
-    name: "multiple_attachments",
-    attachments: [
-      { body: textAttachment, filename: "ubik.txt", format: "" },
-      { body: textAttachment, filename: "ubik2.txt", format: "" },
-    ],
-    menuStates: [
-      { open: true, save: true, detach: true, delete_: true },
-      { open: true, save: true, detach: true, delete_: true },
-    ],
-    allMenuStates: { open: true, save: true, detach: true, delete_: true },
-  },
-  {
-    name: "multiple_attachments_one_detached",
-    bodyPart: null,
-    attachments: [{ body: textAttachment, filename: "ubik.txt", format: "" }],
-    menuStates: [
-      { open: true, save: true, detach: false, delete_: false },
-      { open: true, save: true, detach: true, delete_: true },
-    ],
-    allMenuStates: { open: true, save: true, detach: true, delete_: true },
-  },
-  {
-    name: "multiple_attachments_one_detached_with_missing_file",
-    bodyPart: null,
-    attachments: [{ body: textAttachment, filename: "ubik.txt", format: "" }],
-    menuStates: [
-      { open: false, save: false, detach: false, delete_: false },
-      { open: true, save: true, detach: true, delete_: true },
-    ],
-    allMenuStates: { open: true, save: true, detach: true, delete_: true },
-  },
-  {
-    name: "multiple_attachments_one_deleted",
-    bodyPart: null,
-    attachments: [{ body: textAttachment, filename: "ubik.txt", format: "" }],
-    menuStates: [
-      { open: false, save: false, detach: false, delete_: false },
-      { open: true, save: true, detach: true, delete_: true },
-    ],
-    allMenuStates: { open: true, save: true, detach: true, delete_: true },
-  },
-  {
-    name: "multiple_attachments_all_detached",
-    bodyPart: null,
-    menuStates: [
-      { open: true, save: true, detach: false, delete_: false },
-      { open: true, save: true, detach: false, delete_: false },
-    ],
-    allMenuStates: { open: true, save: true, detach: false, delete_: false },
-  },
-  {
-    name: "multiple_attachments_all_detached_with_missing_files",
-    bodyPart: null,
-    menuStates: [
-      { open: false, save: false, detach: false, delete_: false },
-      { open: false, save: false, detach: false, delete_: false },
-    ],
-    allMenuStates: { open: false, save: false, detach: false, delete_: false },
-  },
-  {
-    name: "multiple_attachments_all_deleted",
-    bodyPart: null,
-    menuStates: [
-      { open: false, save: false, detach: false, delete_: false },
-      { open: false, save: false, detach: false, delete_: false },
-    ],
-    allMenuStates: { open: false, save: false, detach: false, delete_: false },
-  },
-  {
-    name: "link_enclosure_valid",
-    bodyPart: null,
-    menuStates: [{ open: true, save: true, detach: false, delete_: false }],
-    allMenuStates: { open: true, save: true, detach: false, delete_: false },
-  },
-  {
-    name: "link_enclosure_invalid",
-    bodyPart: null,
-    menuStates: [{ open: false, save: false, detach: false, delete_: false }],
-    allMenuStates: { open: false, save: false, detach: false, delete_: false },
-  },
-  {
-    name: "link_multiple_enclosures",
-    bodyPart: null,
-    menuStates: [
-      { open: true, save: true, detach: false, delete_: false },
-      { open: true, save: true, detach: false, delete_: false },
-    ],
-    allMenuStates: { open: true, save: true, detach: false, delete_: false },
-  },
-  {
-    name: "link_multiple_enclosures_one_invalid",
-    bodyPart: null,
-    menuStates: [
-      { open: true, save: true, detach: false, delete_: false },
-      { open: false, save: false, detach: false, delete_: false },
-    ],
-    allMenuStates: { open: true, save: true, detach: false, delete_: false },
-  },
-  {
-    name: "link_multiple_enclosures_all_invalid",
-    bodyPart: null,
-    menuStates: [
-      { open: false, save: false, detach: false, delete_: false },
-      { open: false, save: false, detach: false, delete_: false },
-    ],
-    allMenuStates: { open: false, save: false, detach: false, delete_: false },
-  },
-];
-
-function setupModule(module) {
-  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 ? 2 : 1;
-
-  // 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"),
-  ]);
-  var multiple_detached = create_body_part("Here are some files", [
-    create_detached_attachment(detachedFile, "text/plain"),
-    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")]
-  );
-  var multiple_missing = create_body_part(
-    "Here are some files (but you deleted the external files, you silly oaf!)",
-    [
-      create_detached_attachment(missingFile, "text/plain"),
-      create_detached_attachment(missingFile, "text/plain"),
-    ]
-  );
-
-  var deleted = create_body_part("Here is a file that you deleted", [
-    create_deleted_attachment(deletedName, "text/plain"),
-  ]);
-  var multiple_deleted = create_body_part(
-    "Here are some files that you deleted",
-    [
-      create_deleted_attachment(deletedName, "text/plain"),
-      create_deleted_attachment(deletedName, "text/plain"),
-    ]
-  );
-
-  var enclosure_valid_url = create_body_part("My blog has the best enclosure", [
-    create_enclosure_attachment(
-      "purr.mp3",
-      "audio/mpeg",
-      "http://example.com",
-      12345678
-    ),
-  ]);
-  var enclosure_invalid_url = create_body_part(
-    "My blog has the best enclosure with a dead link",
-    [
-      create_enclosure_attachment(
-        "meow.mp3",
-        "audio/mpeg",
-        "http://example.com/invalid"
-      ),
-    ]
-  );
-  var multiple_enclosures = create_body_part(
-    "My blog has the best 2 cat sound enclosures",
-    [
-      create_enclosure_attachment(
-        "purr.mp3",
-        "audio/mpeg",
-        "http://example.com",
-        1234567
-      ),
-      create_enclosure_attachment(
-        "meow.mp3",
-        "audio/mpeg",
-        "http://example.com",
-        987654321
-      ),
-    ]
-  );
-  var multiple_enclosures_one_link_invalid = create_body_part(
-    "My blog has the best 2 cat sound enclosures but one is invalid",
-    [
-      create_enclosure_attachment(
-        "purr.mp3",
-        "audio/mpeg",
-        "http://example.com",
-        1234567
-      ),
-      create_enclosure_attachment(
-        "meow.mp3",
-        "audio/mpeg",
-        "http://example.com/invalid"
-      ),
-    ]
-  );
-  var multiple_enclosures_all_links_invalid = create_body_part(
-    "My blog has 2 enclosures with 2 bad links",
-    [
-      create_enclosure_attachment(
-        "purr.mp3",
-        "audio/mpeg",
-        "http://example.com/invalid"
-      ),
-      create_enclosure_attachment(
-        "meow.mp3",
-        "audio/mpeg",
-        "http://example.com/invalid"
-      ),
-    ]
-  );
-
-  folder = create_folder("AttachmentMenusA");
-  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":
-        messages[i].bodyPart = detached;
-        break;
-      case "multiple_attachments_all_detached":
-        messages[i].bodyPart = multiple_detached;
-        break;
-      case "detached_attachment_with_missing_file":
-      case "multiple_attachments_one_detached_with_missing_file":
-        messages[i].bodyPart = missing;
-        break;
-      case "multiple_attachments_all_detached_with_missing_files":
-        messages[i].bodyPart = multiple_missing;
-        break;
-      case "deleted_attachment":
-      case "multiple_attachments_one_deleted":
-        messages[i].bodyPart = deleted;
-        break;
-      case "multiple_attachments_all_deleted":
-        messages[i].bodyPart = multiple_deleted;
-        break;
-      case "link_enclosure_valid":
-        messages[i].bodyPart = enclosure_valid_url;
-        break;
-      case "link_enclosure_invalid":
-        messages[i].bodyPart = enclosure_invalid_url;
-        break;
-      case "link_multiple_enclosures":
-        messages[i].bodyPart = multiple_enclosures;
-        break;
-      case "link_multiple_enclosures_one_invalid":
-        messages[i].bodyPart = multiple_enclosures_one_link_invalid;
-        break;
-      case "link_multiple_enclosures_all_invalid":
-        messages[i].bodyPart = multiple_enclosures_all_links_invalid;
-        break;
-    }
-
-    add_message_to_folder(folder, create_message(messages[i]));
-  }
-}
-
-/**
- * Ensure that the specified element is visible/hidden
- *
- * @param id the id of the element to check
- * @param visible true if the element should be visible, false otherwise
- */
-function assert_shown(id, visible) {
-  if (mc.e(id).hidden == visible) {
-    throw new Error(
-      '"' + id + '" should be ' + (visible ? "visible" : "hidden")
-    );
-  }
-}
-
-/**
- * Ensure that the specified element is enabled/disabled
- *
- * @param id the id of the element to check
- * @param enabled true if the element should be enabled, false otherwise
- */
-function assert_enabled(id, enabled) {
-  if (mc.e(id).disabled == enabled) {
-    throw new Error(
-      '"' + id + '" should be ' + (enabled ? "enabled" : "disabled")
-    );
-  }
-}
-
-/**
- * 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) {
-    assert_enabled("attachmentSaveAllSingle", false);
-  } else {
-    assert_enabled("attachmentSaveAllSingle", true);
-    mc.click(
-      new elementslib.Elem(
-        mc
-          .e("attachmentSaveAllSingle")
-          .querySelector(".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-detachAttachment", expected.detach);
-      assert_enabled("button-deleteAttachment", expected.delete_);
-    } 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) {
-    assert_enabled("attachmentSaveAllMultiple", false);
-  } else {
-    assert_enabled("attachmentSaveAllMultiple", true);
-    mc.click(
-      new elementslib.Elem(
-        mc
-          .e("attachmentSaveAllMultiple")
-          .querySelector(".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-detachAllAttachments", expected.detach);
-      assert_enabled("button-deleteAllAttachments", expected.delete_);
-    } finally {
-      close_popup(mc, mc.eid("attachmentSaveAllMultipleMenu"));
-    }
-  }
-}
-
-/**
- * Check that the menu states in the single item context menu are correct
- *
- * @param expected a dictionary containing the expected states
- */
-function check_menu_states_single(index, expected) {
-  let attachmentList = mc.e("attachmentList");
-  let node = attachmentList.getItemAtIndex(index);
-
-  attachmentList.selectItem(node);
-  let menu = mc.getMenu("#attachmentItemContext");
-  menu.open(new elib.Elem(node));
-  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-detachAttachment", true);
-    assert_shown("context-deleteAttachment", true);
-
-    assert_enabled("context-openAttachment", expected.open);
-    assert_enabled("context-saveAttachment", expected.save);
-    assert_enabled("context-detachAttachment", expected.detach);
-    assert_enabled("context-deleteAttachment", expected.delete_);
-  } finally {
-    menu.close();
-  }
-}
-
-/**
- * Check that the menu states in the all items context menu are correct
- *
- * @param expected a dictionary containing the expected states
- */
-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-detachAllAttachments", true);
-    assert_shown("context-deleteAllAttachments", true);
-
-    assert_enabled("context-openAllAttachments", expected.open);
-    assert_enabled("context-saveAllAttachments", expected.save);
-    assert_enabled("context-detachAllAttachments", expected.detach);
-    assert_enabled("context-deleteAllAttachments", expected.delete_);
-  } finally {
-    close_popup(mc, mc.eid("attachmentListContext"));
-  }
-}
-
-function help_test_attachment_menus(index) {
-  be_in_folder(folder);
-  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();
-  }
-
-  // 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(1000);
-
-  if (expectedStates.length == 1) {
-    check_toolbar_menu_states_single(messages[index].allMenuStates);
-  } else {
-    check_toolbar_menu_states_multiple(messages[index].allMenuStates);
-  }
-
-  check_menu_states_all(messages[index].allMenuStates);
-  for (let i = 0; i < expectedStates.length; i++) {
-    check_menu_states_single(i, expectedStates[i]);
-  }
-}
-
-// Generate a test for each message in |messages|.
-for (let [i, message] of messages.entries()) {
-  let index = i; // make a copy to avoid passing a reference to i
-  this["test_" + message.name] = function() {
-    help_test_attachment_menus(index);
-  };
-}
deleted file mode 100644
--- a/mail/test/mozmill/attachment/test-attachment-size.js
+++ /dev/null
@@ -1,430 +0,0 @@
-/* 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 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"
-);
-
-var {
-  create_body_part,
-  create_deleted_attachment,
-  create_detached_attachment,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AttachmentHelpers.jsm"
-);
-var {
-  add_message_to_folder,
-  be_in_folder,
-  create_folder,
-  create_message,
-  mc,
-  msgGen,
-  select_click_row,
-  SyntheticPartLeaf,
-  SyntheticPartMultiMixed,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-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=";
-var imageSize = 188;
-
-var vcardAttachment =
-  "YmVnaW46dmNhcmQNCmZuOkppbSBCb2INCm46Qm9iO0ppbQ0KZW1haWw7aW50ZXJuZXQ6Zm9v" +
-  "QGJhci5jb20NCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K";
-
-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",
-    attachments: [{ body: textAttachment, filename: "ubik.txt", format: "" }],
-    attachmentSizes: [textAttachment.length],
-    attachmentTotalSize: { size: textAttachment.length, exact: true },
-  },
-  {
-    name: "binary_attachment",
-    attachments: [
-      {
-        body: binaryAttachment,
-        contentType: "application/x-ubik",
-        filename: "ubik",
-        format: "",
-      },
-    ],
-    attachmentSizes: [binaryAttachment.length],
-    attachmentTotalSize: { size: binaryAttachment.length, exact: true },
-  },
-  {
-    name: "image_attachment",
-    attachments: [
-      {
-        body: imageAttachment,
-        contentType: "image/png",
-        filename: "lines.png",
-        encoding: "base64",
-        format: "",
-      },
-    ],
-    attachmentSizes: [imageSize],
-    attachmentTotalSize: { size: imageSize, exact: true },
-  },
-  {
-    name: "detached_attachment",
-    bodyPart: null,
-    // Sizes filled in on message creation.
-    attachmentSizes: [null],
-    attachmentTotalSize: { size: 0, exact: true },
-  },
-  {
-    name: "detached_attachment_with_missing_file",
-    bodyPart: null,
-    attachmentSizes: [-1],
-    attachmentTotalSize: { size: 0, exact: false },
-  },
-  {
-    name: "deleted_attachment",
-    bodyPart: null,
-    attachmentSizes: [-1],
-    attachmentTotalSize: { size: 0, exact: true },
-  },
-  {
-    name: "multiple_attachments",
-    attachments: [
-      { body: textAttachment, filename: "ubik.txt", format: "" },
-      {
-        body: binaryAttachment,
-        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",
-    attachments: [
-      { body: textAttachment, filename: "ubik.txt", format: "" },
-      {
-        body: vcardAttachment,
-        contentType: "text/x-vcard",
-        filename: "ubik.vcf",
-        encoding: "base64",
-        format: "",
-      },
-    ],
-    attachmentSizes: [textAttachment.length],
-    attachmentTotalSize: { size: textAttachment.length, exact: true },
-  },
-  {
-    name: "multiple_attachments_one_detached",
-    bodyPart: null,
-    attachments: [{ body: textAttachment, filename: "ubik.txt", format: "" }],
-    attachmentSizes: [null, textAttachment.length],
-    attachmentTotalSize: { size: textAttachment.length, exact: true },
-  },
-  {
-    name: "multiple_attachments_one_detached_with_missing_file",
-    bodyPart: null,
-    attachments: [{ body: textAttachment, filename: "ubik.txt", format: "" }],
-    attachmentSizes: [-1, textAttachment.length],
-    attachmentTotalSize: { size: textAttachment.length, exact: false },
-  },
-  {
-    name: "multiple_attachments_one_deleted",
-    bodyPart: null,
-    attachments: [{ body: textAttachment, 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",
-    bodyPart: null,
-    attachmentSizes: [-1, textAttachment.length],
-    attachmentTotalSize: { size: 0, exact: true },
-  },
-];
-
-function setupModule(module) {
-  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;
-
-  // 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"),
-  ]);
-
-  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")]
-  );
-
-  var deleted = create_body_part("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: "" }],
-  });
-
-  /* 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");
-  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":
-        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":
-        messages[i].bodyPart = missing;
-        break;
-      case "deleted_attachment":
-      case "multiple_attachments_one_deleted":
-        messages[i].bodyPart = deleted;
-        break;
-      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;
-    }
-
-    add_message_to_folder(folder, create_message(messages[i]));
-  }
-}
-
-/**
- * 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 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 +
-        ")"
-    );
-  }
-
-  // Next, make sure that the formatted size in the label is correct
-  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 +
-        ")"
-    );
-  }
-}
-
-/**
- * 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 node = list.querySelectorAll("richlistitem.attachmentItem")[index];
-
-  if (node.attachment.size != -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!");
-  }
-}
-
-/**
- * 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 nodes = list.querySelectorAll("richlistitem.attachmentItem");
-  let sizeNode = mc.e("attachmentSize");
-
-  if (nodes.length != 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 +
-        ")"
-    );
-  }
-
-  // Next, make sure that the formatted size in the label is correct
-  let formattedSize = sizeNode.getAttribute("value");
-  let expectedFormattedSize = messenger.formatFileSize(size);
-  let messengerBundle = mc.window.document.getElementById("bundle_messenger");
-
-  if (!exact) {
-    if (size == 0) {
-      expectedFormattedSize = messengerBundle.getString(
-        "attachmentSizeUnknown"
-      );
-    } else {
-      expectedFormattedSize = messengerBundle.getFormattedString(
-        "attachmentSizeAtLeast",
-        [expectedFormattedSize]
-      );
-    }
-  }
-  if (formattedSize != 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);
-  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);
-
-  for (let i = 0; i < expectedSizes.length; i++) {
-    if (expectedSizes[i] == -1) {
-      check_no_attachment_size(i);
-    } else {
-      check_attachment_size(i, expectedSizes[i]);
-    }
-  }
-
-  let totalSize = messages[index].attachmentTotalSize;
-  check_total_attachment_size(
-    expectedSizes.length,
-    totalSize.size,
-    totalSize.exact
-  );
-}
-
-// Generate a test for each message in |messages|.
-for (let [i, message] of messages.entries()) {
-  let index = i; // make a copy to avoid passing a reference to i
-  this["test_" + message.name] = function() {
-    help_test_attachment_size(index);
-  };
-}
deleted file mode 100644
--- a/mail/test/mozmill/attachment/test-attachment.js
+++ /dev/null
@@ -1,654 +0,0 @@
-/* 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/. */
-
-/**
- * Checks various attachments display correctly
- */
-
-"use strict";
-
-var elib = ChromeUtils.import(
-  "chrome://mozmill/content/modules/elementslib.jsm"
-);
-var EventUtils = ChromeUtils.import(
-  "chrome://mozmill/content/stdlib/EventUtils.jsm"
-);
-
-var { close_compose_window, open_compose_with_forward } = ChromeUtils.import(
-  "resource://testing-common/mozmill/ComposeHelpers.jsm"
-);
-var {
-  add_message_to_folder,
-  assert_attachment_list_focused,
-  assert_equals,
-  assert_message_pane_focused,
-  assert_selected_and_displayed,
-  assert_true,
-  be_in_folder,
-  close_popup,
-  create_folder,
-  create_message,
-  mc,
-  msgGen,
-  plan_to_wait_for_folder_events,
-  select_click_row,
-  select_none,
-  SyntheticPartLeaf,
-  SyntheticPartMultiMixed,
-  wait_for_folder_events,
-  wait_for_message_display_completion,
-  wait_for_popup_to_open,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var {
-  close_window,
-  plan_for_modal_dialog,
-  plan_for_new_window,
-  wait_for_modal_dialog,
-  wait_for_new_window,
-} = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
-
-var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-var folder;
-var messages;
-
-var textAttachment =
-  "One of these days... people like me will rise up and overthrow you, and " +
-  "the end of tyranny by the homeostatic machine will have arrived. The day " +
-  "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;
-
-function setupModule(module) {
-  folder = create_folder("AttachmentA");
-
-  var attachedMessage = msgGen.makeMessage({
-    body: { body: "I'm an attached email!" },
-    attachments: [
-      { body: textAttachment, 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: "" }],
-    },
-    // 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: "",
-        },
-      ],
-    },
-    // multiple attachments
-    {
-      attachments: [
-        { body: textAttachment, filename: "ubik.txt", format: "" },
-        {
-          body: binaryAttachment,
-          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: "",
-        },
-      ],
-    },
-    // 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: "",
-        }),
-        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: "",
-        },
-      ],
-    },
-    // 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: "",
-        },
-      ],
-    },
-  ];
-
-  // Add another evilly-named attachment for Windows tests, to ensure that
-  // trailing periods are stripped.
-  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: "",
-        },
-      ],
-    });
-  }
-
-  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) {
-  Services.prefs.setBoolPref(
-    "mailnews.attachments.display.start_expanded",
-    expand
-  );
-}
-
-function test_attachment_view_collapsed() {
-  be_in_folder(folder);
-
-  select_click_row(0);
-  assert_selected_and_displayed(0);
-
-  if (!mc.e("attachmentView").collapsed) {
-    throw new Error("Attachment pane expanded when it shouldn't be!");
-  }
-}
-
-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 + " when it shouldn't be!"
-      );
-    }
-  }
-}
-
-function test_attachment_name_sanitization() {
-  be_in_folder(folder);
-
-  let attachmentList = mc.e("attachmentList");
-
-  for (let i = 0; i < messages.length; i++) {
-    if ("attachments" in messages[i]) {
-      select_click_row(i);
-      assert_selected_and_displayed(i);
-
-      let attachments = messages[i].attachments;
-      if (messages[i].attachments.length == 1) {
-        assert_equals(
-          mc.e("attachmentName").value,
-          attachments[0].sanitizedFilename || attachments[0].filename
-        );
-      }
-
-      for (let j = 0; j < attachments.length; j++) {
-        assert_equals(
-          attachmentList.getItemAtIndex(j).getAttribute("name"),
-          attachments[j].sanitizedFilename || attachments[j].filename
-        );
-      }
-    }
-  }
-}
-
-function test_long_attachment_name() {
-  be_in_folder(folder);
-
-  select_click_row(4);
-  assert_selected_and_displayed(4);
-
-  let messagepaneBox = mc.e("messagepanebox");
-  let attachmentBar = mc.e("attachmentBar");
-
-  assert_true(
-    messagepaneBox.getBoundingClientRect().width >=
-      attachmentBar.getBoundingClientRect().width,
-    "Attachment bar has expanded off the edge of the window!"
-  );
-}
-
-/**
- * Make sure that, when opening attached messages, we only show the attachments
- * "beneath" the attached message (as opposed to all attachments for the root
- * message).
- */
-function test_attached_message_attachments() {
-  be_in_folder(folder);
-
-  select_click_row(5);
-  assert_selected_and_displayed(5);
-
-  // Make sure we have the expected number of attachments in the root message:
-  // an outer text attachment, an attached email, and an inner text attachment.
-  assert_equals(mc.e("attachmentList").itemCount, 3);
-
-  // Open the attached email.
-  plan_for_new_window("mail:messageWindow");
-  mc.e("attachmentList")
-    .getItemAtIndex(1)
-    .attachment.open();
-  let msgc = wait_for_new_window("mail:messageWindow");
-  wait_for_message_display_completion(msgc, true);
-
-  // Make sure we have the expected number of attachments in the attached
-  // message: just an inner text attachment.
-  assert_equals(msgc.e("attachmentList").itemCount, 1);
-
-  close_window(msgc);
-}
-
-function test_attachment_name_click() {
-  be_in_folder(folder);
-
-  select_click_row(1);
-  assert_selected_and_displayed(1);
-
-  let attachmentList = mc.e("attachmentList");
-
-  assert_true(
-    attachmentList.collapsed,
-    "Attachment list should start out collapsed!"
-  );
-
-  // Ensure the open dialog appears when clicking on the attachment name and
-  // that the attachment list doesn't expand.
-  plan_for_modal_dialog("unknownContentTypeWindow", function() {});
-  mc.click(mc.eid("attachmentName"));
-  wait_for_modal_dialog("unknownContentTypeWindow");
-  assert_true(
-    attachmentList.collapsed,
-    "Attachment list should not expand when clicking on attachmentName!"
-  );
-}
-
-/**
- * Test that right-clicking on a particular element opens the expected context
- * menu.
- *
- * @param elementId the id of the element to right click on
- * @param contextMenuId the id of the context menu that should appear
- */
-function subtest_attachment_right_click(elementId, contextMenuId) {
-  mc.rightClick(mc.eid(elementId));
-  wait_for_popup_to_open(mc.e(contextMenuId));
-  close_popup(mc, mc.eid(contextMenuId));
-}
-
-function test_attachment_right_click_single() {
-  be_in_folder(folder);
-
-  select_click_row(1);
-  assert_selected_and_displayed(1);
-
-  subtest_attachment_right_click("attachmentIcon", "attachmentItemContext");
-  subtest_attachment_right_click("attachmentCount", "attachmentItemContext");
-  subtest_attachment_right_click("attachmentName", "attachmentItemContext");
-  subtest_attachment_right_click("attachmentSize", "attachmentItemContext");
-
-  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"
-  );
-}
-
-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");
-  subtest_attachment_right_click("attachmentCount", "attachmentListContext");
-  subtest_attachment_right_click("attachmentSize", "attachmentListContext");
-
-  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"
-  );
-}
-
-/**
- * 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}!`
-  );
-  assert_attachment_list_focused();
-
-  mc.click(element);
-  assert_true(
-    attachmentList.collapsed,
-    `Attachment list should be collapsed 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);
-
-  assert_true(
-    mc.e("attachmentList").collapsed,
-    "Attachment list should start out collapsed!"
-  );
-
-  subtest_attachment_list_toggle("attachmentToggle");
-  subtest_attachment_list_toggle("attachmentIcon");
-  subtest_attachment_list_toggle("attachmentCount");
-  subtest_attachment_list_toggle("attachmentSize");
-  subtest_attachment_list_toggle("attachmentBar");
-
-  // Ensure that clicking the "Save All" button doesn't expand the attachment
-  // list.
-  mc.click(
-    new elementslib.Elem(
-      mc
-        .e("attachmentSaveAllSingle")
-        .querySelector(".toolbarbutton-menubutton-dropmarker")
-    )
-  );
-  assert_true(
-    mc.e("attachmentList").collapsed,
-    "Attachment list should be collapsed after clicking save button!"
-  );
-}
-
-function test_attachment_list_starts_expanded() {
-  ensure_starts_expanded(true);
-  be_in_folder(folder);
-
-  select_click_row(2);
-  assert_selected_and_displayed(2);
-
-  assert_true(
-    !mc.e("attachmentList").collapsed,
-    "Attachment list should start out expanded!"
-  );
-}
-
-function test_selected_attachments_are_cleared() {
-  ensure_starts_expanded(false);
-  be_in_folder(folder);
-  // First, select the message with two attachments.
-  select_click_row(3);
-
-  // Expand the attachment list.
-  mc.click(mc.eid("attachmentToggle"));
-
-  // Select both the attachments.
-  let attachmentList = mc.e("attachmentList");
-  assert_equals(
-    attachmentList.selectedItems.length,
-    1,
-    "On first load the first item should be selected"
-  );
-
-  // We can just click on the first element, but the second one needs a
-  // ctrl-click (or cmd-click for those Mac-heads among us).
-  mc.click(new elib.Elem(attachmentList.children[0]), 5, 5);
-  EventUtils.synthesizeMouse(
-    attachmentList.children[1],
-    5,
-    5,
-    { accelKey: true },
-    mc.window
-  );
-
-  assert_equals(
-    attachmentList.selectedItems.length,
-    2,
-    "We had the wrong number of selected items after selecting some!"
-  );
-
-  // Switch to the message with one attachment, and make sure there are no
-  // selected attachments.
-  select_click_row(2);
-
-  // Expand the attachment list again.
-  mc.click(mc.eid("attachmentToggle"));
-
-  assert_equals(
-    attachmentList.selectedItems.length,
-    1,
-    "After loading a new message the first item should be selected"
-  );
-}
-
-function test_select_all_attachments_key() {
-  be_in_folder(folder);
-
-  // First, select the message with two attachments.
-  select_none();
-  select_click_row(3);
-
-  // Expand the attachment list.
-  mc.click(mc.eid("attachmentToggle"));
-
-  let attachmentList = mc.e("attachmentList");
-  mc.keypress(new elib.Elem(attachmentList), "a", { accelKey: true });
-  assert_equals(
-    attachmentList.selectedItems.length,
-    2,
-    "Should have selected all attachments!"
-  );
-}
-
-function test_delete_attachment_key() {
-  be_in_folder(folder);
-
-  // First, select the message with two attachments.
-  select_none();
-  select_click_row(3);
-
-  // Expand the attachment list.
-  mc.click(mc.eid("attachmentToggle"));
-
-  let firstAttachment = new elib.Elem(mc.e("attachmentList").firstElementChild);
-  mc.click(firstAttachment, 5, 5);
-
-  // Try deleting with the delete key
-  plan_for_modal_dialog("commonDialogWindow", function(cdc) {
-    cdc.window.document.documentElement.querySelector("dialog").cancelDialog();
-  });
-  mc.keypress(firstAttachment, "VK_DELETE", {});
-  wait_for_modal_dialog("commonDialogWindow");
-
-  // Try deleting with the shift-delete key combo.
-  plan_for_modal_dialog("commonDialogWindow", function(cdc) {
-    cdc.window.document.documentElement.querySelector("dialog").cancelDialog();
-  });
-  mc.keypress(firstAttachment, "VK_DELETE", { shiftKey: true });
-  wait_for_modal_dialog("commonDialogWindow");
-}
-
-function test_attachments_compose_menu() {
-  be_in_folder(folder);
-
-  // First, select the message with two attachments.
-  select_none();
-  select_click_row(3);
-
-  let cwc = open_compose_with_forward();
-  let attachment = cwc.e("attachmentBucket");
-
-  // On Linux and OSX, focus events don't seem to be sent to child elements properly if
-  // the parent window is not focused.  This causes some random oranges for us.
-  // We use the force_focus function to "cheat" a bit, and trigger the function
-  // that focusing normally would fire.  We do normal focusing for Windows.
-  function force_focus(aId) {
-    let element = cwc.e(aId);
-    element.focus();
-
-    if (!mc.mozmillModule.isWindows) {
-      // First, call the window's default controller's function.
-      cwc.window.defaultController.isCommandEnabled("cmd_delete");
-
-      // Walk up the DOM tree and call isCommandEnabled on the first controller
-      // that supports "cmd_delete".
-      while (element != cwc.window.document) {
-        for (let i = 0; i < element.controllers.getControllerCount(); i++) {
-          let currController = element.controllers.getControllerAt(i);
-          if (currController.supportsCommand("cmd_delete")) {
-            currController.isCommandEnabled("cmd_delete");
-            return;
-          }
-        }
-        element = element.parentNode;
-      }
-    }
-  }
-
-  // Click on a portion of the attachmentBucket that will focus it, but not
-  // bring up the file picker
-  force_focus("attachmentBucket");
-  assert_equals(
-    "Remove Attachments",
-    cwc.e("cmd_delete").getAttribute("label"),
-    "attachmentBucket is focused!"
-  );
-
-  // Select 1 attachment, and
-  // focus the subject to see the label change and to execute isCommandEnabled
-  attachment.selectedIndex = 0;
-  force_focus("msgSubject");
-  assert_equals(
-    "Delete",
-    cwc.e("cmd_delete").getAttribute("label"),
-    "attachmentBucket is not focused!"
-  );
-
-  // Focus back to the attachmentBucket
-  force_focus("attachmentBucket");
-  assert_equals(
-    "Remove Attachment",
-    cwc.e("cmd_delete").getAttribute("label"),
-    "Only 1 attachment is selected!"
-  );
-
-  // Select multiple attachments, and focus the identity for the same purpose
-  attachment.selectAll();
-  force_focus("msgIdentity");
-  assert_equals(
-    "Delete",
-    cwc.e("cmd_delete").getAttribute("label"),
-    "attachmentBucket is not focused!"
-  );
-
-  // Focus back to the attachmentBucket
-  force_focus("attachmentBucket");
-  assert_equals(
-    "Remove Attachments",
-    cwc.e("cmd_delete").getAttribute("label"),
-    "Multiple attachments are selected!"
-  );
-
-  close_compose_window(cwc);
-}
-
-function test_delete_from_toolbar() {
-  be_in_folder(folder);
-
-  // First, select the message with two attachments.
-  select_none();
-  select_click_row(3);
-
-  // Expand the attachment list.
-  mc.click(mc.eid("attachmentToggle"));
-
-  let firstAttachment = new elib.Elem(mc.e("attachmentList").firstElementChild);
-  mc.click(firstAttachment, 5, 5);
-
-  // Make sure clicking the "Delete" toolbar button with an attachment focused
-  // deletes the *message*.
-  plan_to_wait_for_folder_events("DeleteOrMoveMsgCompleted");
-  mc.click(mc.eid("hdrTrashButton"));
-  wait_for_folder_events();
-}
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/data/testFile1
+++ /dev/null
@@ -1,1 +0,0 @@
-Thundercats single-origin coffee culpa, irony minim vero sunt laborum synth aesthetic. Wayfarers photo booth dolore 8-bit, DIY four loko skateboard forage portland id consectetur. Aesthetic aliquip raw denim aute tofu consequat. Before they sold out etsy cliche marfa, magna seitan fixie brooklyn voluptate laborum messenger bag chillwave narwhal truffaut. Cray cupidatat PBR delectus aliqua synth cillum gentrify. Aesthetic do vegan etsy locavore. Veniam assumenda ea, cupidatat aute vero qui.
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/data/testFile2
+++ /dev/null
@@ -1,3 +0,0 @@
-Nesciunt odio minim, cupidatat photo booth non post-ironic street art banh mi salvia duis aesthetic squid single-origin coffee. Ex DIY trust fund butcher, esse mustache consequat authentic bushwick twee gentrify hella PBR kogi sustainable. PBR nihil VHS veniam, occaecat dreamcatcher odio iphone irony vero seitan mollit fanny pack adipisicing. Swag jean shorts labore, aesthetic dolore letterpress gluten-free lomo ex wes anderson. Et street art cred Austin velit, raw denim do blog godard leggings. Accusamus adipisicing excepteur occaecat cray sriracha. Leggings brunch artisan occaecat, 3 wolf moon forage mlkshk ad farm-to-table.
-
-
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/data/testFile3
+++ /dev/null
@@ -1,3 +0,0 @@
-Commodo et laborum fingerstache semiotics etsy. Organic locavore next level, master cleanse raw denim consectetur wes anderson ethical tempor photo booth quis. Leggings pop-up sed trust fund. Chillwave godard velit high life, typewriter umami trust fund. Laboris aliquip assumenda you probably haven't heard of them exercitation portland. Ea do selvage, stumptown dolore etsy commodo tattooed kogi assumenda. Aute tempor carles consequat cray locavore.
-
-Craft beer consectetur anim ex fap consequat, helvetica hella nihil retro before they sold out letterpress cillum mlkshk. Deserunt tempor scenester put a bird on it kale chips mlkshk occaecat, et umami artisan letterpress raw denim sapiente. Echo park pork belly marfa sunt. Iphone aesthetic fanny pack mollit. Irony pork belly bespoke, shoreditch locavore fixie iphone officia mollit mlkshk consequat hoodie mixtape. Nisi consectetur locavore, godard whatever occaecat id blog ethical wolf hoodie PBR. Trust fund sunt mustache, enim eiusmod aesthetic helvetica leggings pinterest laboris polaroid brooklyn.
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/data/testFile4
+++ /dev/null
@@ -1,1 +0,0 @@
-Ullamco farm-to-table banh mi, echo park dolor lomo chillwave seitan cred ad mustache 3 wolf moon excepteur. Odd future placeat sint, cliche consequat portland banksy vinyl 3 wolf moon high life you probably haven't heard of them nisi jean shorts. Eu freegan skateboard, kogi etsy beard aliquip blog sapiente pour-over sunt. Cosby sweater jean shorts wayfarers keytar trust fund, four loko pitchfork pinterest forage semiotics lo-fi cray beard swag butcher. Odd future cred swag, pork belly keytar velit terry richardson locavore id brunch excepteur commodo occupy mollit pickled. Street art voluptate pickled fap, ad craft beer cupidatat messenger bag placeat helvetica. Enim raw denim occupy pork belly irure et.
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/html/settings-with-link.xhtml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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/.  -->
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <body>
-    <a id="a" href="https://www.example.com/">Click me!</a>
-  </body>
-</html>
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js
+++ /dev/null
@@ -1,198 +0,0 @@
-/* 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 Filelink attachment item behaviour.
- */
-
-"use strict";
-
-var {
-  gMockFilePicker,
-  gMockFilePickReg,
-  select_attachments,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AttachmentHelpers.jsm"
-);
-var {
-  collectFiles,
-  getFile,
-  gMockCloudfileManager,
-  MockCloudfileAccount,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/CloudfileHelpers.jsm"
-);
-var {
-  add_cloud_attachments,
-  close_compose_window,
-  open_compose_new_mail,
-} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
-var { assert_false, close_popup } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-
-var kAttachmentItemContextID = "msgComposeAttachmentItemContext";
-
-var { cloudFileAccounts } = ChromeUtils.import(
-  "resource:///modules/cloudFileAccounts.jsm"
-);
-
-function setupModule(module) {
-  gMockFilePickReg.register();
-  gMockCloudfileManager.register();
-}
-
-function teardownModule(module) {
-  gMockCloudfileManager.unregister();
-  gMockFilePickReg.unregister();
-}
-
-/**
- * Test that when an upload has been started, we can cancel and restart
- * the upload, and then cancel again.  For this test, we repeat this
- * 3 times.
- */
-function test_upload_cancel_repeat() {
-  const kFile = "./data/testFile1";
-
-  // Prepare the mock file picker to return our test file.
-  let file = getFile(kFile, __file__);
-  gMockFilePicker.returnFiles = [file];
-
-  let provider = new MockCloudfileAccount();
-  provider.init("someKey");
-  let cw = open_compose_new_mail();
-
-  // We've got a compose window open, and our mock Filelink provider
-  // ready.  Let's attach a file...
-  cw.window.AttachFile();
-
-  // Now we override the uploadFile function of the MockCloudfileAccount
-  // so that we're perpetually uploading...
-  let promise;
-  let started;
-  provider.uploadFile = function(aFile) {
-    return new Promise((resolve, reject) => {
-      promise = { resolve, reject };
-      started = true;
-    });
-  };
-
-  const kAttempts = 3;
-  for (let i = 0; i < kAttempts; i++) {
-    promise = null;
-    started = false;
-
-    // Select the attachment, and choose to convert it to a Filelink
-    select_attachments(cw, 0)[0];
-    cw.window.convertSelectedToCloudAttachment(provider);
-    cw.waitFor(() => started);
-
-    assert_can_cancel_upload(cw, provider, promise, file);
-  }
-
-  close_compose_window(cw);
-}
-
-/**
- * Test that we can cancel a whole series of files being uploaded at once.
- */
-function test_upload_multiple_and_cancel() {
-  const kFiles = ["./data/testFile1", "./data/testFile2", "./data/testFile3"];
-
-  // Prepare the mock file picker to return our test file.
-  let files = collectFiles(kFiles, __file__);
-  gMockFilePicker.returnFiles = files;
-
-  let provider = new MockCloudfileAccount();
-  provider.init("someKey");
-  let cw = open_compose_new_mail();
-
-  let promise;
-  provider.uploadFile = function(aFile) {
-    return new Promise((resolve, reject) => {
-      promise = { resolve, reject };
-    });
-  };
-
-  add_cloud_attachments(cw, provider, false);
-
-  for (let i = files.length - 1; i >= 0; --i) {
-    assert_can_cancel_upload(cw, provider, promise, files[i]);
-  }
-
-  close_compose_window(cw);
-}
-
-/**
- * Helper function that takes an upload in progress, and cancels it,
- * ensuring that the nsIMsgCloduFileProvider.uploadCanceled status message
- * is returned to the passed in listener.
- *
- * @param aController the compose window controller to use.
- * @param aProvider a MockCloudfileAccount for which the uploads have already
- *                  started.
- * @param aListener the nsIRequestObserver passed to aProvider's uploadFile
- *                  function.
- * @param aTargetFile the nsIFile to cancel the upload for.
- */
-function assert_can_cancel_upload(
-  aController,
-  aProvider,
-  aPromise,
-  aTargetFile
-) {
-  let cancelled = false;
-
-  // Override the provider's cancelFileUpload function.  We can do this because
-  // it's assumed that the provider is a MockCloudfileAccount.
-  aProvider.cancelFileUpload = function(aFileToCancel) {
-    if (aTargetFile.equals(aFileToCancel)) {
-      aPromise.reject(cloudFileAccounts.constants.uploadCancelled);
-      cancelled = true;
-    }
-  };
-
-  // Retrieve the attachment bucket index for the target file...
-  let index = get_attachmentitem_index_for_file(aController, aTargetFile);
-
-  // Select that attachmentitem in the bucket
-  select_attachments(aController, index)[0];
-
-  // Bring up the context menu, and click cancel.
-  let cmd = aController.e("cmd_cancelUpload");
-  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.
-  close_popup(aController, aController.eid(kAttachmentItemContextID));
-  aController.waitFor(() => cancelled);
-}
-
-/**
- * A helper function to find the attachment bucket index for a particular
- * nsIFile. Returns null if no attachmentitem is found.
- *
- * @param aController the compose window controller to use.
- * @param aFile the nsIFile to search for.
- */
-function get_attachmentitem_index_for_file(aController, aFile) {
-  // Get the fileUrl from the file.
-  let fileUrl = aController.window.FileToAttachment(aFile).url;
-
-  // Get the bucket, and go through each item looking for the matching
-  // attachmentitem.
-  let bucket = aController.e("attachmentBucket");
-  for (let i = 0; i < bucket.getRowCount(); ++i) {
-    let attachmentitem = bucket.getItemAtIndex(i);
-    if (attachmentitem.attachment.url == fileUrl) {
-      return i;
-    }
-  }
-  return null;
-}
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
+++ /dev/null
@@ -1,952 +0,0 @@
-/* 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 Filelink URL insertion behaviours in compose windows.
- */
-
-"use strict";
-
-var {
-  gMockFilePicker,
-  gMockFilePickReg,
-  select_attachments,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AttachmentHelpers.jsm"
-);
-var {
-  collectFiles,
-  gMockCloudfileManager,
-  MockCloudfileAccount,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/CloudfileHelpers.jsm"
-);
-var {
-  add_cloud_attachments,
-  assert_previous_text,
-  get_compose_body,
-  open_compose_new_mail,
-  open_compose_with_forward,
-  open_compose_with_reply,
-  type_in_composer,
-} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
-var {
-  assert_next_nodes,
-  assert_previous_nodes,
-  wait_for_element,
-} = ChromeUtils.import("resource://testing-common/mozmill/DOMHelpers.jsm");
-var {
-  add_message_to_folder,
-  assert_equals,
-  assert_not_equals,
-  assert_selected_and_displayed,
-  assert_true,
-  be_in_folder,
-  create_message,
-  FAKE_SERVER_HOSTNAME,
-  get_special_folder,
-  mc,
-  select_click_row,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { close_window } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
-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;
-var kReplyOnBottom = 0;
-var kTextNodeType = 3;
-var kSigPrefKey = "mail.identity.id1.htmlSigText";
-var kSigOnReplyKey = "mail.identity.default.sig_on_reply";
-var kSigOnForwardKey = "mail.identity.default.sig_on_fwd";
-var kDefaultSigKey = "mail.identity.id1.htmlSigText";
-var kDefaultSig = "This is my signature.\n\nCheck out my website sometime!";
-var kFiles = ["./data/testFile1", "./data/testFile2"];
-var kLines = ["This is a line of text", "and here's another!"];
-
-var gInbox, gOldHtmlPref, gOldSigPref;
-
-function setupModule(module) {
-  // For replies and forwards, we'll work off a message in the Inbox folder
-  // of the fake "tinderbox" account.
-  let server = MailServices.accounts.FindServer(
-    "tinderbox",
-    FAKE_SERVER_HOSTNAME,
-    "pop3"
-  );
-  gInbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
-  add_message_to_folder(gInbox, create_message());
-
-  gMockFilePickReg.register();
-  gMockCloudfileManager.register();
-
-  // These tests assume that we default to writing mail in HTML.  We'll
-  // save the current preference, force defaulting to HTML, and restore the
-  // pref in teardownModule.
-  gOldHtmlPref = Services.prefs.getBoolPref(kHtmlPrefKey);
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-  // Same goes for the default signature.
-  gOldSigPref = Services.prefs.getCharPref(kDefaultSigKey);
-
-  // Don't create paragraphs in the test.
-  // The test fails if it encounters paragraphs <p> instead of breaks <br>.
-  Services.prefs.setBoolPref("mail.compose.default_to_paragraph", false);
-}
-
-function teardownModule(module) {
-  gMockCloudfileManager.unregister();
-  gMockFilePickReg.unregister();
-  Services.prefs.setCharPref(kDefaultSigKey, gOldSigPref);
-  Services.prefs.setBoolPref(kHtmlPrefKey, gOldHtmlPref);
-  Services.prefs.clearUserPref("mail.compose.default_to_paragraph");
-}
-
-function setupTest() {
-  // If our signature got accidentally wiped out, let's just put it back.
-  Services.prefs.setCharPref(kDefaultSigKey, kDefaultSig);
-}
-
-/**
- * Given some compose window controller, wait for some Filelink URLs to be
- * inserted.
- *
- * @param aController the controller for a compose window.
- * @param aNumUrls the number of Filelink URLs that are expected.
- * @returns an array containing the root containment node, the list node, and
- *          an array of the link URL nodes.
- */
-function wait_for_attachment_urls(aController, aNumUrls) {
-  let mailBody = get_compose_body(aController);
-
-  // Wait until we can find the root attachment URL node...
-  let root = wait_for_element(
-    mailBody.parentNode,
-    "body > #cloudAttachmentListRoot"
-  );
-
-  let list = wait_for_element(
-    mailBody,
-    "#cloudAttachmentListRoot > #cloudAttachmentList"
-  );
-
-  let urls = null;
-  aController.waitFor(function() {
-    urls = mailBody.querySelectorAll(
-      "#cloudAttachmentList > .cloudAttachmentItem"
-    );
-    return urls != null && urls.length == aNumUrls;
-  });
-
-  return [root, list, urls];
-}
-
-/**
- * Helper function that sets up the mock file picker for a series of files,
- * spawns a reply window for the first message in the gInbox, optionally
- * types some strings into the compose window, and then attaches some
- * Filelinks.
- *
- * @param aText an array of strings to type into the compose window. Each
- *              string is followed by pressing the RETURN key, except for
- *              the final string.  Pass an empty array if you don't want
- *              anything typed.
- * @param aFiles an array of filename strings for files located beneath
- *               the test directory.
- */
-function prepare_some_attachments_and_reply(aText, aFiles) {
-  gMockFilePicker.returnFiles = collectFiles(aFiles, __file__);
-
-  let provider = new MockCloudfileAccount();
-  provider.init("someKey");
-
-  be_in_folder(gInbox);
-  let msg = select_click_row(0);
-  assert_selected_and_displayed(mc, msg);
-
-  let cw = open_compose_with_reply();
-
-  // If we have any typing to do, let's do it.
-  type_in_composer(cw, aText);
-  add_cloud_attachments(cw, provider);
-  return cw;
-}
-
-/**
- * Helper function that sets up the mock file picker for a series of files,
- * spawns an inline forward compose window for the first message in the gInbox,
- * optionally types some strings into the compose window, and then attaches
- * some Filelinks.
- *
- * @param aText an array of strings to type into the compose window. Each
- *              string is followed by pressing the RETURN key, except for
- *              the final string.  Pass an empty array if you don't want
- *              anything typed.
- * @param aFiles an array of filename strings for files located beneath
- *               the test directory.
- */
-function prepare_some_attachments_and_forward(aText, aFiles) {
-  gMockFilePicker.returnFiles = collectFiles(aFiles, __file__);
-
-  let provider = new MockCloudfileAccount();
-  provider.init("someKey");
-
-  be_in_folder(gInbox);
-  let msg = select_click_row(0);
-  assert_selected_and_displayed(mc, msg);
-
-  let cw = open_compose_with_forward();
-
-  // Put the selection at the beginning of the document...
-  let editor = cw.window.GetCurrentEditor();
-  editor.beginningOfDocument();
-
-  // Do any necessary typing...
-  type_in_composer(cw, aText);
-  add_cloud_attachments(cw, provider);
-  return cw;
-}
-
-/**
- * Helper function that runs a test function with signature-in-reply and
- * signature-in-forward enabled, and then runs the test again with those
- * prefs disabled.
- *
- * @param aSpecialTest a test that takes two arguments - the first argument
- *                     is the aText array of any text that should be typed,
- *                     and the second is a boolean for whether or not the
- *                     special test should expect a signature or not.
- * @param aText any text to be typed into the compose window, passed to
- *              aSpecialTest.
- */
-function try_with_and_without_signature_in_reply_or_fwd(aSpecialTest, aText) {
-  // By default, we have a signature included in replies, so we'll start
-  // with that.
-  Services.prefs.setBoolPref(kSigOnReplyKey, true);
-  Services.prefs.setBoolPref(kSigOnForwardKey, true);
-  aSpecialTest(aText, true);
-
-  Services.prefs.setBoolPref(kSigOnReplyKey, false);
-  Services.prefs.setBoolPref(kSigOnForwardKey, false);
-  aSpecialTest(aText, false);
-}
-
-/**
- * Helper function that runs a test function without a signature, once
- * in HTML mode, and again in plaintext mode.
- *
- * @param aTest a test that takes no arguments.
- */
-function try_without_signature(aTest) {
-  let oldSig = Services.prefs.getCharPref(kSigPrefKey);
-  Services.prefs.setCharPref(kSigPrefKey, "");
-
-  try_with_plaintext_and_html_mail(aTest);
-  Services.prefs.setCharPref(kSigPrefKey, oldSig);
-}
-
-/**
- * Helper function that runs a test function for HTML mail composition, and
- * then again in plaintext mail composition.
- *
- * @param aTest a test that takes no arguments.
- */
-function try_with_plaintext_and_html_mail(aTest) {
-  aTest();
-  Services.prefs.setBoolPref(kHtmlPrefKey, false);
-  aTest();
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-}
-
-/**
- * Test that if we open up a composer and immediately attach a Filelink,
- * a linebreak is inserted before the containment node in order to allow
- * the user to write before the attachment URLs.  This assumes the user
- * does not have a signature already inserted into the message body.
- */
-function test_inserts_linebreak_on_empty_compose() {
-  try_without_signature(subtest_inserts_linebreak_on_empty_compose);
-}
-
-/**
- * Subtest for test_inserts_linebreak_on_empty_compose - can be executed
- * on both plaintext and HTML compose windows.
- */
-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] = 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);
-
-  assert_equals(
-    mailBody.firstChild,
-    br,
-    "The linebreak should be the first child of the compose body"
-  );
-
-  close_window(cw);
-}
-
-/**
- * Test that if we open up a composer and immediately attach a Filelink,
- * a linebreak is inserted before the containment node. This test also
- * ensures that, with a signature already in the compose window, we don't
- * accidentally insert the attachment URL containment within the signature
- * node.
- */
-function test_inserts_linebreak_on_empty_compose_with_signature() {
-  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] = 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
-  // that is the signature.
-  br = assert_next_nodes("br", root, 1);
-
-  let pre = br.nextSibling;
-  assert_equals(
-    pre.localName,
-    "pre",
-    "The linebreak should be followed by the signature pre"
-  );
-  assert_true(
-    pre.classList.contains("moz-signature"),
-    "The pre should have the moz-signature class"
-  );
-
-  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] = 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
-  // that is the signature.
-  br = assert_next_nodes("br", root, 1);
-
-  let div = br.nextSibling;
-  assert_equals(
-    div.localName,
-    "div",
-    "The linebreak should be followed by the signature div"
-  );
-  assert_true(
-    div.classList.contains("moz-signature"),
-    "The div should have the moz-signature class"
-  );
-
-  close_window(cw);
-
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-}
-
-/**
- * Tests that removing all Filelinks causes the root node to be removed.
- */
-function test_removing_filelinks_removes_root_node() {
-  try_with_plaintext_and_html_mail(
-    subtest_removing_filelinks_removes_root_node
-  );
-}
-
-/**
- * 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] = 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() {
-    let result = mailBody.querySelector(root.id);
-    return result == null;
-  }, "Timed out waiting for attachment container to be removed");
-
-  close_window(cw);
-}
-
-/**
- * Test that if we write some text in an empty message (no signature),
- * and the selection is at the end of a line of text, attaching some Filelinks
- * causes the attachment URL container to be separated from the text by
- * two br tags.
- */
-function test_adding_filelinks_to_written_message() {
-  try_without_signature(subtest_adding_filelinks_to_written_message);
-}
-
-/**
- * Subtest for test_adding_filelinks_to_written_message - generalized for both
- * HTML and plaintext mail.
- */
-function subtest_adding_filelinks_to_written_message() {
-  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] = 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 " +
-      "two linebreaks"
-  );
-  close_window(cw);
-}
-
-/**
- * Tests for inserting Filelinks into a reply, when we're configured to
- * reply above the quote.
- */
-function test_adding_filelinks_to_empty_reply_above() {
-  let oldReplyOnTop = Services.prefs.getIntPref(kReplyOnTopKey);
-  Services.prefs.setIntPref(kReplyOnTopKey, kReplyOnTop);
-
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_reply_above,
-    []
-  );
-  // Now with HTML mail...
-  Services.prefs.setBoolPref(kHtmlPrefKey, false);
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_reply_above_plaintext,
-    []
-  );
-
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-  Services.prefs.setIntPref(kReplyOnTopKey, oldReplyOnTop);
-}
-
-/**
- * Tests for inserting Filelinks into a reply, when we're configured to
- * reply above the quote, after entering some text.
- */
-function test_adding_filelinks_to_nonempty_reply_above() {
-  let oldReplyOnTop = Services.prefs.getIntPref(kReplyOnTopKey);
-  Services.prefs.setIntPref(kReplyOnTopKey, kReplyOnTop);
-
-  subtest_adding_filelinks_to_reply_above(kLines);
-
-  Services.prefs.setBoolPref(kHtmlPrefKey, false);
-  subtest_adding_filelinks_to_reply_above_plaintext(kLines);
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-
-  Services.prefs.setIntPref(kReplyOnTopKey, oldReplyOnTop);
-}
-
-/**
- * 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] = 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;
-  assert_equals(
-    div.localName,
-    "div",
-    "The linebreak should be followed by a div"
-  );
-
-  assert_true(div.classList.contains("moz-cite-prefix"));
-
-  if (aText.length) {
-    br = assert_previous_nodes("br", root, 2);
-  } else {
-    br = assert_previous_nodes("br", root, 1);
-  }
-
-  if (aText.length == 0) {
-    // If we didn't type anything, that br should be the first element of the
-    // message body.
-    let msgBody = get_compose_body(cw);
-    assert_equals(
-      msgBody.firstChild,
-      br,
-      "The linebreak should have been the first element in the " +
-        "message body"
-    );
-  } else {
-    let targetText = aText[aText.length - 1];
-    let textNode = br.previousSibling;
-    assert_equals(textNode.nodeType, kTextNodeType);
-    assert_equals(textNode.nodeValue, targetText);
-  }
-
-  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] = 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;
-  assert_equals(
-    div.localName,
-    "div",
-    "The linebreak should be followed by a div"
-  );
-
-  assert_true(div.classList.contains("moz-cite-prefix"));
-
-  close_window(cw);
-}
-
-/**
- * Tests for inserting Filelinks into a reply, when we're configured to
- * reply below the quote.
- */
-function test_adding_filelinks_to_empty_reply_below() {
-  let oldReplyOnTop = Services.prefs.getIntPref(kReplyOnTopKey);
-  Services.prefs.setIntPref(kReplyOnTopKey, kReplyOnBottom);
-
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_reply_below,
-    []
-  );
-  Services.prefs.setBoolPref(kHtmlPrefKey, false);
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_plaintext_reply_below,
-    []
-  );
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-
-  Services.prefs.setIntPref(kReplyOnTopKey, oldReplyOnTop);
-}
-
-/**
- * Tests for inserting Filelinks into a reply, when we're configured to
- * reply below the quote, after entering some text.
- */
-function test_adding_filelinks_to_nonempty_reply_below() {
-  let oldReplyOnTop = Services.prefs.getIntPref(kReplyOnTopKey);
-  Services.prefs.setIntPref(kReplyOnTopKey, kReplyOnBottom);
-
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_reply_below,
-    kLines
-  );
-
-  Services.prefs.setBoolPref(kHtmlPrefKey, false);
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_plaintext_reply_below,
-    kLines
-  );
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-
-  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] = 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) {
-    // If there was any text inserted, check for 2 previous br nodes, and then
-    // the inserted text, and then the blockquote.
-    br = assert_previous_nodes("br", root, 2);
-    let textNode = assert_previous_text(br.previousSibling, aText);
-    blockquote = textNode.previousSibling;
-  } else {
-    // If no text was inserted, check for 1 previous br node, and then the
-    // blockquote.
-    br = assert_previous_nodes("br", root, 1);
-    blockquote = br.previousSibling;
-  }
-
-  assert_equals(
-    blockquote.localName,
-    "blockquote",
-    "The linebreak should be preceded by a blockquote."
-  );
-
-  let prefix = blockquote.previousSibling;
-  assert_equals(
-    prefix.localName,
-    "div",
-    "The blockquote should be preceded by the prefix div"
-  );
-  assert_true(
-    prefix.classList.contains("moz-cite-prefix"),
-    "The prefix should have the moz-cite-prefix class"
-  );
-
-  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] = 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...
-    let textNode = assert_previous_text(br.previousSibling, aText);
-    // And then grab the span, which should be before the final text node.
-    span = textNode.previousSibling;
-  } else {
-    br = assert_previous_nodes("br", root, 1);
-    // If no text was entered, just grab the last br's previous sibling - that
-    // will be the span.
-    span = br.previousSibling;
-    // Sometimes we need to skip one more linebreak.
-    if (span.localName != "span") {
-      span = span.previousSibling;
-    }
-  }
-
-  assert_equals(
-    span.localName,
-    "span",
-    "The linebreak should be preceded by a span."
-  );
-
-  let prefix = span.previousSibling;
-  assert_equals(
-    prefix.localName,
-    "div",
-    "The blockquote should be preceded by the prefix div"
-  );
-  assert_true(
-    prefix.classList.contains("moz-cite-prefix"),
-    "The prefix should have the moz-cite-prefix class"
-  );
-
-  close_window(cw);
-}
-
-/**
- * Tests Filelink insertion on an inline-forward compose window with nothing
- * typed into it.
- */
-function test_adding_filelinks_to_empty_forward() {
-  Services.prefs.setIntPref(kReplyOnTopKey, kReplyOnTop);
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_forward,
-    []
-  );
-  Services.prefs.setBoolPref(kHtmlPrefKey, false);
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_forward,
-    []
-  );
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-}
-
-/**
- * Tests Filelink insertion on an inline-forward compose window with some
- * text typed into it.
- */
-function test_adding_filelinks_to_forward() {
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_forward,
-    kLines
-  );
-  Services.prefs.setBoolPref(kHtmlPrefKey, false);
-  try_with_and_without_signature_in_reply_or_fwd(
-    subtest_adding_filelinks_to_forward,
-    kLines
-  );
-  Services.prefs.setBoolPref(kHtmlPrefKey, true);
-}
-
-/**
- * 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] = 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);
-    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);
-  }
-
-  close_window(cw);
-}
-
-/**
- * Test that if we convert a Filelink from one provider to another, that the
- * old Filelink is removed, and a new Filelink is added for the new provider.
- * We test this on both HTML and plaintext mail.
- */
-function test_converting_filelink_updates_urls() {
-  try_with_plaintext_and_html_mail(subtest_converting_filelink_updates_urls);
-}
-
-/**
- * Subtest for test_converting_filelink_updates_urls that creates two
- * storage provider accounts, uploads files to one, converts them to the
- * other, and ensures that the attachment links in the message body get
- * get updated.
- */
-function subtest_converting_filelink_updates_urls() {
-  gMockFilePicker.returnFiles = collectFiles(kFiles, __file__);
-  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 [, , 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);
-    [, , 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);
-}
-
-/**
- * Test that if we convert a Filelink to a normal attachment that the
- * Filelink is removed from the message body.
- */
-function test_converting_filelink_to_normal_removes_url() {
-  try_with_plaintext_and_html_mail(
-    subtest_converting_filelink_to_normal_removes_url
-  );
-}
-
-/**
- * Subtest for test_converting_filelink_to_normal_removes_url that adds
- * some Filelinks to an email, and then converts those Filelinks back into
- * normal attachments, checking to ensure that the links are removed from
- * the body of the email.
- */
-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] = 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));
-  }
-
-  // At this point, the root should also have been removed.
-  let mailBody = get_compose_body(cw);
-  root = mailBody.querySelector("#cloudAttachmentListRoot");
-  if (root) {
-    throw new Error("Should not have found the cloudAttachmentListRoot");
-  }
-
-  close_window(cw);
-}
-
-/**
- * Tests that if the user manually removes the Filelinks from the message body
- * that it doesn't break future Filelink insertions. Tests both HTML and
- * plaintext composers.
- */
-function test_filelinks_work_after_manual_removal() {
-  try_with_plaintext_and_html_mail(subtest_filelinks_work_after_manual_removal);
-}
-
-/**
- * Subtest that first adds some Filelinks to the message body, removes them,
- * and then adds another Filelink ensuring that the new URL is successfully
- * inserted.
- */
-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] = 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] = 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.
- */
-function test_insertion_restores_caret_point() {
-  try_with_plaintext_and_html_mail(subtest_insertion_restores_caret_point);
-}
-
-/**
- * Subtest that types some things into the composer, finishes on two
- * linebreaks, inserts some Filelink URLs, and then types some more,
- * ensuring that the selection is where we expect it to be.
- */
-function subtest_insertion_restores_caret_point() {
-  // Insert some Filelinks...
-  gMockFilePicker.returnFiles = collectFiles(kFiles, __file__);
-  let provider = new MockCloudfileAccount();
-  provider.init("someKey");
-
-  let cw = open_compose_new_mail();
-
-  // Put the selection at the beginning of the document...
-  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] = 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.
-  assert_previous_text(root.previousSibling, [kTypedIn]);
-
-  close_window(cw);
-}
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/test-cloudfile-manager.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/* 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 richlistbox in the manager for attachment storage
- * services
- */
-
-"use strict";
-
-var { gMockCloudfileManager } = ChromeUtils.import(
-  "resource://testing-common/mozmill/CloudfileHelpers.jsm"
-);
-var { content_tab_e, gMockExtProtSvc, gMockExtProtSvcReg } = ChromeUtils.import(
-  "resource://testing-common/mozmill/ContentTabHelpers.jsm"
-);
-var { assert_equals, mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { close_pref_tab, open_pref_tab } = ChromeUtils.import(
-  "resource://testing-common/mozmill/PrefTabHelpers.jsm"
-);
-var { wait_for_frame_load } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
-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) {
-  gMockCloudfileManager.register(kTestAccountType, {
-    managementURL: kSettingsWithLink,
-  });
-
-  // Let's set up a few dummy accounts;
-  create_dummy_account("someKey1", kTestAccountType, "carl's Account");
-  create_dummy_account("someKey2", kTestAccountType, "Amber's Account");
-  create_dummy_account("someKey3", kTestAccountType, "alice's Account");
-  create_dummy_account("someKey4", kTestAccountType, "Bob's Account");
-}
-
-function teardownModule(module) {
-  Services.prefs
-    .QueryInterface(Ci.nsIPrefBranch)
-    .deleteBranch("mail.cloud_files.accounts");
-  gMockCloudfileManager.unregister(kTestAccountType);
-}
-
-function create_dummy_account(aKey, aType, aDisplayName) {
-  Services.prefs.setCharPref(
-    "mail.cloud_files.accounts." + aKey + ".type",
-    aType
-  );
-
-  Services.prefs.setCharPref(
-    "mail.cloud_files.accounts." + aKey + ".displayName",
-    aDisplayName
-  );
-}
-
-function destroy_account(aKey) {
-  Services.prefs.clearUserPref("mail.cloud_files.accounts." + aKey);
-}
-
-/**
- * Tests that we load the accounts and display them in the
- * account richlistbox in the correct order (by displayName,
- * case-insensitive)
- */
-function test_load_accounts_and_properly_order() {
-  let prefTab = open_pref_tab("paneCompose", "compositionAttachmentsCategory");
-
-  let richList = content_tab_e(prefTab, "cloudFileView");
-  assert_equals(4, richList.itemCount, "Should be displaying 4 accounts");
-
-  // Since we're sorting alphabetically by the displayName,
-  // case-insensitive, the items should be ordered with the
-  // following accountKeys:
-  //
-  // someKey3, someKey2, someKey4, someKey1
-  const kExpected = ["someKey3", "someKey2", "someKey4", "someKey1"];
-
-  for (let [index, expectedKey] of kExpected.entries()) {
-    let item = richList.getItemAtIndex(index);
-    assert_equals(expectedKey, item.value, "The account list is out of order");
-  }
-
-  close_pref_tab(prefTab);
-}
-
-/**
- * Tests that a link in the management pane is loaded in
- * a browser and not in the management pane.
- */
-test_external_link.__force_skip__ = true;
-function test_external_link() {
-  gMockExtProtSvcReg.register();
-
-  let prefTab = open_pref_tab("paneCompose", "compositionAttachmentsCategory");
-  content_tab_e(prefTab, "cloudFileView").selectedIndex = 0;
-
-  let iframe = content_tab_e(prefTab, "cloudFileSettingsWrapper")
-    .firstElementChild;
-  wait_for_frame_load(iframe, kSettingsWithLink + "?accountId=someKey3");
-  mc.click(new elementslib.ID(iframe.contentDocument, "a"));
-
-  let targetHref = "https://www.example.com/";
-  mc.waitFor(
-    () => gMockExtProtSvc.urlLoaded(targetHref),
-    `Timed out waiting for the link ${targetHref} to be opened in the default browser.`
-  );
-  close_pref_tab(prefTab);
-
-  gMockExtProtSvcReg.unregister();
-}
deleted file mode 100644
--- a/mail/test/mozmill/cloudfile/test-cloudfile-notifications.js
+++ /dev/null
@@ -1,540 +0,0 @@
-/* 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 cloudfile notifications work as they should.
- */
-
-"use strict";
-
-var {
-  gMockFilePicker,
-  gMockFilePickReg,
-  select_attachments,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/AttachmentHelpers.jsm"
-);
-var {
-  collectFiles,
-  gMockCloudfileManager,
-  MockCloudfileAccount,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/CloudfileHelpers.jsm"
-);
-var {
-  add_attachments,
-  add_cloud_attachments,
-  close_compose_window,
-  open_compose_new_mail,
-} = ChromeUtils.import("resource://testing-common/mozmill/ComposeHelpers.jsm");
-var { mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var {
-  assert_notification_displayed,
-  close_notification,
-  wait_for_notification_to_stop,
-} = ChromeUtils.import(
-  "resource://testing-common/mozmill/NotificationBoxHelpers.jsm"
-);
-var { gMockPromptService } = ChromeUtils.import(
-  "resource://testing-common/mozmill/PromptHelpers.jsm"
-);
-
-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";
-
-var kBoxId = "compose-notification-bottom";
-
-function setupModule(module) {
-  gMockCloudfileManager.register();
-  gMockFilePickReg.register();
-
-  maxSize = Services.prefs.getIntPref(kOfferThreshold, 0) * 1024;
-  oldInsertNotificationPref = Services.prefs.getBoolPref(
-    kInsertNotificationPref
-  );
-  Services.prefs.setBoolPref(kInsertNotificationPref, true);
-}
-
-function teardownModule(module) {
-  gMockCloudfileManager.unregister();
-  gMockFilePickReg.unregister();
-  Services.prefs.setBoolPref(
-    kInsertNotificationPref,
-    oldInsertNotificationPref
-  );
-}
-
-/**
- * A helper function to assert that the Filelink offer notification is
- * either displayed or not displayed.
- *
- * @param aController the controller of the compose window to check.
- * @param aDisplayed true if the notification should be displayed, false
- *                   otherwise.
- */
-function assert_cloudfile_notification_displayed(aController, aDisplayed) {
-  assert_notification_displayed(
-    aController,
-    kBoxId,
-    "bigAttachment",
-    aDisplayed
-  );
-}
-
-/**
- * A helper function to assert that the Filelink upload notification is
- * either displayed or not displayed.
- *
- * @param aController the controller of the compose window to check.
- * @param aDisplayed true if the notification should be displayed, false
- *                   otherwise.
- */
-function assert_upload_notification_displayed(aController, aDisplayed) {
-  assert_notification_displayed(
-    aController,
-    kBoxId,
-    "bigAttachmentUploading",
-    aDisplayed
-  );
-}
-
-/**
- * A helper function to assert that the Filelink privacy warning notification
- * is either displayed or not displayed.
- *
- * @param aController the controller of the compose window to check.
- * @param aDisplayed true if the notification should be displayed, false
- *                   otherwise.
- */
-function assert_privacy_warning_notification_displayed(
-  aController,
-  aDisplayed
-) {
-  assert_notification_displayed(
-    aController,
-    kBoxId,
-    "bigAttachmentPrivacyWarning",
-    aDisplayed
-  );
-}
-
-/**
- * A helper function to close the Filelink upload notification.
- */
-function close_upload_notification(aController) {
-  close_notification(aController, kBoxId, "bigAttachmentUploading");
-}
-
-/**
- * A helper function to close the Filelink privacy warning notification.
- */
-function close_privacy_warning_notification(aController) {
-  close_notification(aController, kBoxId, "bigAttachmentPrivacyWarning");
-}
-
-function test_no_notification_for_small_file() {
-  let cwc = open_compose_new_mail(mc);
-  add_attachments(cwc, "http://www.example.com/1", 0);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  add_attachments(cwc, "http://www.example.com/2", 1);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  add_attachments(cwc, "http://www.example.com/3", 100);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  add_attachments(cwc, "http://www.example.com/4", 500);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  close_compose_window(cwc);
-}
-
-function test_notification_for_big_files() {
-  let cwc = open_compose_new_mail(mc);
-  add_attachments(cwc, "http://www.example.com/1", maxSize);
-  assert_cloudfile_notification_displayed(cwc, true);
-
-  add_attachments(cwc, "http://www.example.com/2", maxSize + 1000);
-  assert_cloudfile_notification_displayed(cwc, true);
-
-  add_attachments(cwc, "http://www.example.com/3", maxSize + 10000);
-  assert_cloudfile_notification_displayed(cwc, true);
-
-  add_attachments(cwc, "http://www.example.com/4", maxSize + 100000);
-  assert_cloudfile_notification_displayed(cwc, true);
-
-  close_compose_window(cwc);
-}
-
-function test_graduate_to_notification() {
-  let cwc = open_compose_new_mail(mc);
-  add_attachments(cwc, "http://www.example.com/1", maxSize - 100);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  add_attachments(cwc, "http://www.example.com/2", maxSize - 25);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  add_attachments(cwc, "http://www.example.com/3", maxSize);
-  assert_cloudfile_notification_displayed(cwc, true);
-
-  close_compose_window(cwc);
-}
-
-function test_no_notification_if_disabled() {
-  Services.prefs.setBoolPref("mail.cloud_files.enabled", false);
-  let cwc = open_compose_new_mail(mc);
-
-  add_attachments(cwc, "http://www.example.com/1", maxSize);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  add_attachments(cwc, "http://www.example.com/2", maxSize + 1000);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  add_attachments(cwc, "http://www.example.com/3", maxSize + 10000);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  add_attachments(cwc, "http://www.example.com/4", maxSize + 100000);
-  assert_cloudfile_notification_displayed(cwc, false);
-
-  close_compose_window(cwc);
-  Services.prefs.setBoolPref("mail.cloud_files.enabled", true);
-}
-
-/**
- * Tests that if we upload a single file, we get the link insertion
- * notification bar displayed (unless preffed off).
- */
-function test_link_insertion_notification_single() {
-  gMockFilePicker.returnFiles = collectFiles(["./data/testFile1"], __file__);
-  let provider = new MockCloudfileAccount();
-  provider.init("aKey");
-
-  let cwc = open_compose_new_mail(mc);
-  add_cloud_attachments(cwc, provider);
-
-  assert_upload_notification_displayed(cwc, true);
-  close_upload_notification(cwc);
-
-  Services.prefs.setBoolPref(kInsertNotificationPref, false);
-  gMockFilePicker.returnFiles = collectFiles(["./data/testFile2"], __file__);
-  add_cloud_attachments(cwc, provider);
-
-  assert_upload_notification_displayed(cwc, false);
-  Services.prefs.setBoolPref(kInsertNotificationPref, true);
-
-  close_compose_window(cwc);
-}
-
-/**
- * Tests that if we upload multiple files, we get the link insertion
- * notification bar displayed (unless preffed off).
- */
-function test_link_insertion_notification_multiple() {
-  gMockFilePicker.returnFiles = collectFiles(
-    ["./data/testFile1", "./data/testFile2"],
-    __file__
-  );
-  let provider = new MockCloudfileAccount();
-  provider.init("aKey");
-
-  let cwc = open_compose_new_mail(mc);
-  add_cloud_attachments(cwc, provider);
-
-  assert_upload_notification_displayed(cwc, true);
-  close_upload_notification(cwc);
-
-  Services.prefs.setBoolPref(kInsertNotificationPref, false);
-  gMockFilePicker.returnFiles = collectFiles(
-    ["./data/testFile3", "./data/testFile4"],
-    __file__
-  );
-  add_cloud_attachments(cwc, provider);
-
-  assert_upload_notification_displayed(cwc, false);
-  Services.prefs.setBoolPref(kInsertNotificationPref, true);
-
-  close_compose_window(cwc);
-}
-
-/**
- * Tests that the link insertion notification bar goes away even
- * if we hit an uploading error.
- */
-function test_link_insertion_goes_away_on_error() {
-  gMockPromptService.register();
-  gMockPromptService.returnValue = false;
-  gMockFilePicker.returnFiles = collectFiles(
-    ["./data/testFile1", "./data/testFile2"],
-    __file__
-  );
-  let provider = new MockCloudfileAccount();
-  provider.init("aKey");
-
-  provider.uploadFile = function(aFile) {
-    return new Promise((resolve, reject) => {
-      cwc.window.setTimeout(() =>
-        reject(cloudFileAccounts.constants.uploadErr)
-      );
-    }, 500);
-  };
-
-  let cwc = open_compose_new_mail(mc);
-  add_cloud_attachments(cwc, provider, false);
-
-  assert_upload_notification_displayed(cwc, true);
-  wait_for_notification_to_stop(cwc, kBoxId, "bigAttachmentUploading");
-
-  close_compose_window(cwc);
-  gMockPromptService.unregister();
-}
-
-/**
- * Test that we do not show the Filelink offer notification if we convert
- * a Filelink back into a normal attachment.
- */
-function test_no_offer_on_conversion() {
-  const kFiles = ["./data/testFile1", "./data/testFile2"];
-  // Set the notification threshold to 0 to ensure that we get it.
-  Services.prefs.setIntPref(kOfferThreshold, 0);
-
-  // Insert some Filelinks...
-  gMockFilePicker.returnFiles = collectFiles(kFiles, __file__);
-  let provider = new MockCloudfileAccount();
-  provider.init("someKey");
-
-  // Override uploadFile to succeed instantaneously so that we don't have
-  // to worry about waiting for the onStopRequest method being called
-  // asynchronously.
-  provider.uploadFile = function(aFile) {
-    return Promise.resolve({
-      id: 1,
-    });
-  };
-
-  let cw = open_compose_new_mail();
-  add_cloud_attachments(cw, provider, false);
-
-  assert_cloudfile_notification_displayed(cw, false);
-  // Now convert the file back into a normal attachment
-  select_attachments(cw, 0);
-  cw.window.convertSelectedToRegularAttachment();
-
-  assert_cloudfile_notification_displayed(cw, false);
-
-  close_compose_window(cw);
-
-  // Now put the old threshold back.
-  Services.prefs.setIntPref(kOfferThreshold, maxSize);
-}
-
-/**
- * Test that when we kick off an upload via the offer notification, then
- * the upload notification is shown.
- */
-function test_offer_then_upload_notifications() {
-  const kFiles = ["./data/testFile1", "./data/testFile2"];
-  // Set the notification threshold to 0 to ensure that we get it.
-  Services.prefs.setIntPref(kOfferThreshold, 0);
-
-  // We're going to add attachments to the attachmentbucket, and we'll
-  // use the add_attachments helper function to do it.  First, retrieve
-  // some file URIs...
-  let fileURIs = collectFiles(kFiles, __file__).map(
-    file => Services.io.newFileURI(file).spec
-  );
-
-  // Create our mock provider
-  let provider = new MockCloudfileAccount();
-  provider.init("someKey");
-
-  // Override uploadFile to succeed instantaneously so that we don't have
-  // to worry about waiting for the onStopRequest method being called
-  // asynchronously.
-  provider.uploadFile = function(aFile) {
-    return Promise.resolve({
-      id: 1,
-    });
-  };
-
-  let cw = open_compose_new_mail();
-
-  // Attach the files, saying that each is 500 bytes large - which should
-  // certainly trigger the offer.
-  add_attachments(cw, fileURIs, [500, 500]);
-  // Assert that the offer is displayed.
-  assert_cloudfile_notification_displayed(cw, true);
-  // Select both attachments in the attachmentbucket, and choose to convert
-  // them.
-  select_attachments(cw, 0, 1);
-  // Convert them.
-  cw.window.convertSelectedToCloudAttachment(provider);
-
-  // The offer should now be gone...
-  assert_cloudfile_notification_displayed(cw, false);
-  // And the upload notification should be displayed.
-  assert_upload_notification_displayed(cw, true);
-
-  close_compose_window(cw);
-
-  // Now put the old threshold back.
-  Services.prefs.setIntPref(kOfferThreshold, maxSize);
-}
-
-/**
- * Test that when we first upload some files, we get the privacy warning
- * message. We should only get this the first time.
- */
-function test_privacy_warning_notification() {
-  gMockPromptService.register();
-  gMockPromptService.returnValue = false;
-  gMockFilePicker.returnFiles = collectFiles(
-    ["./data/testFile1", "./data/testFile2"],
-    __file__
-  );
-  let provider = new MockCloudfileAccount();
-  provider.init("aKey");
-
-  provider.uploadFile = function(aFile, aListener) {
-    return new Promise(resolve =>
-      cwc.window.setTimeout(() => {
-        resolve({
-          id: 1,
-        });
-      }, 500)
-    );
-  };
-  let cwc = open_compose_new_mail(mc);
-  add_cloud_attachments(cwc, provider);
-
-  assert_upload_notification_displayed(cwc, true);
-  wait_for_notification_to_stop(cwc, kBoxId, "bigAttachmentUploading");
-
-  // Assert that the warning is displayed.
-  assert_privacy_warning_notification_displayed(cwc, true);
-
-  // Close the privacy warning notification...
-  close_privacy_warning_notification(cwc);
-
-  // And now upload some more files. We shouldn't get the warning again.
-  gMockFilePicker.returnFiles = collectFiles(
-    ["./data/testFile3", "./data/testFile4"],
-    __file__
-  );
-  add_cloud_attachments(cwc, provider, false);
-  assert_privacy_warning_notification_displayed(cwc, false);
-
-  close_compose_window(cwc);
-  gMockPromptService.unregister();
-}
-
-/**
- * Test that the privacy warning notification does not persist when closing
- * and re-opening a compose window.
- */
-function test_privacy_warning_notification_no_persist() {
-  gMockPromptService.register();
-  gMockPromptService.returnValue = false;
-  gMockFilePicker.returnFiles = collectFiles(
-    ["./data/testFile1", "./data/testFile2"],
-    __file__
-  );
-  let provider = new MockCloudfileAccount();
-  provider.init("aKey");
-
-  provider.uploadFile = function(aFile, aListener) {
-    return new Promise(resolve =>
-      cwc.window.setTimeout(() => {
-        resolve({
-          id: 1,
-        });
-      }, 500)
-    );
-  };
-  let cwc = open_compose_new_mail(mc);
-  add_cloud_attachments(cwc, provider, false);
-
-  assert_upload_notification_displayed(cwc, true);
-  wait_for_notification_to_stop(cwc, kBoxId, "bigAttachmentUploading");
-
-  // Assert that the warning is displayed.
-  assert_privacy_warning_notification_displayed(cwc, true);
-
-  // Close the compose window
-  close_compose_window(cwc);
-
-  // Open a new compose window
-  cwc = open_compose_new_mail(mc);
-
-  // We shouldn't be displaying the privacy warning.
-  assert_privacy_warning_notification_displayed(cwc, false);
-
-  close_compose_window(cwc);
-  gMockPromptService.unregister();
-}
-
-/**
- * Test that if we close the privacy warning in a composer, it will still
- * spawn in a new one.
- */
-function test_privacy_warning_notification_open_after_close() {
-  gMockPromptService.register();
-  gMockPromptService.returnValue = false;
-  gMockFilePicker.returnFiles = collectFiles(
-    ["./data/testFile1", "./data/testFile2"],
-    __file__
-  );
-  let provider = new MockCloudfileAccount();
-  provider.init("aKey");
-
-  provider.uploadFile = function(aFile, aListener) {
-    return new Promise(resolve =>
-      cwc.window.setTimeout(() => {
-        resolve({
-          id: 1,
-        });
-      }, 500)
-    );
-  };
-  let cwc = open_compose_new_mail(mc);
-  add_cloud_attachments(cwc, provider, false);
-
-  assert_upload_notification_displayed(cwc, true);
-  wait_for_notification_to_stop(cwc, kBoxId, "bigAttachmentUploading");
-
-  // Assert that the warning is displayed.
-  assert_privacy_warning_notification_displayed(cwc, true);
-
-  // Close the privacy warning notification...
-  close_privacy_warning_notification(cwc);
-
-  close_compose_window(cwc);
-
-  // Open a new compose window
-  cwc = open_compose_new_mail(mc);
-
-  gMockFilePicker.returnFiles = collectFiles(
-    ["./data/testFile3", "./data/testFile4"],
-    __file__
-  );
-  add_cloud_attachments(cwc, provider);
-
-  assert_upload_notification_displayed(cwc, true);
-  wait_for_notification_to_stop(cwc, kBoxId, "bigAttachmentUploading");
-
-  // Assert that the privacy warning notification is displayed again.
-  assert_privacy_warning_notification_displayed(cwc, true);
-
-  close_compose_window(cwc);
-  gMockPromptService.unregister();
-}
deleted file mode 100644
--- a/mail/test/mozmill/composition/attachment.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-"Attachment is the great fabricator of illusions; reality can be attained only
- by someone who is detached."
-
- -- Simone Weil
deleted file mode 100644
--- a/mail/test/mozmill/composition/base64-encoded-msg.eml
+++ /dev/null
@@ -1,11 +0,0 @@
-Message-ID: <4877F4BB.3060507@example.org>
-Date: Fri, 11 Jul 2008 20:03:07 -0400
-From: Joe <joe@example.org>
-MIME-Version: 1.0
-To: Jane <jane@example.org>
-Subject: base64 content
-Content-Type: text/plain; charset=ISO-8859-1
-Content-Transfer-Encoding: base64
-
-WW91IGhhdmUgZGVjb2RlZCB0aGlzIHRleHQgZnJvbSBiYXNlNjQu
-
deleted file mode 100644
--- a/mail/test/mozmill/composition/base64-with-whitespace.eml
+++ /dev/null
@@ -1,46 +0,0 @@
-Date: Tue, 31 Aug 2018 16:33:00 +0200
-From: From <from@example.com>
-To: To <to@example.com>
-Subject: Bug 1487421 - BASE64 MIME body and attachment with empty lines in between
-MIME-Version: 1.0
-Message-ID: <1dcZe4@example.com>
-Content-Type: multipart/mixed;
- boundary="------------DA562B250842CC7332F16476"
-
-This is a multi-part message in MIME format.
---------------DA562B250842CC7332F16476
-Content-Type: text/plain; charset=utf-8
-Content-Transfer-Encoding: base64
-
-YWJj
-
-ZG
-
-V
-
-mZ2hpamtsbW
-
-5vcHFyc3R1dnd4
-
-eXo=
-
---------------DA562B250842CC7332F16476
-Content-Type: text/plain; charset=utf-8
-Content-Transfer-Encoding: base64
-Content-Disposition: attachment;
- filename="test.txt"
-
-YWJj
-
-ZG
-
-V
-
-mZ2hpamtsbW
-
-5vcHFyc3R1dnd4
-
-eXo=
-
---------------DA562B250842CC7332F16476--
-
deleted file mode 100644
--- a/mail/test/mozmill/composition/body-greek.eml
+++ /dev/null
@@ -1,9 +0,0 @@
-From: test <test@example.com>
-Subject: test reply to ISO-8859-7 encoded message
-To: test2 <test2@example.com>
-Date: Sat, 27 Feb 2016 17:11:45 +0100
-MIME-Version: 1.0
-Content-Type: text/plain; charset=ISO-8859-7
-Content-Transfer-Encoding: quoted-printable
-
-Here comes some Greek text: =CA=E1=EB=E7=F3=F0=DD=F1=E1
deleted file mode 100644
--- a/mail/test/mozmill/composition/body-utf16.eml
+++ /dev/null
@@ -1,10 +0,0 @@
-From: test <test@example.com>
-Subject: test reply to UTF-16 encoded message
-To: test2 <test2@example.com>
-Date: Sat, 27 Feb 2016 17:11:45 +0100
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-16LE;
-Content-Transfer-Encoding: base64
-
-//5IAGkAIABNAGEAZwBuAHUAcwAsACAAaABlAHIAZQAgAGEAIABiAGUAdAB0AGUAcgAgAFUA
-VABGAC0AMQA2ACAAZQBuAGMAbwBkAGUAZAAgAG0AYQBpAGwALgA=
deleted file mode 100644
--- a/mail/test/mozmill/composition/charset-cp932.eml
+++ /dev/null
@@ -1,11 +0,0 @@
-Date: Tue, 4 Dec 2018 15:23:22 +0900
-From: from@example.org
-Subject: =?cp932?Q?=82=b1=82=b1=82=c9=96=7b=95=b6=82=aa=82=ab=82=dc=82=b7=81=42?=
-To: to@example.org
-Message-Id: <424F4F74-05B4-4575-8B0D-473334183C69@example.org>
-Mime-Version: 1.0 (1.0)
-Content-Type: text/plain; charset=cp932
-Content-Transfer-Encoding: 8bit
-
-ここに本文がきます。
-
deleted file mode 100644
--- a/mail/test/mozmill/composition/content-utf8-alt-rel.eml
+++ /dev/null
@@ -1,46 +0,0 @@
-From: test <test@example.com>
-Subject: test multipart, alternative first
-To: test2 <test2@example.com>
-Date: Sat, 27 Feb 2016 17:11:45 +0100
-MIME-Version: 1.0
-Content-Type: multipart/alternative;
- boundary="------------alternative"
-
-This is a multi-part message in MIME format.
---------------alternative
-Content-Type: text/plain; charset=UTF-8; format=flowed
-Content-Transfer-Encoding: 8bit
-
-テ。テウテコテ、テカテシテ
-
---------------alternative
-Content-Type: multipart/related;
- boundary="------------related"
-
-
---------------related
-Content-Type: text/html; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-<html attr>
-  <!-- This also needs to work when the html tag has an attribute -->
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    テ。テウテコテ、テカテシテ<br>
-    <img src="cid:part1" alt=""><br>
-  </body>
-</html>
-
---------------related
-Content-Type: image/png
-Content-Transfer-Encoding: base64
-Content-ID: <part1>
-
-iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAIAAADTMGvBAAAAEUlEQVQImWPgsi5DQwxDWggA
-lCEwN+YGfiYAAAAASUVORK5CYII=
---------------related--
-
---------------alternative--
-
deleted file mode 100644
--- a/mail/test/mozmill/composition/content-utf8-alt-rel2.eml
+++ /dev/null
@@ -1,46 +0,0 @@
-From: test <test@example.com>
-Subject: test multipart, alternative first
-To: test2 <test2@example.com>
-Date: Sat, 27 Feb 2016 17:11:45 +0100
-MIME-Version: 1.0
-Content-Type: multipart/alternative;
- boundary="------------alternative"
-
-This is a multi-part message in MIME format.
---------------alternative
-Content-Type: text/plain; charset=UTF-8; format=flowed
-Content-Transfer-Encoding: 8bit
-
-テ。テウテコテ、テカテシテ
-
---------------alternative
-Content-Type: multipart/related;
- boundary="------------related"
-
-
---------------related
-Content-Type: text/html; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-テ。テウテコテ、テカテシテ<br>
-<html>
-  <!-- This also needs to work when there is content before the html tag :-( -->
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    <img src="cid:part1" alt=""><br>
-  </body>
-</html>
-
---------------related
-Content-Type: image/png
-Content-Transfer-Encoding: base64
-Content-ID: <part1>
-
-iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAIAAADTMGvBAAAAEUlEQVQImWPgsi5DQwxDWggA
-lCEwN+YGfiYAAAAASUVORK5CYII=
---------------related--
-
---------------alternative--
-
deleted file mode 100644
--- a/mail/test/mozmill/composition/content-utf8-rel-alt.eml
+++ /dev/null
@@ -1,40 +0,0 @@
-From: test <test@example.com>
-Subject: test multipart, related first
-To: test2 <test2@example.com>
-Date: Sat, 27 Feb 2016 17:11:45 +0100
-MIME-Version: 1.0
-Content-Type: multipart/related;
- boundary="------------related"
-
---------------related
-Content-Type: multipart/alternative;
- boundary="------------alternative"
-Content-Type: text/plain; charset=UTF-8; format=flowed
-Content-Transfer-Encoding: 8bit
-
-テ。テウテコテ、テカテシテ
-
---------------alternative
-Content-Type: text/html; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-  <!-- This also needs to work when there is no html tag -->
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    テ。テウテコテ、テカテシテ<br>
-    <img src="cid:part1" alt=""><br>
-  </body>
-
---------------alternative
-
---------------related
-Content-Type: image/png
-Content-Transfer-Encoding: base64
-Content-ID: <part1>
-
-iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAIAAADTMGvBAAAAEUlEQVQImWPgsi5DQwxDWggA
-lCEwN+YGfiYAAAAASUVORK5CYII=
-
---------------related--
deleted file mode 100644
--- a/mail/test/mozmill/composition/content-utf8-rel-only.eml
+++ /dev/null
@@ -1,32 +0,0 @@
-From: test <test@example.com>
-Subject: test HTML related only
-To: test2 <test2@example.com>
-Date: Sat, 27 Feb 2016 17:11:45 +0100
-MIME-Version: 1.0
-Content-Type: multipart/related;
- boundary="------------related"
-
-This is a multi-part message in MIME format.
---------------related
-Content-Type: text/html; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-<html>
-  <head>
-    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    テ。テウテコテ、テカテシテ<br>
-    <img src="cid:part1" id="cidImage" width="10" height="10" alt="">
-    <img src="cid:part1" crossorigin="anonymous" id="cidImageOrigin" width="20" height="20" alt="">
-  </body>
-</html>
-
---------------related
-Content-Type: image/png
-Content-Transfer-Encoding: base64
-Content-ID: <part1>
-
-iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAIAAADTMGvBAAAAEUlEQVQImWPgsi5DQwxDWggA
-lCEwN+YGfiYAAAAASUVORK5CYII=
---------------related--
deleted file mode 100644
--- a/mail/test/mozmill/composition/feed-message.eml
+++ /dev/null
@@ -1,26 +0,0 @@
-From - Fri, 27 Jan 2017 00:19:08 GMT
-X-Mozilla-Status: 0041
-X-Mozilla-Status2: 00000000
-X-Mozilla-Keys:                                                                                 
-Received: by localhost; Fri, 27 Jan 2017 07:52:26 +0100
-Date: Fri, 27 Jan 2017 00:19:08 GMT
-Message-Id: <http://www.selenic.com/mercurial/#changeset-c11fe7c58837ebf4266357d1f31896c7cc4a49b9@localhost.localdomain>
-From: john@example.com
-MIME-Version: 1.0
-Subject: Changeset c11fe7c58837ebf4266357d1f31896c7cc4a49b9
-Content-Transfer-Encoding: 8bit
-Content-Base: http://hg.mozilla.org/mozilla-central/rev/c11fe7c58837ebf4266357d1f31896c7cc4a49b9
-Content-Type: text/html; charset=UTF-8
-
-<html>
-  <head>
-    <title>Changeset c11fe7c58837ebf4266357d1f31896c7cc4a49b9</title>
-    <base href="http://hg.mozilla.org/mozilla-central/pushlog">
-  </head>
-  <body id="msgFeedSummaryBody" selected="false">
-    <div xmlns="http://www.w3.org/1999/xhtml">
-    <ul class="filelist"><li class="file">modules/libpref/init/all.js</li><li class="file">netwerk/base/nsIOService.cpp</li><li class="file">netwerk/base/nsIOService.h</li><li class="file">We like using linefeeds only.</li></ul>
-   </div>
-  </body>
-</html>
-
deleted file mode 100644
--- a/mail/test/mozmill/composition/format-flowed.eml
+++ /dev/null
@@ -1,12 +0,0 @@
-To: test1@test.invalid
-From: test2@test.invalid
-Subject: test format flowed reply
-Date: Tue, 27 Sep 2016 13:00:40 +0200
-MIME-Version: 1.0
-Content-Type: text/plain; charset=windows-1252; format=flowed
-Content-Language: en-US
-Content-Transfer-Encoding: 7bit
-
-first first first first first text text text text text text text text 
-text text text text text text text text text text text text text text 
-last last last last last last last last last last last last last last
deleted file mode 100644
--- a/mail/test/mozmill/composition/format1-altering.eml
+++ /dev/null
@@ -1,21 +0,0 @@
-Message-ID: <11111.11111@example.invalid>
-Date: Sun, 18 May 2014 22:31:12 +0200
-MIME-Version: 1.0
-To: test@test.invalid
-Content-Type: text/html; charset=utf-8
-Content-Transfer-Encoding: 7bit
-
-<html>
-  <head>
-    <meta http-equiv="content-type" content="text/html; charset=utf-8">
-    <title>title</title>
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    <h1>heading</h1>
-    <hr>
-    <pre>
-    Pre line 1
-    Pre line 2
-    </pre>
-  </body>
-</html>
deleted file mode 100644
--- a/mail/test/mozmill/composition/format1-plain.eml
+++ /dev/null
@@ -1,22 +0,0 @@
-Message-ID: <11111.11111@example.invalid>
-Date: Sun, 18 May 2014 22:31:12 +0200
-MIME-Version: 1.0
-To: test@test.invalid
-Content-Type: text/html; charset=utf-8
-Content-Transfer-Encoding: 7bit
-
-<html>
-  <head>
-    <meta http-equiv="content-type" content="text/html; charset=utf-8">
-    <title>title</title>
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    Line 1<br>
-<p>
-    Line 2
-</p>
-    <pre class="moz-signature" cols="72">-- 
-      Signature block
-    </pre>
-  </body>
-</html>
deleted file mode 100644
--- a/mail/test/mozmill/composition/format2-style-attr.eml
+++ /dev/null
@@ -1,37 +0,0 @@
-Message-ID: <22222222.2222222@example.invalid>
-Date: Sun, 17 Jun 2012 09:42:45 +0200
-From: John Doe
-MIME-Version: 1.0
-Subject: Testcase - style attribute
-Content-Type: text/html; charset=ISO-8859-1
-Content-Transfer-Encoding: 7bit
-
-<html>
-  <head>
-    <meta http-equiv="content-type" content="text/html;
-      charset=ISO-8859-1">
-  </head>
-  <body bgcolor="#FFFFFF" text="#000000">
-    *** This text is "Variable Width" ***<br>
-    <br>
-    <a title="Get the best mailer now! (Caveat: neglected bird with lots
-      of bugs)" style="float: right; background-color: blue; font-size:
-      18px; text-decoration: none; color: white; padding-top: 90px;
-      padding-bottom: 90px; padding-right: 50px; padding-left: 50px;"
-      href="http://www.getthunderbird.com">http://www.getthunderbird.com</a><a
-      title="Get the best browser now!" style="float: right;
-      background-color: orangered; font-size: 18px; text-decoration:
-      none; color: white; padding-top: 90px; padding-bottom: 90px;
-      padding-right: 50px; padding-left: 50px;"
-      href="http://www.getfirefox.com">http://www.getfirefox.com</a>Lorem
-      ipsum
-    dolor sit amet, consectetur adipiscing elit. Vestibulum
-    velit purus, egestas eu commodo ac, imperdiet pretium sem. Nulla
-    pulvinar commodo rutrum. Duis feugiat facilisis libero, id fermentum
-    neque molestie vel. Praesent vel nisi metus, a aliquam tellus. Cras
-    in
-    <pre style="color:blue;background-color:yellow;text-align:center;">
-    Vivamus accumsan bibendum arcu nec egestas. Suspendisse potenti.
-    </pre>
-  </body>
-</html>
deleted file mode 100644
--- a/mail/test/mozmill/composition/format3-style-tag.eml
+++ /dev/null
@@ -1,31 +0,0 @@
-Message-ID: <33333.33333@example.invalid>
-Date: Sun, 17 Jun 2012 09:42:45 +0200
-MIME-Version: 1.0
-Subject: <style> element
-Content-Type: text/html; charset=ISO-8859-1
-Content-Transfer-Encoding: 7bit
-
-<html>
-<head>
-
-<style type="text/css">
-<!--
-body {
-font-size:11.0pt;
-font-family:"Cal