Bug 1231902 - backed out changeset fa693e739abc for causing endless loops. a=jorgk. DONTBUILD
authorJorg K
Sun, 14 Feb 2016 20:47:39 +0100
changeset 26774 2b722528d5f61b0fd40b4063064cf33c39ad6ad7
parent 26773 94bbcdd6ecd1ea546408532941be819b72a72282
child 26775 c486776f8a8b8b67c350afdab1bc9b37c30b8165
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1231902
Bug 1231902 - backed out changeset fa693e739abc for causing endless loops. a=jorgk. DONTBUILD
mail/test/mozmill/composition/test-signature-updating.js
--- a/mail/test/mozmill/composition/test-signature-updating.js
+++ b/mail/test/mozmill/composition/test-signature-updating.js
@@ -35,42 +35,44 @@ var setupModule = function (module) {
   let wh = collector.getModule("window-helpers");
   wh.installInto(module);
 
   // Ensure we're in the tinderbox account as that has the right identities set
   // up for this test.
   let server = MailServices.accounts.FindServer("tinderbox", FAKE_SERVER_HOSTNAME, "pop3");
   let inbox = server.rootFolder.getChildNamed("Inbox");
   be_in_folder(inbox);
+
+  // Don't create paragraphs in the test.
+  // The test checks for the first DOM node and expects a text and not
+  // a paragraph.
+  Services.prefs.setBoolPref("editor.CR_creates_new_p", false);
 };
 
 function teardownModule(module) {
   Services.prefs.clearUserPref("editor.CR_creates_new_p");
-  Services.prefs.clearUserPref("mail.identity.id1.compose_html");
-  Services.prefs.clearUserPref("mail.identity.id1.suppress_signature_separator");
-  Services.prefs.clearUserPref("mail.identity.id2.suppress_signature_separator");
 }
 
 function setupComposeWin(toAddr, subj, body) {
   cwc.type(null, toAddr);
   cwc.type(cwc.eid("msgSubject"), subj);
   cwc.type(cwc.eid("content-frame"), body);
 }
 
 /**
  * Test that the plaintext compose window has a signature initially,
  * and has the correct signature after switching to another identity.
  */
 function plaintextComposeWindowSwitchSignatures(suppressSigSep) {
   Services.prefs.setBoolPref("mail.identity.id1.compose_html", false);
+  cwc = composeHelper.open_compose_new_mail();
   Services.prefs.setBoolPref("mail.identity.id1.suppress_signature_separator",
                              suppressSigSep);
   Services.prefs.setBoolPref("mail.identity.id2.suppress_signature_separator",
                              suppressSigSep);
-  cwc = composeHelper.open_compose_new_mail();
 
   let contentFrame = cwc.e("content-frame");
   let mailBody = contentFrame.contentDocument.body;
 
   // The first node in the body should be a BR node, which allows the user
   // to insert text before / outside of the signature.
   assert_equals(mailBody.firstChild.localName, "br");
 
@@ -144,26 +146,26 @@ function plaintextComposeWindowSwitchSig
 
   composeHelper.close_compose_window(cwc);
 }
 
 function testPlaintextComposeWindowSwitchSignatures() {
   plaintextComposeWindowSwitchSignatures(false);
 }
 
-function testPlaintextComposeWindowSwitchSignaturesWithSuppressedSeparator() {
-  plaintextComposeWindowSwitchSignatures(true);
-}
+// XXX Disabled due to not correctly switching signatures with no separator
+// See bug TBD
+//function testPlaintextComposeWindowSwitchSignaturesWithSuppressedSeparator() {
+//  plaintextComposeWindowSwitchSignatures(true);
+//}
 
 /**
  * Same test, but with an HTML compose window
  */
-function HTMLComposeWindowSwitchSignatures(suppressSigSep, paragraphFormat) {
-  Services.prefs.setBoolPref("editor.CR_creates_new_p", paragraphFormat);
-
+function HTMLComposeWindowSwitchSignatures(suppressSigSep) {
   Services.prefs.setBoolPref("mail.identity.id1.compose_html", true);
   Services.prefs.setBoolPref("mail.identity.id1.suppress_signature_separator",
                              suppressSigSep);
   Services.prefs.setBoolPref("mail.identity.id2.suppress_signature_separator",
                              suppressSigSep);
   cwc = composeHelper.open_compose_new_mail();
 
   setupComposeWin("", "HTML compose window", "Body, first line.");
@@ -199,41 +201,27 @@ function HTMLComposeWindowSwitchSignatur
   node = node.nextSibling;
   assert_equals(node.localName, "b");
   node = node.firstChild;
   assert_equals(node.nodeValue, "hotness!");
 
   // Now check that the original signature has been removed,
   // and no blank lines got added!
   node = contentFrame.contentDocument.body.firstChild;
-  let textNode;
-  if (paragraphFormat) {
-    textNode = node.firstChild;
-  } else {
-    textNode = node;
-  }
-  assert_equals(textNode.nodeValue, "Body, first line.");
+  assert_equals(node.nodeValue, "Body, first line.");
   node = node.nextSibling;
   assert_equals(node.localName, "br");
   node = node.nextSibling;
   // check that the signature is immediately after the message text.
   assert_equals(node.className, "moz-signature");
   // check that that the signature is the last node.
   assert_equals(node, contentFrame.contentDocument.body.lastChild);
 
   composeHelper.close_compose_window(cwc);
 }
 
 function testHTMLComposeWindowSwitchSignatures() {
-  HTMLComposeWindowSwitchSignatures(false, false);
+  HTMLComposeWindowSwitchSignatures(false);
 }
 
 function testHTMLComposeWindowSwitchSignaturesWithSuppressedSeparator() {
-  HTMLComposeWindowSwitchSignatures(true, false);
+  HTMLComposeWindowSwitchSignatures(true);
 }
-
-function testHTMLComposeWindowSwitchSignaturesParagraphFormat() {
-  HTMLComposeWindowSwitchSignatures(false, true);
-}
-
-function testHTMLComposeWindowSwitchSignaturesWithSuppressedSeparatorParagraphFormat() {
-  HTMLComposeWindowSwitchSignatures(true, true);
-}