Fix test failures due to libmime size differences on Win32.
authorJonathan Protzenko <jonathan.protzenko@gmail.com>
Thu, 13 Jan 2011 13:31:52 +0100
changeset 6948 612d538f10407258831ca0139d501038edafebd1
parent 6947 23f94e99d83fba305bd100d5e2bb1192ae684f2e
child 6949 4bcbe30040790de38fda0ddaed10e563d5badcec
push idunknown
push userunknown
push dateunknown
Fix test failures due to libmime size differences on Win32.
mailnews/mime/test/unit/test_attachment_size.js
--- a/mailnews/mime/test/unit/test_attachment_size.js
+++ b/mailnews/mime/test/unit/test_attachment_size.js
@@ -59,17 +59,17 @@ const scenarios = gMessageScenarioFactor
 
 /* Today's gory details (thanks to Jonathan Protzenko): libmime somehow
  * counts the trailing newline for an attachment MIME part. Most of the time,
  * assuming attachment has N bytes (no matter what's inside, newlines or
  * not), libmime will return N + 1 bytes. On Linux and Mac, this always
  * holds. However, on Windows, if the attachment is not encoded (that is, is
  * inline text), libmime will return N + 2 bytes.
  */
-const epsilon = ('@mozilla.org/windows-registry-key;1' in Components.classes) ? 2 : 1;
+const epsilon = ('@mozilla.org/windows-registry-key;1' in Components.classes) ? 4 : 2;
 
 const textAttachment =
   "Can't make the frug contest, Helen; stomach's upset. I'll fix you, " +
   "Ubik! Ubik drops you back in the thick of things fast. Taken as " +
   "directed, Ubik speeds relief to head and stomach. Remember: Ubik is " +
   "only seconds away. Avoid prolonged use.";
 
 const binaryAttachment = textAttachment;
@@ -215,22 +215,19 @@ let gStreamListener = {
   },
 };
 
 let gMessageHeaderSink = {
   handleAttachment: function(aContentType, aUrl, aDisplayName, aUri,
                              aIsExternalAttachment) {
   },
   addAttachmentField: function(aName, aValue) {
-    dump("*** "+aName+" "+aValue+" "+this.size+"\n");
     // Only record the information for the first attachment.
     if (aName == "X-Mozilla-PartSize" && (this.size == null))
       this.size = parseInt(aValue);
-    dump("*** "+aName+" "+aValue+" "+this.size+"\n");
-    dump("\n");
   },
 
   // stub functions from nsIMsgHeaderSink
   onStartHeaders: function() {},
   onEndHeaders: function() {},
   processHeaders: function(aHeaderNames, aHeaderValues, dontCollectAddrs) {},
   onEndAllAttachments: function() {},
   onEndMsgDownload: function() {},