Bug 1521706 - Fix test function not expecting deleteMessages to notify listeners; rs=bustage-fix
☠☠ backed out by a497d72c3d8a ☠ ☠
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 24 Jan 2019 19:47:52 +1300
changeset 25671 8283e69c9dfa24a55cd7c1276363043bf69cfcf1
parent 25670 e8392f4d3862a884b04a00c73dc3d2aa5767e720
child 25672 6c2c856e396fb4d4159737bf16545ecb260f7e09
push id15407
push usergeoff@darktrojan.net
push dateThu, 24 Jan 2019 06:48:13 +0000
treeherdercomm-central@8283e69c9dfa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1521706
Bug 1521706 - Fix test function not expecting deleteMessages to notify listeners; rs=bustage-fix
mailnews/test/resources/messageInjection.js
--- a/mailnews/test/resources/messageInjection.js
+++ b/mailnews/test/resources/messageInjection.js
@@ -979,36 +979,37 @@ function async_trash_messages(aSynMessag
     },
   });
 }
 
 /**
  * Delete all of the messages in a SyntheticMessageSet like the user performed a
  *  shift-delete (or if the messages were already in the trash).
  *
- * This is actually a synchronous operation.  I'm surprised too.
- *
  * @param aSynMessageSet The set of messages to delete.  The messages do not all
  *     have to be in the same folder, but we have to delete them folder by
  *     folder if they are not.
  */
 function async_delete_messages(aSynMessageSet) {
-  mark_action("messageInjection", "deleting messages",
-              aSynMessageSet.msgHdrList);
-  for (let [folder, xpcomHdrArray] of
-       aSynMessageSet.foldersWithXpcomHdrArrays()) {
-    mark_action("messageInjection", "deleting messages in folder",
-                [folder]);
-    folder.deleteMessages(xpcomHdrArray, null,
-                          /* delete storage */ true,
-                          /* is move? */ false,
-                          asyncCopyListener,
-                          /* do not allow undo, currently leaks */ false);
-  }
-  return true;
+  return async_run({func: function*() {
+    mark_action("messageInjection", "deleting messages",
+                aSynMessageSet.msgHdrList);
+    for (let [folder, xpcomHdrArray] of
+         aSynMessageSet.foldersWithXpcomHdrArrays()) {
+      mark_action("messageInjection", "deleting messages in folder",
+                  [folder]);
+      folder.deleteMessages(xpcomHdrArray, null,
+                            /* delete storage */ true,
+                            /* is move? */ false,
+                            asyncCopyListener,
+                            /* do not allow undo, currently leaks */ false);
+      yield false;
+    }
+    yield true;
+  }});
 }
 
 /**
  * Empty the trash.
  */
 function async_empty_trash() {
   return async_run({func: function*() {
     let trashHandle = get_trash_folder();