Bug 1382320 - Port bug 1380470 to mailnews: fix calls of add_task function. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Thu, 20 Jul 2017 00:03:36 +0200
changeset 28462 2501146ba1d4b835df72dff6c15efe6a7d18dcdb
parent 28461 c4c7c0e2a1c64291692fff85f81f41a22ffdc1ce
child 28463 d9846d89641fc3c57e25f22ff9fcdeafc2b4e54e
push id1986
push userclokep@gmail.com
push dateWed, 02 Aug 2017 14:43:31 +0000
treeherdercomm-beta@b51c9adf2c9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1382320, 1380470
Bug 1382320 - Port bug 1380470 to mailnews: fix calls of add_task function. rs=bustage-fix
mailnews/base/test/unit/test_copyThenMoveManual.js
mailnews/base/test/unit/test_folderCompact.js
mailnews/base/test/unit/test_imapPump.js
mailnews/base/test/unit/test_quarantineFilterMove.js
mailnews/base/test/unit/test_searchChaining.js
mailnews/compose/test/unit/test_attachment.js
mailnews/compose/test/unit/test_detectAttachmentCharset.js
mailnews/compose/test/unit/test_longLines.js
mailnews/compose/test/unit/test_messageHeaders.js
mailnews/imap/test/unit/test_cacheParts.js
mailnews/imap/test/unit/test_downloadOffline.js
mailnews/imap/test/unit/test_filterNeedsBody.js
mailnews/imap/test/unit/test_imapFilterActions.js
mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
mailnews/imap/test/unit/test_imapMove.js
mailnews/imap/test/unit/test_offlineCopy.js
mailnews/imap/test/unit/test_offlinePlayback.js
mailnews/local/test/unit/test_movemailDownload.js
mailnews/local/test/unit/test_pop3FilterActions.js
mailnews/local/test/unit/test_pop3MoveFilter.js
mailnews/local/test/unit/test_pop3MoveFilter2.js
--- a/mailnews/base/test/unit/test_copyThenMoveManual.js
+++ b/mailnews/base/test/unit/test_copyThenMoveManual.js
@@ -108,12 +108,12 @@ function folderCount(folder)
 function run_test()
 {
   if (!localAccountUtils.inboxFolder)
     localAccountUtils.loadLocalMailAccount();
 
   gCopyFolder = localAccountUtils.rootFolder.createLocalSubfolder("CopyFolder");
   gMoveFolder = localAccountUtils.rootFolder.createLocalSubfolder("MoveFolder");
 
-  gTestArray.forEach(add_task);
+  gTestArray.forEach(x => add_task(x));
 
   run_next_test();
 }
--- a/mailnews/base/test/unit/test_folderCompact.js
+++ b/mailnews/base/test/unit/test_folderCompact.js
@@ -306,17 +306,17 @@ function run_test()
 
   // Create another folder to move and copy messages around, and force initialization.
   gLocalFolder2 = localAccountUtils.rootFolder.createLocalSubfolder("folder2");
   let folderName = gLocalFolder2.prettyName;
   // Create a third folder for more testing.
   gLocalFolder3 = localAccountUtils.rootFolder.createLocalSubfolder("folder3");
   folderName = gLocalFolder3.prettyName;
 
-  gTestArray.forEach(add_task);
+  gTestArray.forEach(x => add_task(x));
   run_next_test();
 }
 
 // debug utility to show the key/offset/ID relationship of messages in a folder
 function showMessages(folder, text)
 {
   dump("Show messages for folder <" + folder.name + "> " + text + "\n");
   let folderMsgs = folder.messages;
--- a/mailnews/base/test/unit/test_imapPump.js
+++ b/mailnews/base/test/unit/test_imapPump.js
@@ -54,17 +54,17 @@ var gTestArray =
   },
 
   // all done
   teardownIMAPPump,
 ];
 
 function run_test() {
   Services.prefs.setBoolPref("mail.server.default.autosync_offline_stores", false);
-  gTestArray.forEach(add_task);
+  gTestArray.forEach(x => add_task(x));
   run_next_test();
 }
 
 /*
  * helper functions
  */
 
 // given a test file, return the file uri spec
--- a/mailnews/base/test/unit/test_quarantineFilterMove.js
+++ b/mailnews/base/test/unit/test_quarantineFilterMove.js
@@ -109,17 +109,17 @@ function run_test()
   // quarantine messages
   Services.prefs.setBoolPref("mailnews.downloadToTempFile", true);
   if (!localAccountUtils.inboxFolder)
     localAccountUtils.loadLocalMailAccount();
 
   gMoveFolder = localAccountUtils.rootFolder.createLocalSubfolder("MoveFolder");
   gMoveFolder2 = localAccountUtils.rootFolder.createLocalSubfolder("MoveFolder2");
 
