Backed out changeset bfbeab417a16 (bug 1498041) for causing MozMill failures. a=backout
authorJorg K <jorgk@jorgk.com>
Tue, 23 Oct 2018 11:21:24 +0200
changeset 33541 1fdc6763b5472cf29564e8c257bf84ab7402b55a
parent 33540 617e07ac0498edf0a03aad617447f7f89abef2a3
child 33542 09209cd0234390b24f1fe072ea9a5d0357a4ec84
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersbackout
bugs1498041
backs outbfbeab417a162552a710aa103f3e214587c6e515
Backed out changeset bfbeab417a16 (bug 1498041) for causing MozMill failures. a=backout
.eslintignore
mail/base/test/unit/.eslintrc.js
mail/base/test/unit/head_mailbase_maildir.js
mail/base/test/unit/resources/viewWrapperTestUtils.js
mail/base/test/unit/test_alertHook.js
mail/base/test/unit/test_attachmentChecker.js
mail/base/test/unit/test_emptyTrash_dbViewWrapper.js
mail/base/test/unit/test_mailGlue_distribution.js
mail/base/test/unit/test_viewWrapper_imapFolder.js
mail/base/test/unit/test_viewWrapper_logic.js
mail/base/test/unit/test_viewWrapper_realFolder.js
mail/base/test/unit/test_viewWrapper_virtualFolder.js
mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -45,16 +45,17 @@ mailnews/test/*
 
 # mailnews/extensions exclusions
 mailnews/extensions/*
 !mailnews/extensions/newsblog
 
 # mail exclusions
 mail/app/**
 mail/base/content/**
+mail/base/test/**
 mail/branding/**
 mail/config/**
 mail/extensions/**
 mail/installer/**
 mail/locales/**
 mail/test/**
 mail/themes/**
 
deleted file mode 100644
--- a/mail/base/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-/* eslint-env node */
-
-module.exports = {
-  "extends": [
-    "plugin:mozilla/xpcshell-test",
-  ],
-};
--- a/mail/base/test/unit/head_mailbase_maildir.js
+++ b/mail/base/test/unit/head_mailbase_maildir.js
@@ -1,7 +1,5 @@
-/* import-globals-from head_mailbase.js */
-
 // alternate head to set maildir as default
 load("head_mailbase.js");
 info("Running test with maildir");
 Services.prefs.setCharPref("mail.serverDefaultStoreContractID",
                            "@mozilla.org/msgstore/maildirstore;1");
--- a/mail/base/test/unit/resources/viewWrapperTestUtils.js
+++ b/mail/base/test/unit/resources/viewWrapperTestUtils.js
@@ -1,41 +1,18 @@
 /* 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/. */
 
-const {
-  DBViewWrapper,
-  IDBViewWrapperListener,
-} = ChromeUtils.import("resource:///modules/DBViewWrapper.jsm", null);
-const {
-  MailViewManager,
-  MailViewConstants,
-} = ChromeUtils.import("resource:///modules/MailViewManager.jsm", null);
+ChromeUtils.import("resource:///modules/DBViewWrapper.jsm");
+ChromeUtils.import("resource:///modules/MailViewManager.jsm");
+ChromeUtils.import("resource:///modules/virtualFolderWrapper.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {
-  VirtualFolderHelper,
-} = ChromeUtils.import("resource:///modules/virtualFolderWrapper.js", null);
-const {
-  toXPCOMArray,
-} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm", null);
 
