Bug 1507317 - Prefs needed to make mochitests run correctly; rs=npotb
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 16 Jan 2019 17:56:56 +1300
changeset 33360 e5d328de82da
parent 33359 c145816dfef3
child 33361 a77b11bc0dfc
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnpotb
bugs1507317
Bug 1507317 - Prefs needed to make mochitests run correctly; rs=npotb
mail/components/extensions/test/browser/browser.ini
mail/components/extensions/test/browser/browser_ext_composeAction.js
mail/components/extensions/test/browser/browser_ext_mailTabs.js
mail/components/extensions/test/browser/browser_ext_quickFilter.js
--- a/mail/components/extensions/test/browser/browser.ini
+++ b/mail/components/extensions/test/browser/browser.ini
@@ -1,10 +1,19 @@
 [DEFAULT]
 head = head.js
+prefs =
+  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.start_page.override_url="about:blank"
+  mailnews.start_page.url="about:blank"
 subsuite = thunderbird
 tags = webextensions
 
 [browser_ext_addressBooksUI.js]
 [browser_ext_browserAction.js]
 [browser_ext_composeAction.js]
 [browser_ext_menus.js]
 [browser_ext_mailTabs.js]
--- a/mail/components/extensions/test/browser/browser_ext_composeAction.js
+++ b/mail/components/extensions/test/browser/browser_ext_composeAction.js
@@ -76,17 +76,17 @@ async function test_it(extensionDetails,
 }
 
 add_task(async function setup() {
   gAccount = createAccount();
   addIdentity(gAccount);
   let rootFolder = gAccount.incomingServer.rootFolder;
 
   window.gFolderTreeView.selectFolder(rootFolder);
-  await new Promise(executeSoon);
+  await new Promise(resolve => executeSoon(resolve));
 });
 
 add_task(async function the_test() {
   async function background_nopopup() {
     browser.test.log("nopopup background script ran");
     browser.composeAction.onClicked.addListener(async () => {
       await browser.composeAction.setTitle({ title: "New title" });
       await new Promise(setTimeout);
--- a/mail/components/extensions/test/browser/browser_ext_mailTabs.js
+++ b/mail/components/extensions/test/browser/browser_ext_mailTabs.js
@@ -11,17 +11,17 @@ add_task(async function setup() {
   createMessages(subFolders[0], 10);
   createMessages(subFolders[1], 50);
 
   window.gFolderTreeView.selectFolder(rootFolder);
   Services.prefs.setIntPref("extensions.webextensions.messagesPerPage", 10);
   registerCleanupFunction(() => {
     Services.prefs.clearUserPref("extensions.webextensions.messagesPerPage");
   });
-  await new Promise(executeSoon);
+  await new Promise(resolve => executeSoon(resolve));
 });
 
 add_task(async function test_update() {
   async function background() {
     function awaitMessage(messageToSend, ...sendArgs) {
       return new Promise(resolve => {
         browser.test.onMessage.addListener(function listener(...args) {
           browser.test.onMessage.removeListener(listener);
@@ -229,17 +229,17 @@ add_task(async function test_displayedFo
 
   let extension = ExtensionTestUtils.loadExtension({
     background,
     manifest: { permissions: ["accountsRead", "messagesRead"] },
   });
 
   extension.onMessage("selectFolder", async (newFolderPath) => {
     window.gFolderTreeView.selectFolder(folderMap.get(newFolderPath));
-    await new Promise(executeSoon);
+    await new Promise(resolve => executeSoon(resolve));
   });
 
   await extension.startup();
   extension.sendMessage(account.key);
   await extension.awaitFinish("mailTabs");
   await extension.unload();
 
   window.gFolderTreeView.selectFolder(rootFolder);
--- a/mail/components/extensions/test/browser/browser_ext_quickFilter.js
+++ b/mail/components/extensions/test/browser/browser_ext_quickFilter.js
@@ -6,17 +6,17 @@ let account, rootFolder, subFolders;
 
 add_task(async () => {
   account = createAccount();
   rootFolder = account.incomingServer.rootFolder;
   subFolders = [...rootFolder.subFolders];
   createMessages(subFolders[0], 10);
 
   window.gFolderTreeView.selectFolder(rootFolder);
-  await new Promise(executeSoon);
+  await new Promise(resolve => executeSoon(resolve));
 });
 
 add_task(async () => {
   async function background() {
     function awaitMessage(messageToSend, ...sendArgs) {
       return new Promise(resolve => {
         browser.test.onMessage.addListener(function listener(...args) {
           browser.test.onMessage.removeListener(listener);
@@ -59,17 +59,17 @@ add_task(async () => {
   }
 
   let extension = ExtensionTestUtils.loadExtension({
     background,
   });
 
   extension.onMessage("checkVisible", async (...expected) => {
     // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
-    await new Promise(r => setTimeout(r, 500));
+    await new Promise(resolve => setTimeout(resolve, 500));
 
     let actual = [];
     let dbView = window.gFolderDisplay.view.dbView;
     for (let i = 0; i < dbView.numMsgsInView; i++) {
       actual.push(messages.indexOf(dbView.getMsgHdrAt(i)));
     }
 
     is(JSON.stringify(actual), JSON.stringify(expected));