Backed out changeset 1664be66815d / Bug 540676 due to unit test failures.
authorMark Banner <bugzilla@standard8.plus.com>
Thu, 08 Apr 2010 22:47:49 +0100
changeset 5405 1b490fdf5e8ac6a4b90aa417513a770a1233a74a
parent 5404 1664be66815d75475f1a108a8c54d5b9cb8a207c
child 5406 d345ed12e1fb0d0394b9d9bd312a13388d537f00
push idunknown
push userunknown
push dateunknown
bugs540676
backs out1664be66815d75475f1a108a8c54d5b9cb8a207c
Backed out changeset 1664be66815d / Bug 540676 due to unit test failures.
mailnews/imap/test/unit/test_dod.js
mailnews/test/data/bodystructurebug244741
mailnews/test/data/bodystructurebug246415
mailnews/test/data/bodystructuretest1
mailnews/test/data/bodystructuretest2
deleted file mode 100644
--- a/mailnews/imap/test/unit/test_dod.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Test bodystructure and body fetch by parts. Messages with problem of
- * 'This part will be downloaded on demand' in message pane content (text) area.
- * To add messages to the test, place the 'markerRe' text used for testing in the
- * offending part that is displaying the problem message.
- * Prepend to the filename 'bodystructure' and save in the database
- * See current test files for examples.
- */
-var gServer, gIMAPIncomingServer;
-function run_test()
-{
-  let IMAPDaemon = new imapDaemon();;
-  const ioS = Cc["@mozilla.org/network/io-service;1"]
-                .getService(Ci.nsIIOService);
-
-  // pref tuning: one connection only, turn off notifications
-  let prefBranch = Cc["@mozilla.org/preferences-service;1"]
-                     .getService(Ci.nsIPrefBranch);
-  prefBranch.setIntPref( "mail.server.server1.max_cached_connections", 1);
-  prefBranch.setBoolPref("mail.biff.play_sound", false);
-  prefBranch.setBoolPref("mail.biff.show_alert", false);
-  prefBranch.setBoolPref("mail.biff.show_tray_icon",    false);
-  prefBranch.setBoolPref("mail.biff.animate_dock_icon", false);
-  // Force bodypart fetching as best as we can.
-  // It would be adviseable to enable log and check to be sure body[] is not being
-  // fetched in lieu of parts. There may be conditions that bypass bodypart fetch.
-  prefBranch.setBoolPref("mail.inline_attachments",     false);
-  prefBranch.setIntPref ("browser.cache.disk.capacity",              0);
-  prefBranch.setIntPref ("mail.imap.mime_parts_on_demand_threshold", 1);
-  prefBranch.setIntPref ("mailnews.display.disallow_mime_handlers",  0);
-  prefBranch.setBoolPref("mail.server.default.fetch_by_chunks",  false);
-  prefBranch.setIntPref ("mail.imap.mime_parts_on_demand_max_depth", 1);
-
-  gServer = makeServer(IMAPDaemon, "");
-  gIMAPIncomingServer = createLocalIMAPServer();
-  let inbox = IMAPDaemon.getMailbox("INBOX");
-  let imapS = Cc["@mozilla.org/messenger/messageservice;1?type=imap"]
-                .getService(Ci.nsIMsgMessageService);
-
-  do_test_pending();
-  do_timeout(10000, function(){
-    do_throw('Tests did not complete within 10 seconds. ABORTING.');
-    }
-  );
-
-  let fileNames = [];
-  let msgFiles = do_get_file("../../mailnews/data/").directoryEntries;
-  while (msgFiles.hasMoreElements()) {
-    let file = msgFiles.getNext();
-    let msgfileuri = ioS.newFileURI(file).QueryInterface(Ci.nsIFileURL);
-    if (/^bodystructure/i.test(msgfileuri.fileName)) {
-      inbox.addMessage(new imapMessage(msgfileuri.spec, inbox.uidnext++, []));
-      fileNames.push(msgfileuri.fileName);
-    }
-  }
-
-  // loop through the files twice, once for plain and one for html check
-  let isPlain = true;
-  for (let cnt = 2 ; cnt > 0 ; cnt--, isPlain = false) {
-    // adjust these for 'view body as' setting
-    // 0 orig html 3 sanitized 1 plain text
-    prefBranch.setIntPref ("mailnews.display.html_as", isPlain ? 1 : 0);
-    prefBranch.setBoolPref("mailnews.display.prefer_plaintext", isPlain);
-    let markerRe;
-    if (isPlain)
-      markerRe = /thisplaintextneedstodisplaytopasstest/;
-    else
-      markerRe = /thishtmltextneedstodisplaytopasstest/;
-
-    for (let i = 1; i < inbox.uidnext ; i++) {
-      let uri = {};
-      imapS.GetUrlForUri("imap-message://user@localhost/INBOX#" + i,uri,null);
-      uri.value.spec += "?header=quotebody";
-      let channel = ioS.newChannelFromURI(uri.value);
-      let inStream = channel.open();
-      let scriptableInStream = Cc["@mozilla.org/scriptableinputstream;1"]
-                 .createInstance(Ci.nsIScriptableInputStream);
-      scriptableInStream.init(inStream);
-      let availableCount;
-      let buf = "";
-      while(availableCount =  scriptableInStream.available()) {
-        buf += scriptableInStream.read(availableCount);
-      }
-      dump("##########\nTesting--->" + fileNames[i-1] +
-           "; 'prefer plain text': " + isPlain + "\n" +
-           buf + "\n" +
-           "##########\nTesting--->" + fileNames[i-1] +
-           "; 'prefer plain text': " + isPlain + "\n");
-      try {
-        do_check_true(markerRe.test(buf));
-       }
-      catch(e){}
-    }
-  }
-  do_timeout_function(700, endTest);
-}
-
-function endTest()
-{
-  gIMAPIncomingServer.closeCachedConnections();
-  gServer.stop();
-  let thread = gThreadManager.currentThread;
-  while (thread.hasPendingEvents())
-    thread.processNextEvent(true);
-  do_test_finished();
-}
deleted file mode 100644
--- a/mailnews/test/data/bodystructurebug244741
+++ /dev/null
@@ -1,72 +0,0 @@
-Date: Sun, 7 Feb 2010 00:01:00 -0600
-From: from@invalid.invalid
-To: to@invalid.invalid
-Subject: bug244741
-MIME-Version: 1.0
-Content-Type: multipart/mixed;
-	boundary="-------bug244741partN"
-
-This is a multi-part message in MIME format.
-
----------bug244741partN
-Content-Type: multipart/related;
-	type="multipart/alternative";
-	boundary="-------bug244741part1.N"
-
-
----------bug244741part1.N
-Content-Type: multipart/alternative;
-	boundary="-------bug244741part1.1.N"
-
-
----------bug244741part1.1.N
-Content-Type: text/plain;
-	charset="us-ascii"
-Content-Transfer-Encoding: quoted-printable
-
-thisplaintextneedstodisplaytopasstest
-plaintextshouldnotbefetchedtopasstest
-
----------bug244741part1.1.N
-Content-Type: text/html;
-	charset="us-ascii"
-Content-Transfer-Encoding: quoted-printable
-
-<html>
-<body><pre>
-thishtmltextneedstodisplaytopasstest
-htmltextshouldnotbefetchedtopasstest
-</pre></body></html>
-
----------bug244741part1.1.N--
-
----------bug244741part1.N
-Content-Type: image/jpeg;
-	name="image001.jpg"
-Content-Transfer-Encoding: base64
-Content-ID: <image001.jpg@01CA0BAD.274DAC50>
-Content-Description: image001.jpg
-Content-Location: image001.jpg
-
-
----------bug244741part1.N--
-
----------bug244741partN
-Content-Type: application/octet-stream;
-	name=".pdf"
-Content-Transfer-Encoding: base64
-Content-Description: .pdf
-Content-Disposition: attachment;
-	filename=".pdf"
-
-
----------bug244741partN
-Content-Type: application/octet-stream;
-	name=".pdf"
-Content-Transfer-Encoding: base64
-Content-Description: .pdf
-Content-Disposition: attachment;
-	filename=".pdf"
-
-
----------bug244741partN--
deleted file mode 100644
--- a/mailnews/test/data/bodystructurebug246415
+++ /dev/null
@@ -1,30 +0,0 @@
-Date: Sun, 7 Feb 2010 00:01:00 -0600
-From: from@invalid.invalid
-To: to@invalid.invalid
-Subject: bug246415
-MIME-Version: 1.0
-Content-Type: multipart/related; boundary="-------bug246415partN"
-
----------bug246415partN
-Content-Type: text/html; charset="UTF-8"
-Content-Transfer-Encoding: quoted-printable
-
-<html>
-<body>
-<pre>
-Only one text content-type so this html needs
-to display in both tests, plain and html
-
-thishtmltextneedstodisplaytopasstest
-thisplaintextneedstodisplaytopasstest
-</pre>
-</body></html>
-
----------bug246415partN
-Content-Type: image/gif
-Content-Transfer-Encoding: base64
-Content-Disposition: inline; filename="solid.gif"
-Content-ID: <8aa65aaf56c805fc71ef7c76fb22614b>
-
-R0lGODlhDAABAIAAAM7P2AAAACH5BAAAAAAALAAAAAAMAAEAAAIDhI9WADs=
----------bug246415partN--
deleted file mode 100644
--- a/mailnews/test/data/bodystructuretest1
+++ /dev/null
@@ -1,57 +0,0 @@
-Date: Fri, 01 Jan 2010 12:00 -0500
-To: x@x.x
-From: y@y.y
-Subject: download on demand problem
-MIME-Version: 1.0
-Content-Type: multipart/mixed;
-	boundary="----Part0+"
-
-This is a multi-part message in MIME format.
-
-------Part0+
-Content-Type: multipart/related;
-	type="multipart/alternative";
-	boundary="----Part1.n"
-
-
-------Part1.n
-Content-Type: multipart/alternative;
-	boundary="----Part1.1.n"
-
-
-------Part1.1.n
-Content-Type: text/plain;
-
-thisplaintextneedstodisplaytopasstest
-plaintextshouldnotbefetchedtopasstest
-
-------Part1.1.n
-Content-Type: text/html;
-
-<html>
-thishtmltextneedstodisplaytopasstest
-htmltextshouldnotbefetchedtopasstest
-</html>
-
-------Part1.1.n--
-
-------Part1.n
-Content-Type: image/jpeg;
-	name="someimage.jpg"
-
-This is someimage.jpg
-
-------Part1.n--
-
-------Part0+
-Content-Type: application/octet-stream;
-	name="somename.pdf"
-
-This is somename.pdf
-
-------Part0+
-Content-Type: text/html;
-
-This is a text part that should not be displayed
-it is not inline and is not an attachment
-------Part0+--
deleted file mode 100644
--- a/mailnews/test/data/bodystructuretest2
+++ /dev/null
@@ -1,31 +0,0 @@
-Date: Sun, 7 Feb 2010 00:01:00 -0600
-From: from@invalid.invalid
-To: to@invalid.invalid
-Subject: bug246415modified
-MIME-Version: 1.0
-Content-Type: multipart/mixed; boundary="-------toppart"
-
----------toppart
-Content-Type: multipart/alternative; boundary="-------bug246415partN"
-
----------bug246415partN
-Content-Type: text/plain; charset="UTF-8"
-Content-Transfer-Encoding: quoted-printable
-
-thisplaintextneedstodisplaytopasstest
-plaintextshouldnotbefetchedtopasstest
-
----------bug246415partN
-Content-Type: text/html; charset="UTF-8"
-Content-Transfer-Encoding: quoted-printable
-
-<html>
-<body>
-<pre>
-thishtmltextneedstodisplaytopasstest
-htmltextshouldnotbefetchedtopasstest
-</pre>
-</body></html>
-
----------bug246415partN--
----------toppart--
\ No newline at end of file