Bug 456053 - Follow-up: Switch test to use drafts folder instead. r=aceman
authorJorg K
Sun, 02 Oct 2016 10:20:09 +0200
changeset 20501 26fbb38687e5c62ed358ff1f713cc0af5c3516b1
parent 20500 f1ab02878e502383c06cdaa385bd0749d7d9b594
child 20502 3b1118abe28652c5415ca0ef10dba4919f101cb2
push id12369
push useracelists@atlas.sk
push dateSun, 02 Oct 2016 08:20:39 +0000
treeherdercomm-central@26fbb38687e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs456053
Bug 456053 - Follow-up: Switch test to use drafts folder instead. r=aceman
mail/test/mozmill/composition/test-reply-format-flowed.js
--- a/mail/test/mozmill/composition/test-reply-format-flowed.js
+++ b/mail/test/mozmill/composition/test-reply-format-flowed.js
@@ -14,44 +14,54 @@ var RELATIVE_ROOT = "../shared-modules";
 var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource:///modules/mailServices.js");
 
 var os = {};
 Cu.import('resource://mozmill/stdlib/os.js', os);
 
+var draftsFolder;
+
 function setupModule(module) {
   for (let lib of MODULE_REQUIRES) {
     collector.getModule(lib).installInto(module);
   }
 
+  if (!MailServices.accounts
+                   .localFoldersServer
+                   .rootFolder
+                   .containsChildNamed("Drafts")) {
+    create_folder("Drafts", [Ci.nsMsgFolderFlags.Drafts]);
+  }
+  draftsFolder = MailServices.accounts
+                             .localFoldersServer
+                             .rootFolder
+                             .getChildNamed("Drafts");
+
   Services.prefs.setBoolPref("mail.identity.id1.compose_html", false);
 }
 
 function subtest_reply_format_flowed(aFlowed) {
   let file = os.getFileForPath(os.abspath("./format-flowed.eml",
                                os.getFileForPath(__file__)));
   let msgc = open_message_from_file(file);
 
   Services.prefs.setBoolPref("mailnews.send_plaintext_flowed", aFlowed);
 
   let cwc = open_compose_with_reply(msgc);
 
   close_window(msgc);
 
-  // Now send the message.
-  plan_for_window_close(cwc);
-  cwc.window.goDoCommand("cmd_sendLater");
-  wait_for_window_close();
+  // Now save the message as a draft.
+  cwc.keypress(null, "s", {shiftKey: false, accelKey: true});
+  close_compose_window(cwc);
 
-  // Now check the message content in the outbox.
-  let outbox = MailServices.accounts.localFoldersServer.rootFolder
-                           .getChildNamed("Outbox");
-  be_in_folder(outbox);
+  // Now check the message content in the drafts folder.
+  be_in_folder(draftsFolder);
   let message = select_click_row(0);
   let messageContent = get_msg_source(message);
 
   // Check for a single line that contains text and make sure there is a
   // space at the end for a flowed reply.
   assert_true(
     messageContent.includes(
       "\r\n> text text text text text text text text text text text text text text" +