Unit test for Bug 900552 Ensure attachment names are escaped. r=jcranmer,a=Standard8
authorMark Banner <bugzilla@standard8.plus.com>
Mon, 12 Aug 2013 20:13:16 +0100
changeset 13689 22c6a1b599eff1ffd9e0dd184b6e94502d2b217b
parent 13688 6294376dd7817f192d87e2200ed94e75ec1b5ecf
child 13690 e1cc8e9a7ace0f9e85cfb07f718660e4016ad5d3
child 13692 2a36f2b5a97d039d90d5ebc33a383710a96751a9
push id62
push userbugzilla@standard8.plus.com
push dateTue, 10 Sep 2013 11:01:10 +0000
reviewersjcranmer, Standard8
bugs900552
Unit test for Bug 900552 Ensure attachment names are escaped. r=jcranmer,a=Standard8
mailnews/mime/test/unit/test_message_attachment.js
--- a/mailnews/mime/test/unit/test_message_attachment.js
+++ b/mailnews/mime/test/unit/test_message_attachment.js
@@ -37,16 +37,24 @@ let messages = [
   // named email attachment
   { attachments: [{ body: textAttachment,
                     filename: 'test.txt',
                     format: '' },
                   { body: '',
                     filename: 'Attached Message',
                     contentType: 'message/rfc822', },
                  ]},
+  { attachments: [{ body: textAttachment,
+                    filename: 'test.html',
+                    format: '' },
+                  { body: '',
+                    filename: '<iframe src=&quote;http://www.example.com&quote></iframe>.htm',
+                    expectedFilename: '&lt;iframe src=&amp;quote;http://www.example.com&amp;quote&gt;&lt;/iframe&gt;.htm',
+                    contentType: 'text/html;', },
+                 ]},
   // no named email attachment with subject header
   { attachments: [{ expectedFilename: 'testSubject.eml' }],
     bodyPart: new SyntheticPartMultiMixed([
       new SyntheticPartLeaf('plain body text'),
       msgGen.makeMessage({
         subject: '=?UTF-8?B?dGVzdFN1YmplY3Q?=', // This string is 'testSubject'.
         charset: 'UTF-8',
       }),