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 33429 8283e69c9dfa
parent 33428 e8392f4d3862
child 33430 6c2c856e396f
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)
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();