-/* import-globals-from ../../../../../mailnews/test/resources/logHelper.js */
-load("../../../../mailnews/resources/logHelper.js");
-/* import-globals-from ../../../../../mailnews/test/resources/asyncTestUtils.js */
-load("../../../../mailnews/resources/asyncTestUtils.js");
-
-/* import-globals-from ../../../../../mailnews/test/resources/messageGenerator.js */
-load("../../../../mailnews/resources/messageGenerator.js");
-/* import-globals-from ../../../../../mailnews/test/resources/messageModifier.js */
-load("../../../../mailnews/resources/messageModifier.js");
-/* import-globals-from ../../../../../mailnews/test/resources/messageInjection.js */
-load("../../../../mailnews/resources/messageInjection.js");
-
-var gInbox, gMessageGenerator, gMessageScenarioFactory;
+var gInbox;
 
 /**
  * Do initialization for xpcshell-tests; not used by
  *  test-folder-display-helpers.js, our friendly mozmill test helper.
  */
 function initViewWrapperTestUtils(aInjectionConfig) {
   gMessageGenerator = new MessageGenerator();
   gMessageScenarioFactory = new MessageScenarioFactory(gMessageGenerator);
@@ -79,58 +56,58 @@ function assert_bit_set(aWhat, aBit, aWh
 }
 
 function assert_bit_not_set(aWhat, aBit, aWhy) {
   if (aWhat & aBit)
     do_throw(aWhy);
 }
 
 var gFakeCommandUpdater = {
-  updateCommandStatus() {
+  updateCommandStatus : function() {
   },
 
-  displayMessageChanged(aFolder, aSubject, aKeywords) {
+  displayMessageChanged : function(aFolder, aSubject, aKeywords) {
   },
 
-  summarizeSelection() {
+  summarizeSelection: function () {
   },
 
-  updateNextMessageAfterDelete() {
-  },
+  updateNextMessageAfterDelete : function() {
+  }
 };
 
 var gMockViewWrapperListener = {
   __proto__: IDBViewWrapperListener.prototype,
   shouldUseMailViews: true,
   shouldDeferMessageDisplayUntilAfterServerConnect: false,
-  shouldMarkMessagesReadOnLeavingFolder(aMsgFolder) {
+  shouldMarkMessagesReadOnLeavingFolder : function(aMsgFolder) {
       return Services.prefs
                      .getBoolPref("mailnews.mark_message_read." +
                                   aMsgFolder.server.type);
   },
   messenger: null,
   // use no message window!
   msgWindow: null,
   threadPaneCommandUpdater: gFakeCommandUpdater,
   // event handlers
   allMessagesLoadedEventCount: 0,
-  onMessagesLoaded(aAll) {
+  onMessagesLoaded: function(aAll) {
     if (!aAll)
       return;
     this.allMessagesLoadedEventCount++;
     if (this.pendingLoad) {
       this.pendingLoad = false;
       async_driver();
     }
   },
 
   messagesRemovedEventCount: 0,
-  onMessagesRemoved() {
+  onMessagesRemoved: function() {
     this.messagesRemovedEventCount++;
-  },
+  }
 };
 
 function punt() {
   dump("  ******************************\n");
   dump("  *** PUNTING! implement me! ***\n");
   dump("  ******************************\n");
 }
 
@@ -140,23 +117,23 @@ function punt() {
  *  a test completes, but also so we can provide useful information about the
  *  state of things if a test times out.
  */
 var VWTU_testHelper = {
   active_view_wrappers: [],
   active_real_folders: [],
   active_virtual_folders: [],
 
-  onVirtualFolderCreated(aVirtualFolder) {
+  onVirtualFolderCreated: function(aVirtualFolder) {
     this.active_virtual_folders.push(aVirtualFolder);
   },
 
-  postTest() {
+  postTest: function () {
     // close all the views we opened
-    this.active_view_wrappers.forEach(function(wrapper) {
+    this.active_view_wrappers.forEach(function (wrapper) {
       wrapper.close();
     });
     // verify that the notification helper has no outstanding listeners.
     if (IDBViewWrapperListener.prototype._FNH.haveListeners()) {
       let msg = "FolderNotificationHelper has listeners, but should not.";
       dump("*** " + msg + "\n");
       dump("Pending URIs:\n");
       for (let folderURI in IDBViewWrapperListener.prototype._FNH
@@ -167,44 +144,44 @@ var VWTU_testHelper = {
       for (let folderURI in IDBViewWrapperListener.prototype._FNH
                               ._interestedWrappers) {
         dump("  " + folderURI + "\n");
       }
       dump("***\n");
       do_throw(msg);
     }
     // force the folder to forget about the message database
-    this.active_virtual_folders.forEach(function(folder) {
+    this.active_virtual_folders.forEach(function (folder) {
       folder.msgDatabase = null;
     });
-    this.active_real_folders.forEach(function(folder) {
+    this.active_real_folders.forEach(function (folder) {
       folder.msgDatabase = null;
     });
 
     this.active_view_wrappers.splice(0);
     this.active_real_folders.splice(0);
     this.active_virtual_folders.splice(0);
 
     gMockViewWrapperListener.allMessagesLoadedEventCount = 0;
   },
-  onTimeout() {
+  onTimeout: function () {
     dump("-----------------------------------------------------------\n");
     dump("Active things at time of timeout:\n");
     for (let folder of this.active_real_folders) {
       dump("Real folder: " + folder.prettyName + "\n");
     }
     for (let virtFolder of this.active_virtual_folders) {
       dump("Virtual folder: " + virtFolder.prettyName + "\n");
     }
     for (let [i, viewWrapper] of this.active_view_wrappers.entries()) {
       dump("-----------------------------------\n");
       dump("Active view wrapper " + i + "\n");
       dump_view_state(viewWrapper);
     }
-  },
+  }
 };
 
 function make_view_wrapper() {
   let wrapper = new DBViewWrapper(gMockViewWrapperListener);
   VWTU_testHelper.active_view_wrappers.push(wrapper);
   return wrapper;
 }
 
@@ -326,25 +303,26 @@ var MSG_VIEW_FLAG_DUMMY = 0x20000000;
 function dump_view_contents(aViewWrapper) {
   let dbView = aViewWrapper.dbView;
   let treeView = aViewWrapper.dbView.QueryInterface(Ci.nsITreeView);
   let rowCount = treeView.rowCount;
 
   dump("********* Current View Contents\n");
   for (let iViewIndex = 0; iViewIndex < rowCount; iViewIndex++) {
     let level = treeView.getLevel(iViewIndex);
+    let viewFlags = dbView.viewFlags;
     let flags = dbView.getFlagsAt(iViewIndex);
     let msgHdr = dbView.getMsgHdrAt(iViewIndex);
 
     let s = WHITESPACE.substr(0, level * 2);
     if (treeView.isContainer(iViewIndex))
       s += treeView.isContainerOpen(iViewIndex) ? "- " : "+ ";
     else
       s += ". ";
-    // s += treeView.getCellText(iViewIndex, )
+    //s += treeView.getCellText(iViewIndex, )
     if (flags & MSG_VIEW_FLAG_DUMMY)
       s += "dummy: ";
     s += dbView.cellTextForColumn(iViewIndex, "subject");
     s += " [" + msgHdr.folder.prettyName + "," + msgHdr.messageKey + "]";
 
     dump(s + "\n");
   }
   dump("********* end view contents\n");
@@ -396,17 +374,17 @@ function dump_view_state(aViewWrapper, a
  *  sets or contains messages not in the provided sets, do_throw will be invoked
  *  with a human readable explanation of the problem.
  *
  * @param aSynSets A single SyntheticMessageSet or a list of
  *     SyntheticMessageSets.
  * @param aViewWrapper The DBViewWrapper whose contents you want to validate.
  */
 function verify_messages_in_view(aSynSets, aViewWrapper) {
-  if (!("length" in aSynSets))
+  if (!('length' in aSynSets))
     aSynSets = [aSynSets];
 
   // - Iterate over all the message sets, retrieving the message header.  Use
   //  this to construct a URI to populate a dictionary mapping.
   let synMessageURIs = {}; // map URI to message header
   for (let messageSet of aSynSets) {
     for (let msgHdr of messageSet.msgHdrs()) {
       synMessageURIs[msgHdr.folder.getUriForMsg(msgHdr)] = msgHdr;
@@ -421,18 +399,19 @@ function verify_messages_in_view(aSynSet
 
   for (let iViewIndex = 0; iViewIndex < rowCount; iViewIndex++) {
     let msgHdr = dbView.getMsgHdrAt(iViewIndex);
     let uri = msgHdr.folder.getUriForMsg(msgHdr);
     // expected hit, null it out. (in the dummy case, we will just null out
     //  twice, which is also why we do an 'in' test and not a value test.
     if (uri in synMessageURIs) {
       synMessageURIs[uri] = null;
-    } else {
-      // the view is showing a message that should not be shown, explode.
+    }
+    // the view is showing a message that should not be shown, explode.
+    else {
       dump("The view is showing the following message header and should not" +
            " be:\n");
       dump_message_header(msgHdr);
       dump("View State:\n");
       dump_view_state(aViewWrapper);
       mark_failure(["view contains header that should not be present!",
                     msgHdr]);
     }
@@ -464,16 +443,17 @@ function verify_empty_view(aViewWrapper)
 /**
  * Build a histogram of the treeview levels and verify it matches the expected
  *  histogram.  Oddly enough, I find this to be a reasonable and concise way to
  *  verify that threading mode is enabled.  Keep in mind that this file is
  *  currently not used to test the actual thread logic.  If/when that day comes,
  *  something less eccentric is certainly the way that should be tested.
  */
 function verify_view_level_histogram(aExpectedHisto, aViewWrapper) {
+  let dbView = aViewWrapper.dbView;
   let treeView = aViewWrapper.dbView.QueryInterface(Ci.nsITreeView);
   let rowCount = treeView.rowCount;
 
   let actualHisto = {};
   for (let iViewIndex = 0; iViewIndex < rowCount; iViewIndex++) {
     let level = treeView.getLevel(iViewIndex);
     actualHisto[level] = (actualHisto[level] || 0) + 1;
   }
--- a/mail/base/test/unit/test_alertHook.js
+++ b/mail/base/test/unit/test_alertHook.js
@@ -10,30 +10,31 @@ alertHook.init();
 
 // Replace the alerts service with our own. This will let us check if we're
 // prompting or not.
 var gAlertShown = false;
 
 var mockAlertsService = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIAlertsService]),
 
-  showAlertNotification(imageUrl, title, text, textClickable, cookie, alertListener, name) {
+  showAlertNotification: function(imageUrl, title, text, textClickable, cookie,
+                                  alertListener, name) {
     gAlertShown = true;
-  },
+  }
 };
 
 var gMsgWindow = {};
 
 var mailnewsURL = {
   get msgWindow() {
     if (gMsgWindow)
       return gMsgWindow;
 
     throw Cr.NS_ERROR_INVALID_POINTER;
-  },
+  }
 };
 
 function run_test() {
   // First register the mock alerts service
   let uuid = MockFactory.register("@mozilla.org/alerts-service;1", mockAlertsService);
   registerCleanupFunction(function() {
     MockFactory.unregister(uuid);
   });
--- a/mail/base/test/unit/test_attachmentChecker.js
+++ b/mail/base/test/unit/test_attachmentChecker.js
@@ -15,31 +15,34 @@
 // Globals
 
 ChromeUtils.import("resource:///modules/AttachmentChecker.jsm");
 
 /*
  * UTILITIES
  */
 
-function assert(aBeTrue, aWhy) {
+function assert(aBeTrue, aWhy)
+{
   if (!aBeTrue)
     do_throw(aWhy);
-}
+};
 
-function assert_equal(aA, aB, aWhy) {
+function assert_equal(aA, aB, aWhy)
+{
   assert(aA == aB, aWhy + " (" + unescape(encodeURIComponent(aA)) + " != " +
                                  unescape(encodeURIComponent(aB)) + ").");
-}
+};
 
 /*
  * TESTS
  */
 
-function test_getAttachmentKeywords(desc, mailData, keywords, expected) {
+function test_getAttachmentKeywords(desc, mailData, keywords, expected)
+{
   let result = AttachmentChecker.getAttachmentKeywords(mailData, keywords);
   assert_equal(result, expected, desc + " not equal!");
 }
 
 var tests = [
   // Desc, mail body Data, keywords to search for, expected keywords found.
   ["Simple keyword", "latte.ca", "latte", "latte"],
   ["Extension", "testing document.pdf", ".pdf", "document.pdf"],
@@ -66,19 +69,20 @@ var tests = [
   ["Should match Japanese", "a test.添付 a", ".添付", "test.添付"],
   ["Should match Greek", "a test.Θεωρία a", ".Θεωρία", "test.Θεωρία"],
   ["Should match once", "a test.pdf.doc a", ".pdf,.doc", "test.pdf.doc"],
   ["Should not match kw in url", "see https://example.org/attachment.cgi?id=1 test", "attachment", ""],
   ["Should not match kw in url ending with kw", "https://example.org/attachment", "attachment", ""],
   ["Should match CV and attachment", "got my CV as attachment", "CV,attachment", "CV,attachment"],
 ];
 
-function run_test() {
+function run_test()
+{
   do_test_pending();
 
   for (var i in tests)
     if (typeof(tests[i]) == "function")
       tests[i]();
     else
       test_getAttachmentKeywords.apply(null, tests[i]);
 
   do_test_finished();
-}
+};
--- a/mail/base/test/unit/test_emptyTrash_dbViewWrapper.js
+++ b/mail/base/test/unit/test_emptyTrash_dbViewWrapper.js
@@ -1,9 +1,15 @@
-/* import-globals-from resources/viewWrapperTestUtils.js */
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
+
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
+
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils({mode: "imap", offline: false});
 
 function* test_real_folder_load_and_move_to_trash() {
   let viewWrapper = make_view_wrapper();
   let [msgFolder, msgSet] = make_folder_with_sets([{count: 1}]);
 
   yield wait_for_message_injection();
@@ -30,14 +36,14 @@ function* test_empty_trash() {
 
   let [msgSet] = make_new_sets_in_folders([trashHandle], [{count: 1}]);
   yield wait_for_message_injection();
   verify_messages_in_view(msgSet, viewWrapper);
 }
 
 var tests = [
   test_real_folder_load_and_move_to_trash,
-  test_empty_trash,
+  test_empty_trash
 ];
 
 function run_test() {
   async_run_tests(tests);
 }
--- a/mail/base/test/unit/test_mailGlue_distribution.js
+++ b/mail/base/test/unit/test_mailGlue_distribution.js
@@ -1,15 +1,13 @@
-// This file uses eval, but really shouldn't. See bug 1498497.
-/* eslint-disable no-eval */
-
 ChromeUtils.import("resource:///modules/TBDistCustomizer.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-function run_test() {
+function run_test()
+{
   do_test_pending();
 
   Services.locale.requestedLocales = ["en-US"];
 
   // Create an instance of nsIFile out of the current process directory
   let distroDir = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
 
   // Construct a descendant of the distroDir file
@@ -22,16 +20,19 @@ function run_test() {
   iniFile.append("distribution.ini");
   // It's a bug if distribution.ini already exists
   if (iniFile.exists()) {
     do_throw("distribution.ini already exists in objdir/mozilla/dist/bin/distribution.");
   }
 
   registerCleanupFunction(function() {
     // Remove the distribution.ini file
+    let iniFile = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
+    iniFile.append("distribution");
+    iniFile.append("distribution.ini");
     if (iniFile.exists())
       iniFile.remove(true);
   });
 
   let testDir = Services.dirsvc.get("CurWorkD", Ci.nsIFile);
   let testDistributionFile = testDir.clone();
 
   // Construct descendant file
@@ -55,17 +56,18 @@ function run_test() {
 
   iniValue = testIni.getString("Global", "version");
   pref = Services.prefs.getCharPref("distribution.version");
   Assert.equal(iniValue, pref);
 
   let aboutLocale;
   try {
     aboutLocale = testIni.getString("Global", "about.en-US");
-  } catch (e) {
+  }
+  catch (e) {
     Cu.reportError(e);
   }
 
   if (aboutLocale == undefined)
     aboutLocale = testIni.getString("Global", "about");
 
   pref = Services.prefs.getCharPref("distribution.about");
   Assert.equal(aboutLocale, pref);
--- a/mail/base/test/unit/test_viewWrapper_imapFolder.js
+++ b/mail/base/test/unit/test_viewWrapper_imapFolder.js
@@ -1,15 +1,21 @@
 /**
  * Test DBViewWrapper against a single imap folder.  Try and test all the
  *  features we can without having a fake newsgroup.  (Some features are
  *  newsgroup specific.)
  */
 
-/* import-globals-from resources/viewWrapperTestUtils.js */
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
+
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
+
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils({mode: "imap", offline: false});
 
 /**
  * Create an empty folder, inject messages into it without triggering an
  *  updateFolder, sanity check that we believe there are no messages in the
  *  folder, then enter, making sure we immediately enter and that the view
  *  properly updates to reflect there being the right set of messages.
--- a/mail/base/test/unit/test_viewWrapper_logic.js
+++ b/mail/base/test/unit/test_viewWrapper_logic.js
@@ -1,17 +1,24 @@
-/* import-globals-from resources/viewWrapperTestUtils.js */
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
+load("../../../../mailnews/resources/abSetup.js");
+
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
+
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils();
 
 /**
  * Verify that flipping between threading and grouped by sort settings properly
  *  clears the other flag.  (Because they're mutually exclusive, you see.)
  */
-function* test_threading_grouping_mutual_exclusion() {
+function* test_threading_grouping_mutual_exclusion () {
   let viewWrapper = make_view_wrapper();
   let folder = make_empty_folder();
 
   yield async_view_open(viewWrapper, folder);
   // enter an update that will never conclude.  this is fine.
   viewWrapper.beginViewUpdate();
   viewWrapper.showThreaded = true;
   assert_true(viewWrapper.showThreaded,
@@ -73,17 +80,17 @@ function* test_threads_special_views_mut
  * Do a quick test of primary sorting to make sure we're actually changing the
  *  sort order.  (However, we are not responsible for verifying correctness of
  *  the sort.)
  */
 function* test_sort_primary() {
   let viewWrapper = make_view_wrapper();
   // we need to put messages in the folder or the sort logic doesn't actually
   //  save the sort state. (this is the C++ view's fault.)
-  let [folder] = make_folder_with_sets(1);
+  let [folder, msgSet] = make_folder_with_sets(1);
 
   yield async_view_open(viewWrapper, folder);
   viewWrapper.sort(Ci.nsMsgViewSortType.byDate,
                    Ci.nsMsgViewSortOrder.ascending);
   assert_equals(viewWrapper.dbView.sortType, Ci.nsMsgViewSortType.byDate,
                 "sort should be by date", true);
   assert_equals(viewWrapper.dbView.sortOrder, Ci.nsMsgViewSortOrder.ascending,
                 "sort order should be ascending", true);
@@ -98,17 +105,17 @@ function* test_sort_primary() {
 
 /**
  * Verify that we handle explicit secondary sorts correctly.
  */
 function* test_sort_secondary_explicit() {
   let viewWrapper = make_view_wrapper();
   // we need to put messages in the folder or the sort logic doesn't actually
   //  save the sort state. (this is the C++ view's fault.)
-  let [folder] = make_folder_with_sets(1);
+  let [folder, msgSet] = make_folder_with_sets(1);
 
   yield async_view_open(viewWrapper, folder);
   viewWrapper.sort(Ci.nsMsgViewSortType.byAuthor,
                    Ci.nsMsgViewSortOrder.ascending,
                    Ci.nsMsgViewSortType.bySubject,
                    Ci.nsMsgViewSortOrder.descending
                    );
   // check once for what we just did, then again after refreshing to make
@@ -136,17 +143,17 @@ function* test_sort_secondary_explicit()
  *  let's make sure we obey its assumptions unless we have gone and made the UI
  *  be explicit about these things.  We can't simply depend on the view to do
  *  this for us.  Why?  Because we re-create the view all the bloody time.
  */
 function* test_sort_secondary_implicit() {
   let viewWrapper = make_view_wrapper();
   // we need to put messages in the folder or the sort logic doesn't actually
   //  save the sort state. (this is the C++ view's fault.)
-  let [folder] = make_folder_with_sets(1);
+  let [folder, msgSet] = make_folder_with_sets(1);
 
   yield async_view_open(viewWrapper, folder);
   viewWrapper.magicSort(Ci.nsMsgViewSortType.bySubject,
                         Ci.nsMsgViewSortOrder.descending);
   viewWrapper.magicSort(Ci.nsMsgViewSortType.byAuthor,
                         Ci.nsMsgViewSortOrder.ascending);
   // check once for what we just did, then again after refreshing to make
   //  sure the sort order 'stuck'
@@ -173,17 +180,17 @@ function* test_sort_secondary_implicit()
  *
  * Note: Sorting changes are synchronous, but toggling grouped by sort requries
  *  a view rebuild.
  */
 function* test_sort_group_by_sort() {
   let viewWrapper = make_view_wrapper();
   // we need to put messages in the folder or the sort logic doesn't actually
   //  save the sort state. (this is the C++ view's fault.)
-  let [folder] = make_folder_with_sets(1);
+  let [folder, msgSet] = make_folder_with_sets(1);
   yield async_view_open(viewWrapper, folder);
 
   // - start out by being in an illegal (for group-by-sort) sort mode and
   //  switch to group-by-sort.
   // (sorting changes are synchronous)
   viewWrapper.sort(Ci.nsMsgViewSortType.byId,
                    Ci.nsMsgViewSortOrder.descending);
   yield async_view_group_by_sort(viewWrapper, true);
--- a/mail/base/test/unit/test_viewWrapper_realFolder.js
+++ b/mail/base/test/unit/test_viewWrapper_realFolder.js
@@ -1,15 +1,21 @@
 /**
  * Test DBViewWrapper against a single local folder.  Try and test all the
  *  features we can without having a fake newsgroup.  (Some features are
  *  newsgroup specific.)
  */
 
-/* import-globals-from resources/viewWrapperTestUtils.js */
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
+
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
+
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils();
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /* ===== Real Folder, no features ===== */
 
 /**
@@ -138,17 +144,18 @@ function* test_real_folder_threading_thr
 }
 
 function* test_real_folder_threading_grouped_by_sort() {
   let viewWrapper = make_view_wrapper();
 
   // create some messages that belong to the 'in this week' bucket when sorting
   //  by date and grouping by date.
   const count = 5;
-  let [folder] = make_folder_with_sets([{count, age: {days: 2}, age_incr: {mins: 1}}]);
+  let [folder, messageSet] = make_folder_with_sets([
+    {count: count, age: {days: 2}, age_incr: {mins: 1}}]);
 
   // group-by-sort sorted by date
   yield async_view_open(viewWrapper, folder);
   viewWrapper.beginViewUpdate();
   viewWrapper.showGroupedBySort = true;
   // whitebox test view flags (we've gotten them wrong before...)
   assert_bit_set(viewWrapper._viewFlags,
                  Ci.nsMsgViewFlagsType.kThreadedDisplay,
@@ -332,33 +339,33 @@ function* test_real_folder_mail_views_un
   verify_messages_in_view([setOne, setTwo, setThree], viewWrapper);
 }
 
 function* test_real_folder_mail_views_tags() {
   let viewWrapper = make_view_wrapper();
 
   // setup the initial set with the tag
   let [folder, setOne, setTwo] = make_folder_with_sets(2);
-  setOne.addTag("$label1");
+  setOne.addTag('$label1');
 
   // open, apply mail view constraint, see those messages
   yield async_view_open(viewWrapper, folder);
-  yield async_view_set_mail_view(viewWrapper, MailViewConstants.kViewItemTags, "$label1");
+  yield async_view_set_mail_view(viewWrapper, MailViewConstants.kViewItemTags, '$label1');
   verify_messages_in_view(setOne, viewWrapper);
 
   // add some more with the tag
-  setTwo.addTag("$label1");
+  setTwo.addTag('$label1');
 
   // make sure they showed up
   yield async_view_refresh(viewWrapper); // QUICKSEARCH-VIEW-LIMITATION-REMOVE
   verify_messages_in_view([setOne, setTwo], viewWrapper);
 
   // remove them all
-  setOne.removeTag("$label1");
-  setTwo.removeTag("$label1");
+  setOne.removeTag('$label1');
+  setTwo.removeTag('$label1');
 
   // make sure they all disappeared. #3
   yield async_view_refresh(viewWrapper);
   verify_empty_view(viewWrapper);
 }
 
 function test_real_folder_mail_views_not_deleted() {
   // not sure how to test this in the absence of an IMAP account with the IMAP
@@ -371,55 +378,55 @@ function test_real_folder_mail_views_cus
   punt();
 }
 
 // recent mail = less than 1 day
 function* test_real_folder_mail_views_custom_recent_mail() {
   let viewWrapper = make_view_wrapper();
 
   // create a set that meets the threshold and a set that does not
-  let [folder, setRecent] = make_folder_with_sets([
+  let [folder, setRecent, setOld] = make_folder_with_sets([
     {age: {mins: 0}},
     {age: {days: 2}, age_incr: {mins: 1}},
   ]);
 
   // open the folder, ensure only the recent guys show. #1
   yield async_view_open(viewWrapper, folder);
   yield async_view_set_mail_view(viewWrapper, "Recent Mail");
   verify_messages_in_view(setRecent, viewWrapper);
 
   // add two more sets, one that meets, and one that doesn't. #2
-  let [setMoreRecent] = make_new_sets_in_folder(folder, [
+  let [setMoreRecent, setMoreOld] = make_new_sets_in_folder(folder, [
     {age: {mins: 0}},
     {age: {days: 2, hours: 1}, age_incr: {mins: 1}},
   ]);
   // make sure that all we see is our previous recent set and our new recent set
   verify_messages_in_view([setRecent, setMoreRecent], viewWrapper);
 
   // we aren't going to mess with the system clock, so no #3.
   // (we are assuming that the underlying code handles message deletion.  also,
   //  we are taking the position that message timestamps should not change.)
 }
 
 function* test_real_folder_mail_views_custom_last_5_days() {
   let viewWrapper = make_view_wrapper();
 
   // create a set that meets the threshold and a set that does not
-  let [folder, setRecent] = make_folder_with_sets([
+  let [folder, setRecent, setOld] = make_folder_with_sets([
     {age: {days: 2}, age_incr: {mins: 1}},
     {age: {days: 6}, age_incr: {mins: 1}},
   ]);
 
   // open the folder, ensure only the recent guys show. #1
   yield async_view_open(viewWrapper, folder);
   yield async_view_set_mail_view(viewWrapper, "Last 5 Days");
   verify_messages_in_view(setRecent, viewWrapper);
 
   // add two more sets, one that meets, and one that doesn't. #2
-  let [setMoreRecent] = make_new_sets_in_folder(folder, [
+  let [setMoreRecent, setMoreOld] = make_new_sets_in_folder(folder, [
     {age: {mins: 0}},
     {age: {days: 5, hours: 1}, age_incr: {mins: 1}},
   ]);
   // make sure that all we see is our previous recent set and our new recent set
   verify_messages_in_view([setRecent, setMoreRecent], viewWrapper);
 
   // we aren't going to mess with the system clock, so no #3.
   // (we are assuming that the underlying code handles message deletion.  also,
@@ -448,28 +455,30 @@ function* test_real_folder_mail_views_cu
   setFlippy.setJunk(true);
   yield async_view_refresh(viewWrapper);
   verify_messages_in_view(setNotJunk, viewWrapper);
 }
 
 function* test_real_folder_mail_views_custom_has_attachments() {
   let viewWrapper = make_view_wrapper();
 
-  let attachSetDef = {attachments: [{filename: "foo.png",
-                                     contentType: "image/png",
-                                     encoding: "base64", charset: null,
-                                     body: "YWJj\n", format: null}]};
+  let attachSetDef = {attachments: [{filename: 'foo.png',
+                                     contentType: 'image/png',
+                                     encoding: 'base64', charset: null,
+                                     body: 'YWJj\n', format: null}]};
   let noAttachSetDef = {};
 
-  let [folder, , setAttach] = make_folder_with_sets([noAttachSetDef, attachSetDef]);
+  let [folder, setNoAttach, setAttach] =
+    make_folder_with_sets([noAttachSetDef, attachSetDef]);
   yield async_view_open(viewWrapper, folder);
   yield async_view_set_mail_view(viewWrapper, "Has Attachments");
   verify_messages_in_view(setAttach, viewWrapper);
 
-  let [setMoreAttach] = make_new_sets_in_folder(folder, [attachSetDef, noAttachSetDef]);
+  let [setMoreAttach, setMoreNoAttach] =
+    make_new_sets_in_folder(folder, [attachSetDef, noAttachSetDef]);
   verify_messages_in_view([setAttach, setMoreAttach], viewWrapper);
 }
 
 /* ===== Real Folder, Special Views ===== */
 
 function* test_real_folder_special_views_threads_with_unread() {
   let viewWrapper = make_view_wrapper();
   let folder = make_empty_folder();
--- a/mail/base/test/unit/test_viewWrapper_virtualFolder.js
+++ b/mail/base/test/unit/test_viewWrapper_virtualFolder.js
@@ -6,17 +6,23 @@
  *   view's problem!  (We test it in the real folder to make sure we are telling
  *   it to do things correctly.)
  * - view flags.  Again, it's a db view issue once we're sure we set the bits.
  * - special view with threads.  same deal.
  *
  * We could test all these things, but my patch is way behind schedule...
  */
 
-/* import-globals-from resources/viewWrapperTestUtils.js */
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
+
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
+
 load("resources/viewWrapperTestUtils.js");
 initViewWrapperTestUtils();
 
 /**
  * Make sure we open a virtual folder backed by a single underlying folder
  *  correctly; no constraints.
  */
 function* test_virtual_folder_single_load_no_pred() {
@@ -39,17 +45,18 @@ function* test_virtual_folder_single_loa
 
 /**
  * Make sure we open a virtual folder backed by a single underlying folder
  *  correctly; one constraint.
  */
 function* test_virtual_folder_single_load_simple_pred() {
   let viewWrapper = make_view_wrapper();
 
-  let [folderOne, oneSubjFoo] = make_folder_with_sets([{subject: "foo"}, {}]);
+  let [folderOne, oneSubjFoo, oneNopers] = make_folder_with_sets([
+    {subject: "foo"}, {}]);
 
   let virtFolder = make_virtual_folder([folderOne],
                                        {subject: "foo"});
   yield async_view_open(viewWrapper, virtFolder);
 
   verify_messages_in_view(oneSubjFoo, viewWrapper);
   virtFolder.parent.propagateDelete(virtFolder, true, null);
 }
@@ -58,17 +65,17 @@ function* test_virtual_folder_single_loa
  * Make sure we open a virtual folder backed by a single underlying folder
  *  correctly; two constraints ANDed together.
  */
 function* test_virtual_folder_single_load_complex_pred() {
   let viewWrapper = make_view_wrapper();
 
   let whoBar = make_person_with_word_in_name("bar");
 
-  let [folderOne, , , oneBoth] =
+  let [folderOne, oneSubjOnly, oneFromOnly, oneBoth, oneNone] =
     make_folder_with_sets([{subject: "foo"}, {from: whoBar},
                            {subject: "foo", from: whoBar}, {}]);
 
   let virtFolder = make_virtual_folder([folderOne],
                                        {subject: "foo", from: "bar"},
                                        /* and? */ true);
   yield async_view_open(viewWrapper, virtFolder);
 
@@ -79,23 +86,26 @@ function* test_virtual_folder_single_loa
 /**
  * Open a single-backed virtual folder, verify, open another single-backed
  *  virtual folder, verify.  We are testing our ability to change folders
  *  without exploding.
  */
 function* test_virtual_folder_single_load_after_load() {
   let viewWrapper = make_view_wrapper();
 
-  let [folderOne, oneSubjFoo] = make_folder_with_sets([{subject: "foo"}, {}]);
-  let virtOne = make_virtual_folder([folderOne], {subject: "foo"});
+  let [folderOne, oneSubjFoo, oneNopers] = make_folder_with_sets([
+    {subject: "foo"}, {}]);
+  let virtOne = make_virtual_folder([folderOne],
+                                    {subject: "foo"});
   yield async_view_open(viewWrapper, virtOne);
   verify_messages_in_view([oneSubjFoo], viewWrapper);
 
   // use "bar" instead of "foo" to make sure constraints are properly changing
-  let [folderTwo, twoSubjBar] = make_folder_with_sets([{subject: "bar"}, {}]);
+  let [folderTwo, twoSubjBar, twoNopers] = make_folder_with_sets([
+    {subject: "bar"}, {}]);
   let virtTwo = make_virtual_folder([folderTwo],
                                     {subject: "bar"});
   yield async_view_open(viewWrapper, virtTwo);
   verify_messages_in_view([twoSubjBar], viewWrapper);
   virtOne.parent.propagateDelete(virtOne, true, null);
   virtTwo.parent.propagateDelete(virtTwo, true, null);
 }
 
@@ -145,18 +155,20 @@ function* test_virtual_folder_multi_sort
 
 /**
  * Make sure we open a virtual folder backed by multiple underlying folders
  *  correctly; one constraint.
  */
 function* test_virtual_folder_multi_load_simple_pred() {
   let viewWrapper = make_view_wrapper();
 
-  let [folderOne, oneSubjFoo] = make_folder_with_sets([{subject: "foo"}, {}]);
-  let [folderTwo, twoSubjFoo] = make_folder_with_sets([{subject: "foo"}, {}]);
+  let [folderOne, oneSubjFoo, oneNopers] = make_folder_with_sets([
+    {subject: "foo"}, {}]);
+  let [folderTwo, twoSubjFoo, twoNopers] = make_folder_with_sets([
+    {subject: "foo"}, {}]);
 
   let virtFolder = make_virtual_folder([folderOne, folderTwo],
                                        {subject: "foo"});
   yield async_view_open(viewWrapper, virtFolder);
 
   verify_messages_in_view([oneSubjFoo, twoSubjFoo], viewWrapper);
   virtFolder.parent.propagateDelete(virtFolder, true, null);
 }
@@ -165,20 +177,20 @@ function* test_virtual_folder_multi_load
  * Make sure we open a virtual folder backed by multiple underlying folders
  *  correctly; two constraints ANDed together.
  */
 function* test_virtual_folder_multi_load_complex_pred() {
   let viewWrapper = make_view_wrapper();
 
   let whoBar = make_person_with_word_in_name("bar");
 
-  let [folderOne, , , oneBoth] =
+  let [folderOne, oneSubjOnly, oneFromOnly, oneBoth, oneNone] =
     make_folder_with_sets([{subject: "foo"}, {from: whoBar},
                            {subject: "foo", from: whoBar}, {}]);
-  let [folderTwo, , , twoBoth] =
+  let [folderTwo, twoSubjOnly, twoFromOnly, twoBoth, twoNone] =
     make_folder_with_sets([{subject: "foo"}, {from: whoBar},
                            {subject: "foo", from: whoBar}, {}]);
 
   let virtFolder = make_virtual_folder([folderOne, folderTwo],
                                        {subject: "foo", from: "bar"},
                                        /* and? */ true);
   yield async_view_open(viewWrapper, virtFolder);
 
@@ -220,23 +232,25 @@ function* test_virtual_folder_multi_load
 
 /**
  * Make sure that opening a virtual folder backed by multiple real folders, then
  *  opening another virtual folder of the same variety works without explosions.
  */
 function* test_virtual_folder_multi_load_after_load() {
   let viewWrapper = make_view_wrapper();
 
-  let [foldersOne, oneSubjFoo] = make_folders_with_sets(2, [{subject: "foo"}, {}]);
+  let [foldersOne, oneSubjFoo, oneNopers] = make_folders_with_sets(2, [
+    {subject: "foo"}, {}]);
   let virtOne = make_virtual_folder(foldersOne, {subject: "foo"});
   yield async_view_open(viewWrapper, virtOne);
   verify_messages_in_view([oneSubjFoo], viewWrapper);
 
   // use "bar" instead of "foo" to make sure constraints are properly changing
-  let [foldersTwo, twoSubjBar] = make_folders_with_sets(3, [{subject: "bar"}, {}]);
+  let [foldersTwo, twoSubjBar, twoNopers] = make_folders_with_sets(3, [
+    {subject: "bar"}, {}]);
   let virtTwo = make_virtual_folder(foldersTwo,
                                     {subject: "bar"});
   yield async_view_open(viewWrapper, virtTwo);
   verify_messages_in_view([twoSubjBar], viewWrapper);
 
   yield async_view_open(viewWrapper, virtOne);
   verify_messages_in_view([oneSubjFoo], viewWrapper);
   virtOne.parent.propagateDelete(virtOne, true, null);
@@ -248,23 +262,25 @@ function* test_virtual_folder_multi_load
  *  a multi-backed one, then the single-backed one again doesn't explode.
  *
  * This is just test_virtual_folder_multi_load_after_load with foldersOne told
  *  to create just a single folder.
  */
 function* test_virtual_folder_combo_load_after_load() {
   let viewWrapper = make_view_wrapper();
 
-  let [foldersOne, oneSubjFoo] = make_folders_with_sets(1, [{subject: "foo"}, {}]);
+  let [foldersOne, oneSubjFoo, oneNopers] = make_folders_with_sets(1, [
+    {subject: "foo"}, {}]);
   let virtOne = make_virtual_folder(foldersOne, {subject: "foo"});
   yield async_view_open(viewWrapper, virtOne);
   verify_messages_in_view([oneSubjFoo], viewWrapper);
 
   // use "bar" instead of "foo" to make sure constraints are properly changing
-  let [foldersTwo, twoSubjBar] = make_folders_with_sets(3, [{subject: "bar"}, {}]);
+  let [foldersTwo, twoSubjBar, twoNopers] = make_folders_with_sets(3, [
+    {subject: "bar"}, {}]);
   let virtTwo = make_virtual_folder(foldersTwo,
                                     {subject: "bar"});
   yield async_view_open(viewWrapper, virtTwo);
   verify_messages_in_view([twoSubjBar], viewWrapper);
 
   yield async_view_open(viewWrapper, virtOne);
   verify_messages_in_view([oneSubjFoo], viewWrapper);
   virtOne.parent.propagateDelete(virtOne, true, null);
@@ -291,18 +307,20 @@ function* test_virtual_folder_filters_ou
 /**
  * Verify that if one of the folders backing our virtual folder is deleted that
  *  we do not explode.  Then verify that if we remove the rest of them that the
  *  view wrapper closes itself.
  */
 function* test_virtual_folder_underlying_folder_deleted() {
   let viewWrapper = make_view_wrapper();
 
-  let [folderOne] = make_folder_with_sets([{subject: "foo"}, {}]);
-  let [folderTwo, twoSubjFoo] = make_folder_with_sets([{subject: "foo"}, {}]);
+  let [folderOne, oneSubjFoo, oneNopers] = make_folder_with_sets([
+    {subject: "foo"}, {}]);
+  let [folderTwo, twoSubjFoo, twoNopers] = make_folder_with_sets([
+    {subject: "foo"}, {}]);
 
   let virtFolder = make_virtual_folder([folderOne, folderTwo],
                                        {subject: "foo"});
   yield async_view_open(viewWrapper, virtFolder);
 
   // this triggers the search (under the view's hood), so it's async
   yield async_delete_folder(folderOne, viewWrapper);
 
@@ -311,40 +329,41 @@ function* test_virtual_folder_underlying
 
   // this one is not async though, because we are expecting to close the wrapper
   //  and ignore the view entirely, so do not yield.
   delete_folder(folderTwo);
 
   // now the view wrapper should have closed itself.
   Assert.equal(null, viewWrapper.displayedFolder);
   // This fails because virtFolder.parent is null, not sure why
-  // virtFolder.parent.propagateDelete(virtFolder, true, null);
+  //virtFolder.parent.propagateDelete(virtFolder, true, null);
 }
 
 /* ===== Virtual Folder, Mail Views ===== */
 
 /*
  * We do not need to test all of the mail view permutations, realFolder
  *  already did that.  We just need to make sure it works at all.
  */
 
 function* test_virtual_folder_mail_views_unread(aNumFolders) {
   let viewWrapper = make_view_wrapper();
 
-  let [folders, fooOne, fooTwo] = make_folders_with_sets(
+  let [folders, fooOne, fooTwo, nopeOne, nopeTwo] = make_folders_with_sets(
     aNumFolders, [{subject: "foo 1"}, {subject: "foo 2"}, {}, {}]);
   let virtFolder = make_virtual_folder(folders, {subject: "foo"});
 
   // everything is unread to start with!
   yield async_view_open(viewWrapper, virtFolder);
   yield async_view_set_mail_view(viewWrapper, MailViewConstants.kViewItemUnread);
   verify_messages_in_view([fooOne, fooTwo], viewWrapper);
 
   // add some more things (unread!), make sure they appear.
-  let [fooThree] = make_new_sets_in_folders(folders, [{subject: "foo 3"}, {}]);
+  let [fooThree, nopeThree] = make_new_sets_in_folders(folders,
+    [{subject: "foo 3"}, {}]);
   verify_messages_in_view([fooOne, fooTwo, fooThree], viewWrapper);
 
   // make some things read, make sure they disappear. (after a refresh)
   fooTwo.setRead(true);
   yield async_view_refresh(viewWrapper);
   verify_messages_in_view([fooOne, fooThree], viewWrapper);
 
   // make those things un-read again.
@@ -358,23 +377,25 @@ function* test_virtual_folder_mail_views
 
 // This tests that clearing the new messages in a folder also clears the
 // new flag on saved search folders based on the real folder. This could be a
 // core view test, or a mozmill test, but I think the view wrapper stuff
 // is involved in some of the issues here, so this is a compromise.
 function* test_virtual_folder_mail_new_handling() {
   let viewWrapper = make_view_wrapper();
 
-  let [folders] = make_folders_with_sets(1, [{subject: "foo 1"}, {subject: "foo 2"}]);
+  let [folders, fooOne, fooTwo] = make_folders_with_sets(
+    1, [{subject: "foo 1"}, {subject: "foo 2"}]);
   let folder = folders[0];
   let virtFolder = make_virtual_folder(folders, {subject: "foo"});
 
   yield async_view_open(viewWrapper, folder);
 
-  make_new_sets_in_folders(folders, [{subject: "foo 3"}, {}]);
+  let [fooThree, nopeThree] = make_new_sets_in_folders(folders,
+    [{subject: "foo 3"}, {}]);
 
   if (!virtFolder.hasNewMessages)
     do_throw("saved search should have new messages!");
 
   if (!folder.hasNewMessages)
     do_throw("folder should have new messages!");
 
   viewWrapper.close();
--- a/mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
+++ b/mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
@@ -2,17 +2,23 @@
  * Test DBViewWrapper against a virtual folder with a custom search term.
  *
  *  This test uses an imap message to specifically test the issues from
  *   bug 549336. The code is derived from test_viewWrapper_virtualFolder.js
  *
  *  Original author: Kent James
  */
 
-/* import-globals-from resources/viewWrapperTestUtils.js */
+load("../../../../mailnews/resources/logHelper.js");
+load("../../../../mailnews/resources/asyncTestUtils.js");
+
+load("../../../../mailnews/resources/messageGenerator.js");
+load("../../../../mailnews/resources/messageModifier.js");
+load("../../../../mailnews/resources/messageInjection.js");
+
 load("resources/viewWrapperTestUtils.js");
 
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 initViewWrapperTestUtils({mode: "imap", offline: false});
 
 /**
  * A custom search term, that just does Subject Contains
@@ -40,17 +46,18 @@ MailServices.filters.addCustomTerm(gCust
 
 /**
  * Make sure we open a virtual folder backed by a single underlying folder
  *  correctly, with a custom search term.
  */
 function* test_virtual_folder_single_load_custom_pred() {
   let viewWrapper = make_view_wrapper();
 
-  let [folderOne, oneSubjFoo] = make_folder_with_sets([{subject: "foo"}, {}]);
+  let [folderOne, oneSubjFoo, oneNopers] = make_folder_with_sets([
+    {subject: "foo"}, {}]);
 
   yield wait_for_message_injection();
 
   let virtFolder = make_virtual_folder(folderOne,
                                        {custom: "foo"});
 
   yield async_view_open(viewWrapper, virtFolder);