Bug 1456405 - Remove mimeTypes.rdf from C-C (follow-up to bug 1446313). r=aceman
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Fri, 31 Aug 2018 13:14:37 +0300
changeset 33081 36a440d150e8f26681cd055cbdccf59a605667f1
parent 33080 b677435939daa037d254fa226eab82afb9ec3d40
child 33082 5b9052faa6b4bf08b693ef95eade5c1a60fed618
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersaceman
bugs1456405, 1446313
Bug 1456405 - Remove mimeTypes.rdf from C-C (follow-up to bug 1446313). r=aceman
mail/app/profile/mimeTypes.rdf
mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
mailnews/imap/test/unit/test_partsOnDemand.js
mailnews/local/test/unit/test_pop3PasswordFailure2.js
mailnews/local/test/unit/test_pop3PasswordFailure3.js
mailnews/mime/test/unit/test_attachment_size.js
mailnews/news/test/unit/test_nntpPasswordFailure.js
mailnews/test/resources/mailTestUtils.js
deleted file mode 100644
--- a/mail/app/profile/mimeTypes.rdf
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0"?>  
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-
-<!--
- This file is used as a persistent data store for helper application
- information about both MIME type and protocol scheme helpers.
-
- The root of the data are the two containers
- <RDF:Seq about="urn:mimetypes:root"/> and <RDF:Seq about="urn:schemes:root"/>.
-
- These contain one <RDF:li/> entry per MIME type/protocol.  Each <RDF:li/> entry
- corresponds to a "urn:<class>:<type>" resource, where <class> is either
- "mimetype" or "scheme" and <type> is either a MIME type in "major/minor" format
- or a scheme.  For example, for HTML we would have "urn:mimetype:text/html",
- while for mailto: we would have "urn:scheme:mailto".
-
- Typically, this resource will be in the <RDF:Description/> node which has the
- corresponding "about" attribute.
-
- Each "urn:<class>:<type>" resource can have the following properties:
-
-   NC:Value - the MIME type or scheme string
-   NC:editable - a "true" or "false" depending on whether this entry is
-                 editable
-   NC:description - a description of the type ("HTML Document" for text/html)
-   NC:fileExtensions - for MIME types, there will be one of these properties
-                       per extension that corresponds to this MIME type,
-                       each one having a single extension as its value.
-   NC:handlerProp - the way the type should be handled.  This corresponds to a
-                    "urn:<class>:handler:<type>" resource.  Eg, the way HTML is
-                    handled would be stored in the
-                    "urn:mimetype:handler:text/html" resource.
-
- Each "urn:<class>:handler:<type>" resource can have the following properties:
-
-   NC:useSystemDefault - "true" if we should handle per default OS setting,
-                          "false" or not set otherwise
-   NC:saveToDisk - "true" if the data should be saved to disk, "false" or not
-                   set otherwise.
-     (Note - if both of these are false, that means "open in helper app")
-   NC:alwaysAsk - "true" if the user should always be prompted before handling
-                  data of this type, false otherwise.
-   NC:externalApplication - the preferred helper application to use for this
-                            type.  This corresponds to a
-                            "urn:<class>:externalApplication:<type>" resource.
-   NC:possibleApplication - a helper application that can be used for this type.
-                            Since there can be multiple possible applications,
-                            there can be multiple assertions in the graph with
-                            this property for a given handler resource.
-
- Each "urn:<class>:externalApplication:<type>" resource, and each resource
- that represents a possible application, can have the following property:
-
-   NC:prettyName - the "pretty name" of the application ("Acrobat Reader" for
-                   /usr/bin/acroread, eg).
-
- If the resource represents a local application, then it can have the following
- property:
-
-   NC:path - the path to the application on the local filesystem, for example
-             /usr/bin/test or C:\windows\system32\cmd.exe.
-
- If the resource represents a web application, then it can have the following
- property:
-
-   NC:uriTemplate - a URI pointing to the web application to which the type
-                    should be handed off, with %s in the template representing
-                    the place where the content should be inserted. For example,
-                    here is a URI template for a service that lets you email
-                    an address in a mailto: link:
-                      http://www.example.com/sendmail?link=%s
--->
-			
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:NC="http://home.netscape.com/NC-rdf#">
-
-  <RDF:Description about="urn:mimetypes"> 
-    <NC:MIME-types> 
-      <RDF:Seq about="urn:mimetypes:root"> 
-      </RDF:Seq>
-    </NC:MIME-types> 
-  </RDF:Description> 
-</RDF:RDF>
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
@@ -26,17 +26,16 @@
 // nsSeamonkeyProfileMigrator
 #define FILE_NAME_JUNKTRAINING    NS_LITERAL_STRING("training.dat")
 #define FILE_NAME_PERSONALDICTIONARY NS_LITERAL_STRING("persdict.dat")
 #define FILE_NAME_PERSONAL_ADDRESSBOOK NS_LITERAL_STRING("abook.mab")
 #define FILE_NAME_MAILVIEWS       NS_LITERAL_STRING("mailviews.dat")
 #define FILE_NAME_CERT8DB         NS_LITERAL_STRING("cert8.db")
 #define FILE_NAME_KEY3DB          NS_LITERAL_STRING("key3.db")
 #define FILE_NAME_SECMODDB        NS_LITERAL_STRING("secmod.db")
