Bug 1571681 - Fix and enable remaining mochitests that were copied from mozmill; r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 10 Dec 2019 22:24:43 +1300
changeset 37787 d96b359f3c446b0a4c27b05d05581fb69d9f5331
parent 37786 1be1e6dac3864d2aa8f09065017b60233e0bd6cd
child 37788 89fbfe35a1f5d2d1aba9b5768752209f8ddc87aa
push id397
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:16:13 +0000
reviewersmkmelin
bugs1571681
Bug 1571681 - Fix and enable remaining mochitests that were copied from mozmill; r=mkmelin
mail/test/browser/folder-tree-modes/browser.ini
mail/test/browser/folder-tree-modes/browser_customFolderTreeMode.js
mail/test/browser/folder-tree-modes/browser_customSmartFolder.js
mail/test/browser/folder-tree-modes/test-extension/bootstrap.js
mail/test/browser/folder-tree-modes/test-extension/chrome.manifest
mail/test/browser/folder-tree-modes/test-extension/manifest.json
mail/test/browser/instrumentation/browser.ini
mail/test/browser/instrumentation/browser_instrumentSetup.js
mail/test/browser/newmailaccount/browser.ini
mail/test/browser/newmailaccount/browser_newmailaccount.js
mail/test/browser/newmailaccount/html/providerList
mail/test/browser/newmailaccount/html/providerListIncomplete
mail/test/browser/newmailaccount/html/providerListNoOtherLangs
mail/test/browser/newmailaccount/html/providerListWildcard
mail/test/browser/override-main-menu-collapse/browser.ini
mail/test/browser/override-main-menu-collapse/browser_overrideMainmenuCollapse.js
mail/test/browser/session-store/browser.ini
mail/test/browser/session-store/browser_sessionStore.js
mail/test/browser/startup-firstrun/browser.ini
mail/test/browser/startup-firstrun/browser_menubarCollapsed.js
--- a/mail/test/browser/folder-tree-modes/browser.ini
+++ b/mail/test/browser/folder-tree-modes/browser.ini
@@ -41,14 +41,12 @@ prefs =
   mail.startup.enabledMailCheckOnce=true
   mail.winsearch.firstRunDone=true
   mailnews.start_page.override_url=about:blank
   mailnews.start_page.url=about:blank
 subsuite = thunderbird
 support-files = test-extension/**
 
 [browser_customFolderTreeMode.js]
-skip-if = true
 [browser_customSmartFolder.js]
-skip-if = true
 [browser_modeSwitching.js]
 [browser_smartFolders.js]
 [browser_unreadFolders.js]
--- a/mail/test/browser/folder-tree-modes/browser_customFolderTreeMode.js
+++ b/mail/test/browser/folder-tree-modes/browser_customFolderTreeMode.js
@@ -20,29 +20,63 @@ var {
   "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
 );
 var {
   close_window,
   plan_for_new_window,
   wait_for_new_window,
 } = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
 
+var { ExtensionSupport } = ChromeUtils.import(
+  "resource:///modules/ExtensionSupport.jsm"
+);
 var { MailServices } = ChromeUtils.import(
   "resource:///modules/MailServices.jsm"
 );
 
 var gInbox;
 
 add_task(function setupModule(module) {
   let server = MailServices.accounts.FindServer(
     "tinderbox",
     FAKE_SERVER_HOSTNAME,
     "pop3"
   );
   gInbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
+
+  ExtensionSupport.registerWindowListener("mochitest", {
+    chromeURLs: ["chrome://messenger/content/messenger.xul"],
+    onLoadWindow(aWindow) {
+      let testFolderTreeMode = {
+        __proto__: aWindow.IFolderTreeMode,
+        generateMap(aFTV) {
+          var { MailServices } = ChromeUtils.import(
+            "resource:///modules/MailServices.jsm"
+          );
+          // Pick the tinderbox@foo.invalid inbox and use it as the only folder
+          let server = MailServices.accounts.FindServer(
+            "tinderbox",
+            "tinderbox123",
+            "pop3"
+          );
+          let item = new aWindow.ftvItem(
+            server.rootFolder.getChildNamed("Inbox")
+          );
+          item.__defineGetter__("children", () => []);
+          return [item];
+        },
+      };
+
+      aWindow.gFolderTreeView.registerFolderTreeMode(
+        "testmode",
+        testFolderTreeMode,
+        "Test Mode"
+      );
+    },
+  });
 });
 
 // Provided by the extension in test-extension
 var kTestModeID = "testmode";
 
 /**
  * Switch to the mode and verify that it displays correctly.
  */
