Bug 1635889 - Fix test failure in comm/mailnews/base/test/unit/test_compactFailure.js. rs=bustage-fix
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 07 May 2020 15:33:20 +1200
changeset 39077 3edf0643a1d84d2ee647912078e5a236a8abc6c2
parent 39076 48873d311c30aec75c50a580801b0135f7553f25
child 39078 1defa8e63d750243cd404c379fa780980bf59364
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersbustage-fix
bugs1635889
Bug 1635889 - Fix test failure in comm/mailnews/base/test/unit/test_compactFailure.js. rs=bustage-fix
mailnews/base/test/unit/test_compactFailure.js
mailnews/test/resources/logHelper.js
--- a/mailnews/base/test/unit/test_compactFailure.js
+++ b/mailnews/base/test/unit/test_compactFailure.js
@@ -16,18 +16,18 @@ Services.prefs.setCharPref(
   "mail.serverDefaultStoreContractID",
   "@mozilla.org/msgstore/berkeleystore;1"
 );
 
 var gTargetFolder;
 var gUuid;
 
 // Allow certain xpcom errors.
-logHelperAllowedErrors.push(Cr.NS_ERROR_FILE_IS_LOCKED);
-logHelperAllowedErrors.push(Cr.NS_ERROR_FILE_TARGET_DOES_NOT_EXIST);
+logHelperAllowedErrors.push("NS_ERROR_FILE_IS_LOCKED");
+logHelperAllowedErrors.push("NS_ERROR_FILE_TARGET_DOES_NOT_EXIST");
 
 function LockedFileOutputStream() {}
 
 LockedFileOutputStream.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIFileOutputStream]),
 
   init(file, ioFlags, perm, behaviorFlags) {
     throw Components.Exception("", Cr.NS_ERROR_FILE_IS_LOCKED);
--- a/mailnews/test/resources/logHelper.js
+++ b/mailnews/test/resources/logHelper.js
@@ -23,17 +23,17 @@ var _xpcshellLogger;
 var _testLoggerContexts = [];
 var _testLoggerActiveContext;
 
 var _logHelperInterestedListeners = false;
 
 /**
  * Let test code extend the list of allowed XPCOM errors.
  */
-var logHelperAllowedErrors = [Cr.NS_ERROR_FAILURE];
+var logHelperAllowedErrors = ["NS_ERROR_FAILURE"];
 
 /**
  * Let other test helping code decide whether to register for potentially
  *  expensive notifications based on whether anyone can even hear those
  *  results.
  */
 function logHelperHasInterestedListeners() {
   return _logHelperInterestedListeners;
@@ -74,17 +74,17 @@ var _errorConsoleTunnel = {
         !aMessage.errorMessage.includes("Error console says")
       ) {
         // Unfortunately changes to mozilla-central are throwing lots
         // of console errors during testing, so disable (we hope temporarily)
         // failing on XPCOM console errors (see bug 1014350).
         // An XPCOM error aMessage looks like this:
         //   [JavaScript Error: "uncaught exception: 2147500037"]
         // Capture the number, and allow known XPCOM results.
-        let matches = /exception: (\d+)/.exec(aMessage);
+        let matches = /JavaScript Error: "(\w+)/.exec(aMessage);
         let XPCOMresult = null;
         if (matches) {
           for (let result in Cr) {
             if (matches[1] == Cr[result]) {
               XPCOMresult = result;
               break;
             }
           }