-  gTestArray.forEach(add_task);
+  gTestArray.forEach(x => add_task(x));
   run_next_test();
 }
 
 /*
  * Get the full message content.
  *
  * aMsgHdr: nsIMsgDBHdr object whose text body will be read
  *          returns: string with full message contents
--- a/mailnews/base/test/unit/test_searchChaining.js
+++ b/mailnews/base/test/unit/test_searchChaining.js
@@ -81,11 +81,11 @@ var searchListener =
 var tests = [
   setupIMAPPump,
   setupFolder,
   searchTest,
   teardownIMAPPump
 ];
 
 function run_test() {
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/compose/test/unit/test_attachment.js
+++ b/mailnews/compose/test/unit/test_attachment.js
@@ -128,11 +128,11 @@ function* testInput1() {
 
 var tests = [
   testInput0,
   testInput1
 ]
 
 function run_test() {
   localAccountUtils.loadLocalMailAccount();
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/compose/test/unit/test_detectAttachmentCharset.js
+++ b/mailnews/compose/test/unit/test_detectAttachmentCharset.js
@@ -50,11 +50,11 @@ var tests = [
   testShiftJIS
 ]
 
 function run_test() {
   // Ensure we have at least one mail account
   localAccountUtils.loadLocalMailAccount();
   Services.prefs.setIntPref("mail.strictly_mime.parm_folding", 0);
 
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/compose/test/unit/test_longLines.js
+++ b/mailnews/compose/test/unit/test_longLines.js
@@ -218,11 +218,11 @@ function* testBodyWithLongLine() {
 
 var tests = [
   testBodyWithLongLine,
 ]
 
 function run_test() {
   // Ensure we have at least one mail account
   localAccountUtils.loadLocalMailAccount();
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/compose/test/unit/test_messageHeaders.js
+++ b/mailnews/compose/test/unit/test_messageHeaders.js
@@ -544,11 +544,11 @@ var tests = [
   testSendHeaders,
   testContentHeaders,
   testSentMessage,
 ]
 
 function run_test() {
   // Ensure we have at least one mail account
   localAccountUtils.loadLocalMailAccount();
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/imap/test/unit/test_cacheParts.js
+++ b/mailnews/imap/test/unit/test_cacheParts.js
@@ -198,11 +198,11 @@ function checkCache() {
   );
 }
 
 function teardown() {
   teardownIMAPPump();
 }
 
 function run_test() {
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/imap/test/unit/test_downloadOffline.js
+++ b/mailnews/imap/test/unit/test_downloadOffline.js
@@ -62,11 +62,11 @@ function verifyDownloaded() {
         (header.flags & Ci.nsMsgMessageFlags.Offline))
       IMAPPump.inbox.getOfflineFileStream(header.messageKey, offset, size).close();
     else
       do_throw("Message not downloaded for offline use");
   }
 }
 
 function run_test() {
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/imap/test/unit/test_filterNeedsBody.js
+++ b/mailnews/imap/test/unit/test_filterNeedsBody.js
@@ -67,17 +67,17 @@ function *runFilterAction() {
   IMAPPump.mailbox.addMessage(new imapMessage(specForFileName(gMessage),
                               IMAPPump.mailbox.uidnext++, []));
   let listener = new PromiseTestUtils.PromiseUrlListener();
   IMAPPump.inbox.updateFolderWithListener(null, listener);
   yield listener.promise;
 }
 
 function run_test() {
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
 
 // custom action to test offline status
 var actionTestOffline =
 {
   id: "mailnews@mozilla.org#testOffline",
   name: "test if offline",
--- a/mailnews/imap/test/unit/test_imapFilterActions.js
+++ b/mailnews/imap/test/unit/test_imapFilterActions.js
@@ -331,17 +331,17 @@ var gTestArray =
   },
   /**/
   endTest
 
 ];
 
 function run_test() {
   //Services.prefs.setBoolPref("mail.server.default.autosync_offline_stores", false);
-  gTestArray.forEach(add_task);
+  gTestArray.forEach(x => add_task(x));
   run_next_test();
 }
 
 function setupFilters()
 {
 
   // Create a non-body filter.
   let filterList = IMAPPump.incomingServer.getFilterList(null);
--- a/mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
+++ b/mailnews/imap/test/unit/test_imapFilterActionsPostplugin.js
@@ -177,17 +177,17 @@ var gTestArray =
     testCounts(true, 1, 1, 1);
   },
   /**/
   endTest,
 ];
 
 function run_test() {
   Services.prefs.setBoolPref("mail.server.default.autosync_offline_stores", false);
-  gTestArray.forEach(add_task);
+  gTestArray.forEach(x => add_task(x));
   run_next_test();
 }
 
 function setupFilters()
 {
 // Create a non-body filter.
   let filterList = IMAPPump.incomingServer.getFilterList(null);
   gFilter = filterList.createFilter("subject");
--- a/mailnews/imap/test/unit/test_imapMove.js
+++ b/mailnews/imap/test/unit/test_imapMove.js
@@ -72,11 +72,11 @@ function *testMove() {
     Assert.ok(curDir.isDirectory());
     let curEnum = curDir.directoryEntries;
     // the directory should be empty, fails from bug 771643
     Assert.ok(!curEnum.hasMoreElements())
   }
 }
 
 function run_test() {
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/imap/test/unit/test_offlineCopy.js
+++ b/mailnews/imap/test/unit/test_offlineCopy.js
@@ -214,11 +214,11 @@ var tests = [
       // the directory should be empty, fails from bug 771643
       Assert.ok(!curEnum.hasMoreElements())
     }
   },
   teardownIMAPPump
 ];
 
 function run_test() {
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/imap/test/unit/test_offlinePlayback.js
+++ b/mailnews/imap/test/unit/test_offlinePlayback.js
@@ -131,11 +131,11 @@ function *setup() {
   // update folder to download header.
   let promiseUrlListener = new PromiseTestUtils.PromiseUrlListener();
   IMAPPump.inbox.updateFolderWithListener(null, promiseUrlListener);
   yield promiseUrlListener.promise;
 }
 
 function run_test() {
   Services.prefs.setBoolPref("mail.server.default.autosync_offline_stores", false);
-  tests.forEach(add_task);
+  tests.forEach(x => add_task(x));
   run_next_test();
 }
--- a/mailnews/local/test/unit/test_movemailDownload.js
+++ b/mailnews/local/test/unit/test_movemailDownload.js
@@ -70,17 +70,17 @@ var gTestArray = [
 ];
 
 function run_test()
 {
   let hostName = "movemail";
   for (let index = 0; index < localAccountUtils.pluggableStores.length; index++) {
     add_task(setup(localAccountUtils.pluggableStores[index],
                    hostName + "-" + index));
-    gTestArray.forEach(add_task);
+    gTestArray.forEach(x => add_task(x));
   }
 
   run_next_test();
 }
 
 var streamNextMessage = Task.async(function* (aMsgHdr) {
   let messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
   let msgURI = aMsgHdr.folder.getUriForMsg(aMsgHdr);
--- a/mailnews/local/test/unit/test_pop3FilterActions.js
+++ b/mailnews/local/test/unit/test_pop3FilterActions.js
@@ -135,17 +135,17 @@ function setup_store(storeID)
       localAccountUtils.loadLocalMailAccount();
   }
 }
 
 function run_test()
 {
   for (let store of gPluggableStores) {
     add_task(setup_store(store));
-    gTestArray.forEach(add_task);
+    gTestArray.forEach(x => add_task(x));
   }
 
   add_task(exitTest);
   run_next_test();
 }
 
 function exitTest()
 {
--- a/mailnews/local/test/unit/test_pop3MoveFilter.js
+++ b/mailnews/local/test/unit/test_pop3MoveFilter.js
@@ -120,17 +120,17 @@ function setup_store(storeID)
                                    .createLocalSubfolder("MoveFolder");
   }
 }
 
 function run_test()
 {
   for (let store of gPluggableStores) {
     add_task(setup_store(store));
-    gTestArray.forEach(add_task);
+    gTestArray.forEach(x => add_task(x));
   }
 
   add_task(exitTest);
   run_next_test();
 }
 
 function exitTest()
 {
--- a/mailnews/local/test/unit/test_pop3MoveFilter2.js
+++ b/mailnews/local/test/unit/test_pop3MoveFilter2.js
@@ -112,17 +112,17 @@ function setup_store(storeID)
     gMoveFolder = localAccountUtils.rootFolder.createLocalSubfolder("MoveFolder");
   }
 }
 
 function run_test()
 {
   for (let store of gPluggableStores) {
     add_task(setup_store(store));
-    gTestArray.forEach(add_task);
+    gTestArray.forEach(x => add_task(x));
   }
 
   add_task(exitTest);
   run_next_test();
 }
 
 function exitTest()
 {