@@ -72,8 +106,18 @@ add_task(function test_open_new_window_w
 });
 
 /**
  * Switch back to all folders.
  */
 add_task(function test_switch_to_all_folders() {
   mc.folderTreeView.mode = "all";
 });
+
+registerCleanupFunction(() => {
+  ExtensionSupport.unregisterWindowListener("mochitest");
+  Assert.report(
+    false,
+    undefined,
+    undefined,
+    "Test ran to completion successfully"
+  );
+});
--- a/mail/test/browser/folder-tree-modes/browser_customSmartFolder.js
+++ b/mail/test/browser/folder-tree-modes/browser_customSmartFolder.js
@@ -75,16 +75,17 @@ add_task(function setupModule(module) {
 /**
  * Switch to the smart folder mode, get the smart inbox.
  */
 add_task(function test_switch_to_smart_folder_mode() {
   mc.folderTreeView.mode = "smart";
   assert_folder_mode("smart");
 
   smartFolderA = get_smart_folder_named(smartParentNameA);
+  SimpleTest.expectUncaughtException();
   mc.folderTreeView.selectFolder(smartFolderA);
 });
 
 add_task(function test_cache_property() {
   if (mc.window.getSmartFolderName(subfolderA) != smartParentNameA) {
     throw new Error("smartFolderName A cache property not set");
   }
   if (mc.window.getSmartFolderName(subfolderB) != smartParentNameB) {
deleted file mode 100644
--- a/mail/test/browser/folder-tree-modes/test-extension/bootstrap.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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 { ExtensionSupport } = ChromeUtils.import(
-  "resource:///modules/ExtensionSupport.jsm"
-);
-
-// const addonID = "testfoldertreemode@mozilla.org";
-
-function install() {}
-
-function uninstall() {}
-
-function startup(data, reason) {
-  ExtensionSupport.registerWindowListener(data.id, {
-    chromeURLs: ["chrome://messenger/content/messenger.xul"],
-    onLoadWindow: setupFolderMode,
-  });
-}
-
-function shutdown(data, reason) {
-  ExtensionSupport.unregisterWindowListener(data.id);
-}
-
-function setupFolderMode(aWindow) {
-  let testFolderTreeMode = {
-    __proto__: aWindow.IFolderTreeMode,
-    generateMap(aFTV) {
-      var { MailServices } = ChromeUtils.import(
-        "resource:///modules/MailServices.jsm"
-      );
-      // Pick the tinderbox@foo.invalid inbox and use it as the only folder
-      let server = MailServices.accounts.FindServer(
-        "tinderbox",
-        "tinderbox123",
-        "pop3"
-      );
-      let item = new aWindow.ftvItem(server.rootFolder.getChildNamed("Inbox"));
-      item.__defineGetter__("children", () => []);
-      return [item];
-    },
-  };
-
-  aWindow.gFolderTreeView.registerFolderTreeMode(
-    "testmode",
-    testFolderTreeMode,
-    "Test Mode"
-  );
-}
deleted file mode 100644
deleted file mode 100644
--- a/mail/test/browser/folder-tree-modes/test-extension/manifest.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "manifest_version": 2,
-  "applications": {
-    "gecko": {
-      "id": "testfoldertreemode@mozilla.org"
-    }
-  },
-  "name": "Test Folder Modes",
-  "version": "1.0",
-  "description": "Provides a custom folder tree mode to be used by tests",
-  "legacy": {
-    "type": "bootstrap"
-  }
-}
--- a/mail/test/browser/instrumentation/browser.ini
+++ b/mail/test/browser/instrumentation/browser.ini
@@ -1,17 +1,17 @@
 [DEFAULT]
 prefs =
   ldap_2.servers.osx.description=
   ldap_2.servers.osx.dirType=-1
   ldap_2.servers.osx.uri=
   mail.provider.enabled=false
+  mail.provider.suppress_dialog_on_startup=true
   mail.spotlight.firstRunDone=true
   mail.winsearch.firstRunDone=true
+  mail.wizard.logging.dump=All
+  mailnews.auto_config.addons_url=about:blank
+  mailnews.auto_config_url=about:blank
   mailnews.start_page.override_url=about:blank
   mailnews.start_page.url=about:blank
-  mail.wizard.logging.dump=All
-  mailnews.auto_config_url=http://mochi.test:8888/browser/comm/mail/test/browser/account/xml
-  mailnews.auto_config.addons_url=about:blank
 subsuite = thunderbird
 
 [browser_instrumentSetup.js]
-skip-if = true
--- a/mail/test/browser/instrumentation/browser_instrumentSetup.js
+++ b/mail/test/browser/instrumentation/browser_instrumentSetup.js
@@ -3,16 +3,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var elib = ChromeUtils.import(
   "resource://testing-common/mozmill/elementslib.jsm"
 );
 
+var { open_mail_account_setup_wizard } = ChromeUtils.import(
+  "resource://testing-common/mozmill/AccountManagerHelpers.jsm"
+);
 var { mc } = ChromeUtils.import(
   "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
 );
 var { input_value } = ChromeUtils.import(
   "resource://testing-common/mozmill/KeyboardHelpers.jsm"
 );
 var {
   plan_for_window_close,
@@ -26,48 +29,60 @@ var { MailServices } = ChromeUtils.impor
 );
 
 var user = {
   name: "Roger Sterling",
   email: "roger.sterling@example.com",
   incomingHost: "testin.example.com",
   outgoingHost: "testout.example.com",
 };
+const PREF_NAME = "mailnews.auto_config_url";
+const PREF_VALUE = Services.prefs.getCharPref(PREF_NAME);
+
+add_task(function setupModule(module) {
+  let url =
+    "http://mochi.test:8888/browser/comm/mail/test/browser/account/xml/";
+  Services.prefs.setCharPref(PREF_NAME, url);
+});
+
+registerCleanupFunction(function teardownModule(module) {
+  Services.prefs.setCharPref(PREF_NAME, PREF_VALUE);
+});
 
 add_task(function test_mail_account_setup() {
-  let awc = wait_for_existing_window("mail:autoconfig");
+  open_mail_account_setup_wizard(function(awc) {
+    // Input user's account information
+    awc.e("realname").focus();
+    input_value(awc, user.name);
+    awc.keypress(null, "VK_TAB", {});
+    input_value(awc, user.email);
 
-  // Input user's account information
-  awc.e("realname").focus();
-  input_value(awc, user.name);
-  awc.keypress(null, "VK_TAB", {});
-  input_value(awc, user.email);
-
-  // Load the autoconfig file from http://localhost:433**/autoconfig/example.com
-  awc.e("next_button").click();
+    // Load the autoconfig file from http://localhost:433**/autoconfig/example.com
+    awc.e("next_button").click();
 
-  // 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
-  );
-  plan_for_window_close(awc);
-  awc.e("create_button").click();
+    // 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
+    );
+    plan_for_window_close(awc);
+    awc.e("create_button").click();
 
-  let events = mc.window.MailInstrumentation._currentState.events;
-  wait_for_window_close();
+    let events = mc.window.MailInstrumentation._currentState.events;
+    wait_for_window_close();
 
-  // we expect to have accountAdded and smtpServerAdded events.
-  if (!events.accountAdded.data) {
-    throw new Error("failed to add an account");
-  } else if (!events.smtpServerAdded.data) {
-    throw new Error("failed to add an smtp server");
-  }
+    // we expect to have accountAdded and smtpServerAdded events.
+    if (!events.accountAdded.data) {
+      throw new Error("failed to add an account");
+    } else if (!events.smtpServerAdded.data) {
+      throw new Error("failed to add an smtp server");
+    }
+  });
 });
 
 // Remove the accounts we added.
 registerCleanupFunction(function teardownModule(module) {
   let incomingServer = MailServices.accounts.FindServer(
     "roger.sterling",
     user.incomingHost,
     "pop3"
--- a/mail/test/browser/newmailaccount/browser.ini
+++ b/mail/test/browser/newmailaccount/browser.ini
@@ -1,15 +1,17 @@
 [DEFAULT]
 prefs =
+  browser.tabs.remote.autostart=false
   ldap_2.servers.osx.description=
   ldap_2.servers.osx.dirType=-1
   ldap_2.servers.osx.uri=
   mail.provider.suppress_dialog_on_startup=true
   mail.spotlight.firstRunDone=true
   mail.winsearch.firstRunDone=true
+  mailnews.auto_config.addons_url=about:blank
+  mailnews.auto_config_url=about:blank
   mailnews.start_page.override_url=about:blank
   mailnews.start_page.url=about:blank
 subsuite = thunderbird
 support-files = html/**
 
 [browser_newmailaccount.js]
-skip-if = true
--- a/mail/test/browser/newmailaccount/browser_newmailaccount.js
+++ b/mail/test/browser/newmailaccount/browser_newmailaccount.js
@@ -68,33 +68,35 @@ var { MailServices } = ChromeUtils.impor
 // so we get the right path for the resources.
 var url =
   "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/";
 var kProvisionerUrl =
   "chrome://messenger/content/newmailaccount/accountProvisioner.xhtml";
 var kProvisionerEnabledPref = "mail.provider.enabled";
 var kSuggestFromNamePref = "mail.provider.suggestFromName";
 var kProviderListPref = "mail.provider.providerList";
-var kDefaultServerPort = 8888;
-var kDefaultServerRoot = "http://mochi.test:" + kDefaultServerPort;
+var kDefaultServerPort = 4444;
+var kDefaultServerRoot = "http://localhost:" + kDefaultServerPort;
 
 Services.prefs.setCharPref(kProviderListPref, url + "providerList");
 Services.prefs.setCharPref(kSuggestFromNamePref, url + "suggestFromName");
 
 // Here's a name that we'll type in later on.  It's a global const because
 // we'll be using it in several distinct modal dialog event loops.
 var NAME = "Leonard Shelby";
 
 // Record what the original value of the mail.provider.enabled pref is so
 // that we can put it back once the tests are done.
 var gProvisionerEnabled = Services.prefs.getBoolPref(kProvisionerEnabledPref);
 var gOldAcceptLangs = Services.locale.requestedLocales;
 var gNumAccounts;
 
 add_task(function setupModule(module) {
+  requestLongerTimeout(2);
+
   // Make sure we enable the Account Provisioner.
   Services.prefs.setBoolPref(kProvisionerEnabledPref, true);
   // Restrict the user's language to just en-US
   Services.locale.requestedLocales = ["en-US"];
 
   // Add a "bar" search engine that we can switch to be the default.
   let engineAdded = false;
   Services.search
@@ -143,28 +145,28 @@ function test_get_an_account(aCloseAndRe
   open_provisioner_window();
   wait_for_modal_dialog("AccountCreation");
 
   // Once we're here, subtest_get_an_account has completed, and we're waiting
   // for a content tab to load for the account order form.
 
   // Make sure the page is loaded.
   wait_for_content_tab_load(undefined, function(aURL) {
-    return aURL.host == "localhost";
+    return aURL.host == "mochi.test";
   });
 
   let tab = mc.tabmail.currentTabInfo;
 
   if (aCloseAndRestore) {
     // Close the account provisioner tab, and then restore it...
     mc.tabmail.closeTab(mc.tabmail.currentTabInfo);
     mc.tabmail.undoCloseTab();
     // Wait for the page to be loaded again...
     wait_for_content_tab_load(undefined, function(aURL) {
-      return aURL.host == "localhost";
+      return aURL.host == "mochi.test";
     });
     tab = mc.tabmail.currentTabInfo;
   }
 
   // Record how many accounts we start with.
   gNumAccounts = nAccounts();
 
   // Plan for the account provisioner window to re-open, and then run the
@@ -996,17 +998,17 @@ function get_to_order_form(aAddress) {
   open_provisioner_window();
   wait_for_modal_dialog("AccountCreation");
 
   // Once we're here, subtest_get_an_account has completed, and we're waiting
   // for a content tab to load for the account order form.
 
   // Make sure the page is loaded.
   wait_for_content_tab_load(undefined, function(aURL) {
-    return aURL.host == "localhost";
+    return aURL.host == "mochi.test";
   });
 }
 
 /**
  * Fills in the Account Provisioner dialog to get us to the order form.
  */
 function sub_get_to_order_form(aController, aAddress) {
   wait_for_provider_list_loaded(aController);
@@ -1064,17 +1066,19 @@ add_task(function test_internal_link_ope
   let tab = mc.tabmail.currentTabInfo;
   let doc = tab.browser.contentWindow.document;
 
   // Click on the internal link.
   mc.click(new elib.Elem(doc.getElementById("internal")));
 
   // We should load the target page in the current tab browser.
   wait_for_browser_load(tab.browser, function(aURL) {
-    return aURL.host == "localhost" && aURL.pathQueryRef == "/target.html";
+    return (
+      aURL.host == "mochi.test" && aURL.pathQueryRef.endsWith("/target.html")
+    );
   });
   // Now close the tab.
   mc.tabmail.closeTab(tab);
 });
 
 /**
  * Test that window.open in the order form opens in new content tabs.
  */
@@ -1083,17 +1087,19 @@ add_task(function test_window_open_link_
 
   let tab = mc.tabmail.currentTabInfo;
   let doc = tab.browser.contentWindow.document;
 
   // First, click on the Javascript link - this should open in a new content
   // tab and be focused.
   let newTabLink = doc.getElementById("newtab");
   open_content_tab_with_click(newTabLink, function(aURL) {
-    return aURL.host == "localhost" && aURL.pathQueryRef == "/target.html";
+    return (
+      aURL.host == "mochi.test" && aURL.pathQueryRef.endsWith("/target.html")
+    );
   });
 
   // Close the new tab.
   let newTab = mc.tabmail.currentTabInfo;
   mc.tabmail.closeTab(newTab);
   mc.tabmail.closeTab(tab);
 });
 
--- a/mail/test/browser/newmailaccount/html/providerList
+++ b/mail/test/browser/newmailaccount/html/providerList
@@ -6,55 +6,55 @@
   "tos_url": "http://www.example.com/foo-tos",
   "privacy_url": "http://www.example.com/foo-privacy",
   "search_engine": "foo"
  },
  {"id": "bar",
   "label": "bar",
   "paid": false,
   "languages" : ["en-US", "fr-FR"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/bar-tos",
   "privacy_url": "http://www.example.com/bar-privacy",
   "search_engine": "bar"
  },
  {"id": "French",
   "label": "French Provider",
   "paid": false,
   "languages" : ["fr-FR"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/French-tos",
   "privacy_url": "http://www.example.com/French-privacy",
   "search_engine": "French"
  },
  {"id": "German",
   "label": "German Provider",
   "paid": false,
   "languages" : ["de-DE"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/German-tos",
   "privacy_url": "http://www.example.com/German-privacy",
   "search_engine": "German"
  },
  {"id": "corrupt",
   "label": "Corrupt Provider",
   "paid": false,
   "languages" : ["en-US"],
-  "api": "http://localhost:43336/registrationCorrupt.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registrationCorrupt.html",
   "tos_url": "http://www.example.com/corrupt-tos",
   "privacy_url": "http://www.example.com/corrupt-privacy"
  },
  {"id": "err",
   "label": "Error Provider",
   "paid": false,
   "languages" : ["en-US"],
-  "api": "http://localhost:43336/registrationError.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registrationError.html",
   "tos_url": "http://www.example.com/err-tos",
   "privacy_url": "http://www.example.com/err-privacy"
  },
  {"id": "multi",
   "label": "multi",
   "paid": true,
   "languages" : ["en-US"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/bar-tos",
   "privacy_url": "http://www.example.com/bar-privacy"
  }]
--- a/mail/test/browser/newmailaccount/html/providerListIncomplete
+++ b/mail/test/browser/newmailaccount/html/providerListIncomplete
@@ -6,36 +6,36 @@
   "tos_url": "http://www.example.com/tos",
   "privacy_url": "http://www.example.com/privacy",
   "search_engine": "foo"
  },
  {"id": "bar",
   "label": "bar",
   "paid": false,
   "languages" : ["en-US", "fr-FR"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/tos",
   "privacy_url": "http://www.example.com/privacy",
   "search_engine": "bar"
  },
  {"id": "French",
   "label": "French Provider",
   "paid": false,
   "languages" : ["fr-FR"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/tos",
   "privacy_url": "http://www.example.com/privacy",
   "search_engine": "French"
  },
  {"id": "German",
   "label": "German Provider",
   "paid": false,
   "languages" : ["de-DE"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/tos",
   "privacy_url": "http://www.example.com/privacy",
   "search_engine": "German"
 },
  {"id": "corrupt",
   "label": "Corrupt Provider",
   "languages" : ["en-US"],
-  "api": "http://localhost:43336/registrationCorrupt.html"
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registrationCorrupt.html"
 }]
--- a/mail/test/browser/newmailaccount/html/providerListNoOtherLangs
+++ b/mail/test/browser/newmailaccount/html/providerListNoOtherLangs
@@ -6,23 +6,23 @@
   "tos_url": "http://www.example.com/foo-tos",
   "privacy_url": "http://www.example.com/foo-privacy",
   "search_engine": "foo"
  },
  {"id": "bar",
   "label": "bar",
   "paid": false,
   "languages" : ["en-US"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/bar-tos",
   "privacy_url": "http://www.example.com/bar-privacy",
   "search_engine": "bar"
  },
  {"id": "corrupt",
   "label": "Corrupt Provider",
   "paid": false,
   "languages" : ["en-US"],
-  "api": "http://localhost:43336/registrationCorrupt.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registrationCorrupt.html",
   "tos_url": "http://www.example.com/corrupt-tos",
   "privacy_url": "http://www.example.com/corrupt-privacy"
 }
 
 ]
--- a/mail/test/browser/newmailaccount/html/providerListWildcard
+++ b/mail/test/browser/newmailaccount/html/providerListWildcard
@@ -15,23 +15,23 @@
   "tos_url": "http://www.example.com/foo-tos",
   "privacy_url": "http://www.example.com/foo-privacy",
   "search_engine": "otherUniversal"
  },
  {"id": "French",
   "label": "French Provider",
   "paid": false,
   "languages" : ["fr-FR"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/French-tos",
   "privacy_url": "http://www.example.com/French-privacy",
   "search_engine": "French"
  },
  {"id": "German",
   "label": "German Provider",
   "paid": false,
   "languages" : ["de-DE"],
-  "api": "http://localhost:43336/registration.html",
+  "api": "http://mochi.test:8888/browser/comm/mail/test/browser/newmailaccount/html/registration.html",
   "tos_url": "http://www.example.com/German-tos",
   "privacy_url": "http://www.example.com/German-privacy",
   "search_engine": "German"
  }
 ]
--- a/mail/test/browser/override-main-menu-collapse/browser.ini
+++ b/mail/test/browser/override-main-menu-collapse/browser.ini
@@ -1,15 +1,15 @@
 [DEFAULT]
 prefs =
   ldap_2.servers.osx.description=
   ldap_2.servers.osx.dirType=-1
   ldap_2.servers.osx.uri=
+  mail.main_menu.collapse_by_default=false
   mail.provider.suppress_dialog_on_startup=true
   mail.spotlight.firstRunDone=true
   mail.winsearch.firstRunDone=true
   mailnews.start_page.override_url=about:blank
   mailnews.start_page.url=about:blank
 subsuite = thunderbird
 
 [browser_overrideMainmenuCollapse.js]
-skip-if = true
-# skip-if = os == "mac"
+skip-if = os == "mac"
--- a/mail/test/browser/override-main-menu-collapse/browser_overrideMainmenuCollapse.js
+++ b/mail/test/browser/override-main-menu-collapse/browser_overrideMainmenuCollapse.js
@@ -5,47 +5,17 @@
 /**
  * Tests that the main menu will NOT be collapsed by default if Thunderbird
  * starts with no accounts created, and mail.main_menu.collapse_by_default set
  * to false.
  */
 
 "use strict";
 
-var { mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { close_window, wait_for_existing_window } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 add_task(function test_main_menu_not_collapsed() {
-  // Due to random oranges on slower machines, we need to ensure that startup
-  // is complete before running this test.
-  let done = false;
-  let observer = {
-    observe(aSubject, aTopic, aData) {
-      if (aTopic == "mail-startup-done") {
-        done = true;
-      }
-    },
-  };
-  Services.obs.addObserver(observer, "mail-startup-done");
-
-  // Since no accounts were set up, and the account provisoner was disabled
-  // in prefs.js, the wizard will show up. Find it, and close it. This will
-  // cause mail-startup-done to eventually be fired.
-  let wizard = wait_for_existing_window("mail:autoconfig");
-  close_window(wizard);
-
-  // Spin the event loop until mail-startup-done is fired.
-  mc.waitFor(() => done);
-
-  let mainMenu = mc.e("mail-toolbar-menubar2");
+  let mainMenu = document.getElementById("mail-toolbar-menubar2");
   Assert.ok(
     !mainMenu.hasAttribute("autohide"),
     "The main menu should not have the autohide attribute."
   );
-
-  Services.obs.removeObserver(observer, "mail-startup-done");
 });
--- a/mail/test/browser/session-store/browser.ini
+++ b/mail/test/browser/session-store/browser.ini
@@ -6,9 +6,8 @@ prefs =
   mail.provider.suppress_dialog_on_startup=true
   mail.spotlight.firstRunDone=true
   mail.winsearch.firstRunDone=true
   mailnews.start_page.override_url=about:blank
   mailnews.start_page.url=about:blank
 subsuite = thunderbird
 
 [browser_sessionStore.js]
-skip-if = true
--- a/mail/test/browser/session-store/browser_sessionStore.js
+++ b/mail/test/browser/session-store/browser_sessionStore.js
@@ -125,17 +125,18 @@ add_task(function setupModule(module) {
   // Opt out of calendar promotion so we don't show the "ligthing now
   // integrated" notification bar (which gives us unexpected heights).
   Services.prefs.setBoolPref("calendar.integration.notify", false);
 });
 
 registerCleanupFunction(function teardownModule(module) {
   folderA.server.rootFolder.propagateDelete(folderA, true, null);
   folderB.server.rootFolder.propagateDelete(folderB, true, null);
-  Services.prefs.clearUserPref("calendar.integration.notify");
+
+  Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit);
 });
 
 add_task(function test_periodic_session_persistence_simple() {
   // delete the session file if it exists
   let sessionFile = SessionStoreManager.sessionFile;
   if (sessionFile.exists()) {
     sessionFile.remove(false);
   }
--- a/mail/test/browser/startup-firstrun/browser.ini
+++ b/mail/test/browser/startup-firstrun/browser.ini
@@ -7,10 +7,9 @@ prefs =
   mail.provider.suppress_dialog_on_startup=true
   mail.spotlight.firstRunDone=true
   mail.winsearch.firstRunDone=true
   mailnews.start_page.override_url=about:blank
   mailnews.start_page.url=about:blank
 subsuite = thunderbird
 
 [browser_menubarCollapsed.js]
-skip-if = true
-# skip-if = os == "mac"
+skip-if = os == "mac"
--- a/mail/test/browser/startup-firstrun/browser_menubarCollapsed.js
+++ b/mail/test/browser/startup-firstrun/browser_menubarCollapsed.js
@@ -4,48 +4,18 @@
 
 /**
  * Tests that the main menu will be collapsed by default if Thunderbird starts
  * with no accounts created.
  */
 
 "use strict";
 
-var { mc } = ChromeUtils.import(
-  "resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
-);
-var { close_window, wait_for_existing_window } = ChromeUtils.import(
-  "resource://testing-common/mozmill/WindowHelpers.jsm"
-);
-
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 add_task(function test_main_menu_collapsed() {
-  // Due to random oranges on slower machines, we need to ensure that startup
-  // is complete before running this test.
-  let done = false;
-  let observer = {
-    observe(aSubject, aTopic, aData) {
-      if (aTopic == "mail-startup-done") {
-        done = true;
-      }
-    },
-  };
-  Services.obs.addObserver(observer, "mail-startup-done");
-
-  // Since no accounts were set up, and the account provisioner was disabled
-  // in prefs.js, the wizard will show up. Find it, and close it. This will
-  // cause mail-startup-done to eventually be fired.
-  let wizard = wait_for_existing_window("mail:autoconfig");
-  close_window(wizard);
-
-  // Spin the event loop until mail-startup-done is fired.
-  mc.waitFor(() => done);
-
-  let mainMenu = mc.e("mail-toolbar-menubar2");
+  let mainMenu = document.getElementById("mail-toolbar-menubar2");
   Assert.equal(
     mainMenu.getAttribute("autohide"),
     "true",
     "The main menu should have the autohide attribute set to true."
   );
-
-  Services.obs.removeObserver(observer, "mail-startup-done");
 });