Bug 1642281 - Close address book databases after cardDAV tests. rs=bustage-fix a=wsmwk
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 02 Jun 2020 11:24:01 +1200
changeset 39315 8fe382e22b1b84bac5d2048867f499e8f0c952d7
parent 39314 a72e4d7908e0d4da3cfb13e0db7eee2d478269d3
child 39316 aef3b87e8b7e2c1ec9b08acd48b314f5dea4b0db
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersbustage-fix, wsmwk
bugs1642281
Bug 1642281 - Close address book databases after cardDAV tests. rs=bustage-fix a=wsmwk
mailnews/addrbook/test/unit/head_cardDAV.js
--- a/mailnews/addrbook/test/unit/head_cardDAV.js
+++ b/mailnews/addrbook/test/unit/head_cardDAV.js
@@ -3,21 +3,25 @@
  * file, you can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { CardDAVDirectory } = ChromeUtils.import(
   "resource:///modules/CardDAVDirectory.jsm"
 );
 const { CardDAVServer } = ChromeUtils.import(
   "resource://testing-common/CardDAVServer.jsm"
 );
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 Cu.importGlobalProperties(["fetch"]);
 
 do_get_profile();
 
+registerCleanupFunction(function() {
+  load("../../../resources/mailShutdown.js");
+});
+
 async function checkCardsOnServer(expectedCards) {
   // Send a request to the server. When the server responds, we know it has
   // completed all earlier requests.
   await fetch(`${CardDAVServer.url}/ping`);
 
   let actualCards = [...CardDAVServer.cards];
   Assert.equal(actualCards.length, Object.keys(expectedCards).length);