Back out bug 736798 / changeset f372e5ce68d6 due to test failures a=backout
authorMark Banner <bugzilla@standard8.plus.com>
Wed, 18 Apr 2012 09:52:47 +0100
changeset 10740 7fa1ab94c06ba734a60923d228e5d677747fe3eb
parent 10739 7e631de9f7de138299dd15ee2f8d9b0d2c9db16b
child 10741 8575f83625b92778b324b2dbf7ec87cb0764a2ba
push id450
push userbugzilla@standard8.plus.com
push dateWed, 18 Apr 2012 08:55:59 +0000
treeherdercomm-beta@7fa1ab94c06b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs736798
Back out bug 736798 / changeset f372e5ce68d6 due to test failures a=backout
mail/test/mozmill/attachment/test-attachment.js
mailnews/mime/src/mimeobj.cpp
mailnews/mime/src/mimeobj.h
--- a/mail/test/mozmill/attachment/test-attachment.js
+++ b/mail/test/mozmill/attachment/test-attachment.js
@@ -72,23 +72,16 @@ var setupModule = function (module) {
   wh.installInto(module);
   let composeHelper = collector.getModule('compose-helpers');
   composeHelper.installInto(module);
   let wh = collector.getModule('window-helpers');
   wh.installInto(module);
 
   folder = create_folder("AttachmentA");
 
-  var attachedMessage = msgGen.makeMessage({
-    body: { body: "I'm an attached email!" },
-    attachments: [{ body: textAttachment,
-                    filename: 'inner attachment.txt',
-                    format: '' }],
-  });
-
   // create some messages that have various types of attachments
   messages = [
     // no attachment
     {},
     // text attachment
     { attachments: [{ body: textAttachment,
                       filename: 'ubik.txt',
                       format: '' }],
@@ -113,28 +106,16 @@ var setupModule = function (module) {
     { attachments: [{ body: textAttachment,
                       filename: 'this-is-a-file-with-an-extremely-long-name-' +
                                 'that-seems-to-go-on-forever-seriously-you-' +
                                 'would-not-believe-how-long-this-name-is-it-' +
                                 'surely-exceeds-the-maximum-filename-length-' +
                                 'for-most-filesystems.txt',
                       format: '' }],
     },
-    // a message with a text attachment and an email attachment, which in turn
-    // has its own text attachment
-    {
-      bodyPart: new SyntheticPartMultiMixed([
-        new SyntheticPartLeaf("I'm a message!"),
-        new SyntheticPartLeaf(textAttachment,
-                              { filename: 'outer attachment.txt',
-                                contentType: 'text/plain',
-                                format: '' }),
-        attachedMessage,
-      ]),
-    },
     // evilly-named attachment; spaces should be collapsed and trimmed on the
     // ends
     { attachments: [{ body: textAttachment,
                       contentType: 'application/octet-stream',
                       filename: ' ubik  .txt                            .evil ',
                       sanitizedFilename: 'ubik .txt .evil',
                       format: '' }],
     },
@@ -218,44 +199,16 @@ function test_long_attachment_name() {
 
   let messagepaneBox = mc.e("messagepanebox");
   let attachmentBar = mc.e("attachmentBar");
 
   assert_true(messagepaneBox.boxObject.width >= attachmentBar.boxObject.width,
               "Attachment bar has expanded off the edge of the window!");
 }
 
-/**
- * Make sure that, when opening attached messages, we only show the attachments
- * "beneath" the attached message (as opposed to all attachments for the root
- * message).
- */
-function test_attached_message_attachments() {
-  be_in_folder(folder);
-
-  select_click_row(5);
-  assert_selected_and_displayed(5);
-
-  // Make sure we have the expected number of attachments in the root message:
-  // an outer text attachment, an attached email, and an inner text attachment.
-  assert_equals(mc.e("attachmentList").itemCount, 3);
-
-  // Open the attached email.
-  plan_for_new_window("mail:messageWindow");
-  mc.e("attachmentList").getItemAtIndex(1).attachment.open();
-  let msgc = wait_for_new_window("mail:messageWindow");
-  wait_for_message_display_completion(msgc, true);
-
-  // Make sure we have the expected number of attachments in the attached
-  // message: just an inner text attachment.
-  assert_equals(msgc.e("attachmentList").itemCount, 1);
-
-  close_window(msgc);
-}
-
 function test_attachment_name_click() {
   be_in_folder(folder);
 
   select_click_row(1);
   assert_selected_and_displayed(1);
 
   let attachmentList = mc.e("attachmentList");
 
--- a/mailnews/mime/src/mimeobj.cpp
+++ b/mailnews/mime/src/mimeobj.cpp
@@ -232,39 +232,36 @@ MimeObject_parse_begin (MimeObject *obj)
     obj->output_p = false;
   else if (!obj->options->part_to_load)
     obj->output_p = true;
   else
   {
     char *id = mime_part_address(obj);
     if (!id) return MIME_OUT_OF_MEMORY;
 
-    // We need to check if a part is the subpart of the part to load.
-    // If so and this is a raw or body display output operation, then
-    // we should mark the part for subsequent output.
+      // We need to check if a part is the subpart of the part to load.
+      // If so and this is a raw or body display output operation, then
+      // we should mark the part for subsequent output.
+      //
 
-    // First, check for an exact match
-    obj->output_p = !strcmp(id, obj->options->part_to_load);
-    if (!obj->output_p && (obj->options->format_out == nsMimeOutput::nsMimeMessageRaw ||
-                           obj->options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay ||
-                           obj->options->format_out == nsMimeOutput::nsMimeMessageAttach))
+      // First, check for an exact match
+      obj->output_p = !strcmp(id, obj->options->part_to_load);
+      if (!obj->output_p && (obj->options->format_out == nsMimeOutput::nsMimeMessageRaw ||
+             obj->options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay
+             || obj->options->format_out == nsMimeOutput::nsMimeMessageAttach))
     {
-      // Then, check for subpart
-      unsigned int partlen = strlen(obj->options->part_to_load);
-      obj->output_p = (strlen(id) >= partlen + 2) && (id[partlen] == '.') &&
-        !strncmp(id, obj->options->part_to_load, partlen);
-    }
+        // Then, check for subpart
+        unsigned int partlen = strlen(obj->options->part_to_load);
+        obj->output_p = (strlen(id) >= partlen + 2) && (id[partlen] == '.') &&
+            !strncmp(id, obj->options->part_to_load, partlen);
+      }
 
     PR_Free(id);
   }
 
-  // If we've decided not to output this part, we also shouldn't be showing it
-  // as an attachment.
-  obj->dontShowAsAttachment = !obj->output_p;
-
   return 0;
 }
 
 static int
 MimeObject_parse_buffer (const char *buffer, PRInt32 size, MimeObject *obj)
 {
   NS_ASSERTION(!obj->closed_p, "object shouldn't be closed");
   if (obj->closed_p) return -1;
--- a/mailnews/mime/src/mimeobj.h
+++ b/mailnews/mime/src/mimeobj.h
@@ -187,19 +187,18 @@ struct MimeObject {
   MimeObject *parent;    /* Backpointer to a MimeContainer object. */
 
   MimeDisplayOptions *options;  /* Display preferences set by caller. */
 
   bool closed_p;      /* Whether it's done being written to. */
   bool parsed_p;      /* Whether the parser has been shut down. */
   bool output_p;      /* Whether it should be written. */
   bool dontShowAsAttachment; /* Force an object to not be shown as attachment,
-                                but when is false, it doesn't mean it will be
-                                shown as attachment; specifically, body parts
-                                are never shown as attachments. */
+                                  but when is false, it doesn't mean it will be
+                                  shown as attachment */
 
   /* Read-buffer and write-buffer (on input, `parse_buffer' uses ibuffer to
    compose calls to `parse_line'; on output, `obuffer' is used in various
    ways by various routines.)  These buffers are created and grow as needed.
    `ibuffer' should be generally be considered hands-off, and `obuffer'
    should generally be considered fair game.
    */
   char *ibuffer, *obuffer;