-#define FILE_NAME_MIMETYPES       NS_LITERAL_STRING("mimeTypes.rdf")
 #define FILE_NAME_PREFS           NS_LITERAL_STRING("prefs.js")
 #define FILE_NAME_USER_PREFS      NS_LITERAL_STRING("user.js")
 
 struct PrefBranchStruct {
   char*         prefName;
   int32_t       type;
   union {
     char*       stringValue;
@@ -611,21 +610,16 @@ nsSeamonkeyProfileMigrator::CopyPreferen
   if (NS_FAILED(tmp)) {
     rv = tmp;
   }
   tmp = CopyFile(FILE_NAME_SECMODDB, FILE_NAME_SECMODDB);
   if (NS_FAILED(tmp)) {
     rv = tmp;
   }
 
-  // User MIME Type overrides
-  tmp = CopyFile(FILE_NAME_MIMETYPES, FILE_NAME_MIMETYPES);
-  if (NS_FAILED(tmp)) {
-    rv = tmp;
-  }
   tmp = CopyFile(FILE_NAME_PERSONALDICTIONARY, FILE_NAME_PERSONALDICTIONARY);
   if (NS_FAILED(tmp)) {
     rv = tmp;
   }
   tmp = CopyFile(FILE_NAME_MAILVIEWS, FILE_NAME_MAILVIEWS);
   if (NS_FAILED(tmp)) {
     rv = tmp;
   }
--- a/mailnews/imap/test/unit/test_partsOnDemand.js
+++ b/mailnews/imap/test/unit/test_partsOnDemand.js
@@ -8,19 +8,16 @@
  */
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 Services.prefs.setIntPref("mail.imap.mime_parts_on_demand_threshold", 1000);
 
 load("../../../resources/logHelper.js");
 load("../../../resources/asyncTestUtils.js");
 load("../../../resources/messageGenerator.js");
 
-// Register the mime types provider we need for this test.
-mailTestUtils.registerUMimTypProvider();
-
 // javascript mime emitter functions
 var mimeMsg = {};
 ChromeUtils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
 
 var gSecondMsg;
 
 // IMAP pump
 
--- a/mailnews/local/test/unit/test_pop3PasswordFailure2.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure2.js
@@ -161,18 +161,16 @@ function* endTest() {
   Assert.equal(count.value, 1);
   Assert.equal(logins[0].username, kUserName);
   Assert.equal(logins[0].password, kValidPassword);
   yield true;
 }
 
 function run_test()
 {
-  mailTestUtils.registerUMimTypProvider();
-
   // Disable new mail notifications
   Services.prefs.setBoolPref("mail.biff.play_sound", false);
   Services.prefs.setBoolPref("mail.biff.show_alert", false);
   Services.prefs.setBoolPref("mail.biff.show_tray_icon", false);
   Services.prefs.setBoolPref("mail.biff.animate_dock_icon", false);
   Services.prefs.setBoolPref("signon.debug", true);
 
   // Prepare files for passwords (generated by a script in bug 1018624).
--- a/mailnews/local/test/unit/test_pop3PasswordFailure3.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure3.js
@@ -163,18 +163,16 @@ function* endTest() {
   Assert.equal(count.value, 1);
   Assert.equal(logins[0].username, kUserName);
   Assert.equal(logins[0].password, kValidPassword);
   yield true;
 }
 
 function run_test()
 {
-  mailTestUtils.registerUMimTypProvider();
-
   // Disable new mail notifications
   Services.prefs.setBoolPref("mail.biff.play_sound", false);
   Services.prefs.setBoolPref("mail.biff.show_alert", false);
   Services.prefs.setBoolPref("mail.biff.show_tray_icon", false);
   Services.prefs.setBoolPref("mail.biff.animate_dock_icon", false);
   Services.prefs.setBoolPref("signon.debug", true);
 
   // Prepare files for passwords (generated by a script in bug 1018624).
--- a/mailnews/mime/test/unit/test_attachment_size.js
+++ b/mailnews/mime/test/unit/test_attachment_size.js
@@ -12,19 +12,16 @@ load("../../../resources/asyncTestUtils.
 load("../../../resources/messageGenerator.js");
 load("../../../resources/messageModifier.js");
 load("../../../resources/messageInjection.js");
 
 // Somehow we hit the blocklist service, and that needs appInfo defined
 ChromeUtils.import("resource://testing-common/AppInfo.jsm");
 updateAppInfo();
 
-// Register the mime types provider we need for this test.
-mailTestUtils.registerUMimTypProvider();
-
 var gMessenger = Cc["@mozilla.org/messenger;1"]
                    .createInstance(Ci.nsIMessenger);
 
 // Create a message generator
 var msgGen = gMessageGenerator = new MessageGenerator();
 // Create a message scenario generator using that message generator
 var scenarios = gMessageScenarioFactory = new MessageScenarioFactory(msgGen);
 
--- a/mailnews/news/test/unit/test_nntpPasswordFailure.js
+++ b/mailnews/news/test/unit/test_nntpPasswordFailure.js
@@ -157,18 +157,16 @@ function* endTest() {
   Assert.equal(count.value, 1);
   Assert.equal(logins[0].username, kUserName);
   Assert.equal(logins[0].password, kValidPassword);
   yield true;
 }
 
 function run_test()
 {
-  mailTestUtils.registerUMimTypProvider();
-
   // Disable new mail notifications
   Services.prefs.setBoolPref("mail.biff.play_sound", false);
   Services.prefs.setBoolPref("mail.biff.show_alert", false);
   Services.prefs.setBoolPref("mail.biff.show_tray_icon", false);
   Services.prefs.setBoolPref("mail.biff.animate_dock_icon", false);
   Services.prefs.setBoolPref("signon.debug", true);
 
   // Prepare files for passwords (generated by a script in bug 1018624).
--- a/mailnews/test/resources/mailTestUtils.js
+++ b/mailnews/test/resources/mailTestUtils.js
@@ -470,38 +470,10 @@ var mailTestUtils = {
    * For when you want to compare elements non-strictly.
    */
   non_strict_index_of: function(aArray, aElem) {
     for (let [i, elem] of aArray.entries()) {
       if (elem == aElem)
         return i;
     }
     return -1;
-  },
-
-  /**
-   * Registers a directory provider for UMimTyp for when its needed.
-   */
-  registerUMimTypProvider: function() {
-    if (this._providerSvc)
-      return;
-
-    // Register our own provider for the profile directory.
-    // It will simply return the current directory.
-    const provider = {
-      getFile : function(prop, persistent) {
-        if (prop == "UMimTyp") {
-          var mimeTypes = Services.dirsvc.get("ProfD", Ci.nsIFile);
-          mimeTypes.append("mimeTypes.rdf");
-          return mimeTypes;
-        }
-        throw Cr.NS_ERROR_FAILURE;
-      },
-
-      QueryInterface:
-        ChromeUtils.generateQI([Ci.nsIDirectoryServiceProvider])
-    };
-
-    this._providerSvc = provider;
-    Services.dirsvc.QueryInterface(Ci.nsIDirectoryService)
-                   .registerProvider(provider);
   }
 };