Bug 314351 - Add test. r=dbienvenu
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Tue, 21 Feb 2012 19:28:16 +0900
changeset 10875 348640b81582a4c74d73b6d19a6b89f1ec50f2f8
parent 10874 fc98c220816a27f9c94eec31bafa1167ce7ef661
child 10876 c3184f1b35342dbd35a6757f2513f8e403897c96
push id463
push userbugzilla@standard8.plus.com
push dateTue, 24 Apr 2012 17:34:51 +0000
treeherdercomm-beta@e53588e8f7b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbienvenu
bugs314351
Bug 314351 - Add test. r=dbienvenu
mail/test/mozmill/composition/mime-encoded-subject.eml
mail/test/mozmill/composition/test-eml-actions.js
new file mode 100644
--- /dev/null
+++ b/mail/test/mozmill/composition/mime-encoded-subject.eml
@@ -0,0 +1,16 @@
+Return-Path: <homer@example.com>
+Received: from smtp.example.com (smtpu [10.0.0.52])
+	 by storage (Cyrus v2.3.7-Invoca-RPM-2.3.7-1.1) with LMTPA;
+	 Mon, 26 Dec 2011 20:49:16 +0200
+Message-ID: <4EF8C1A5.1060708@example.com>
+Date: Mon, 26 Dec 2011 20:49:09 +0200
+From: Homer <homer@example.com>
+MIME-Version: 1.0
+To: Marge <marge@example.com>
+Subject: =?UTF-8?B?4oiAYeKIikE=?=
+Content-Type: text/plain; charset=UTF-8; format=flowed
+Content-Transfer-Encoding: 7bit
+
+Because they're stupid, that's why. That's why everybody does everything!
+
+ -Homer
--- a/mail/test/mozmill/composition/test-eml-actions.js
+++ b/mail/test/mozmill/composition/test-eml-actions.js
@@ -111,10 +111,22 @@ function test_forward_eml_save_as_draft(
   if (!draftMsg)
     throw new Error("No draft saved!");
   press_delete(); // Delete the draft.
 
   close_compose_window(replyWin); // close compose window
   close_window(msgc); // close base .eml message
 }
 
+/**
+ * Test that MIME encoded subject is decoded when replying to an opened .eml.
+ */
+function test_reply_eml_subject() {
+  // Open an .eml file.
+  let file = os.getFileForPath(os.abspath("./mime-encoded-subject.eml", os.getFileForPath(__file__)));
+  let msgc = open_message_from_file(file);
 
+  let replyWin = composeHelper.open_compose_with_reply(msgc);
 
+  assert_equals(replyWin.e("msgSubject").value, "Re: \u2200a\u220aA");
+  close_compose_window(replyWin); // close compose window
+  close_window(msgc); // close base .eml message
+}