Backed out changeset ad0d9f62c29c (bug 206659) for B2G desktop mochitest orange.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 04 Dec 2013 21:24:09 -0500
changeset 174499 2e586efc61606321141c54d718bb96cd894642e3
parent 174498 22847c3fd1fa0e95b3c40bcd084ed38080248396
child 174500 bed37a1c69a56149a313bddedb0648ee46095879
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs206659
milestone28.0a1
backs outad0d9f62c29c96abe9a1651c3c41a5dcbfe393a0
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset ad0d9f62c29c (bug 206659) for B2G desktop mochitest orange.
dom/plugins/base/nsPluginTags.cpp
dom/plugins/test/mochitest/mixed_case_mime.sjs
dom/plugins/test/mochitest/mochitest.ini
dom/plugins/test/mochitest/test_mixed_case_mime.html
dom/plugins/test/testplugin/secondplugin/Info.plist
dom/plugins/test/testplugin/secondplugin/nptest.rc
dom/plugins/test/testplugin/secondplugin/nptest_name.cpp
--- a/dom/plugins/base/nsPluginTags.cpp
+++ b/dom/plugins/base/nsPluginTags.cpp
@@ -127,39 +127,29 @@ void nsPluginTag::InitMime(const char* c
                            const char* const* aExtensions,
                            uint32_t aVariantCount)
 {
   if (!aMimeTypes) {
     return;
   }
 
   for (uint32_t i = 0; i < aVariantCount; i++) {
-    if (!aMimeTypes[i]) {
-      continue;
-    }
-
-    nsAutoCString mimeType(aMimeTypes[i]);
-
-    // Convert the MIME type, which is case insensitive, to lowercase in order
-    // to properly handle a mixed-case type.
-    ToLowerCase(mimeType);
-
-    if (!nsPluginHost::IsTypeWhitelisted(mimeType.get())) {
+    if (!aMimeTypes[i] || !nsPluginHost::IsTypeWhitelisted(aMimeTypes[i])) {
       continue;
     }
 
     // Look for certain special plugins.
-    if (nsPluginHost::IsJavaMIMEType(mimeType.get())) {
+    if (nsPluginHost::IsJavaMIMEType(aMimeTypes[i])) {
       mIsJavaPlugin = true;
-    } else if (mimeType.EqualsLiteral("application/x-shockwave-flash")) {
+    } else if (strcmp(aMimeTypes[i], "application/x-shockwave-flash") == 0) {
       mIsFlashPlugin = true;
     }
 
     // Fill in our MIME type array.
-    mMimeTypes.AppendElement(mimeType);
+    mMimeTypes.AppendElement(nsCString(aMimeTypes[i]));
 
     // Now fill in the MIME descriptions.
     if (aMimeDescriptions && aMimeDescriptions[i]) {
       // we should cut off the list of suffixes which the mime
       // description string may have, see bug 53895
       // it is usually in form "some description (*.sf1, *.sf2)"
       // so we can search for the opening round bracket
       char cur = '\0';
deleted file mode 100644
--- a/dom/plugins/test/mochitest/mixed_case_mime.sjs
+++ /dev/null
@@ -1,8 +0,0 @@
-function handleRequest(request, response)
-{
-  response.processAsync();
-  response.setHeader("Content-Type", "application/x-Second-Test", false);
-
-  response.write("Hello world.\n");
-  response.finish();
-}
--- a/dom/plugins/test/mochitest/mochitest.ini
+++ b/dom/plugins/test/mochitest/mochitest.ini
@@ -6,17 +6,16 @@ support-files =
   file_bug863792.html
   large-pic.jpg
   loremipsum.txt
   loremipsum.xtest
   loremipsum.xtest^headers^
   loremipsum_file.txt
   loremipsum_nocache.txt
   loremipsum_nocache.txt^headers^
-  mixed_case_mime.sjs
   neverending.sjs
   npruntime_identifiers_subpage.html
   plugin-stream-referer.sjs
   plugin_window.html
   pluginstream.js
   post.sjs
   utils.js
 
@@ -37,17 +36,16 @@ support-files =
 [test_enumerate.html]
 [test_fullpage.html]
 [test_getauthenticationinfo.html]
 [test_instance_re-parent.html]
 [test_instance_unparent1.html]
 [test_instance_unparent2.html]
 [test_instance_unparent3.html]
 [test_instantiation.html]
-[test_mixed_case_mime.html]
 [test_multipleinstanceobjects.html]
 [test_newstreamondestroy.html]
 [test_npn_asynccall.html]
 [test_npn_timers.html]
 [test_npobject_getters.html]
 [test_npruntime_construct.html]
 [test_npruntime_identifiers.html]
 [test_npruntime_npnevaluate.html]
deleted file mode 100644
--- a/dom/plugins/test/mochitest/test_mixed_case_mime.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<body>
-<head>
-  <title>Test mixed case mimetype for plugins</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="utils.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-<script>
-  SimpleTest.expectAssertions(0, 1);
-
-  SimpleTest.waitForExplicitFinish();
-  setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
-
-  function frameLoaded() {
-    var contentDocument = document.getElementById('testframe').contentDocument;
-    ok(contentDocument.body.innerHTML.length > 0, "Frame content shouldn't be empty.");
-    ok(contentDocument.plugins.length > 0, "Frame content should have a plugin.");
-    var plugin = contentDocument.plugins[0];
-    is(plugin.type.toLowerCase(), "application/x-second-test", "Should have loaded the second test plugin.");
-    SimpleTest.finish();
-  }
-</script>
-</head>
-<body>
-  <p id="display"></p>
-
-  <iframe id="testframe" name="testframe" onload="frameLoaded()" src="mixed_case_mime.sjs"></iframe>
-
-</body>
-</html>
--- a/dom/plugins/test/testplugin/secondplugin/Info.plist
+++ b/dom/plugins/test/testplugin/secondplugin/Info.plist
@@ -19,17 +19,17 @@
 	<key>CFBundleVersion</key>
 	<string>1.0.0.0</string>
 	<key>WebPluginName</key>
 	<string>Second Test Plug-in</string>
 	<key>WebPluginDescription</key>
 	<string>Second plug-in for testing purposes.</string>
 	<key>WebPluginMIMETypes</key>
 	<dict>
-		<key>application/x-Second-Test</key>
+		<key>application/x-second-test</key>
 		<dict>
 			<key>WebPluginExtensions</key>
 			<array>
 				<string>ts2</string>
 			</array>
 			<key>WebPluginTypeDescription</key>
 			<string>Second test type</string>
 		</dict>
--- a/dom/plugins/test/testplugin/secondplugin/nptest.rc
+++ b/dom/plugins/test/testplugin/secondplugin/nptest.rc
@@ -24,17 +24,17 @@ BEGIN
         BLOCK "040904e4"
         BEGIN
             VALUE "CompanyName", "mozilla.org"
             VALUE "FileDescription", L"Second plug-in for testing purposes."
             VALUE "FileExtents", "ts2"
             VALUE "FileOpenName", "Second test type"
             VALUE "FileVersion", "1.0"
             VALUE "InternalName", "npsecondtest"
-            VALUE "MIMEType", "application/x-Second-Test"
+            VALUE "MIMEType", "application/x-second-test"
             VALUE "OriginalFilename", "npsecondtest.dll"
             VALUE "ProductName", "Second Test Plug-in"
             VALUE "ProductVersion", "1.0"
         END
     END
     BLOCK "VarFileInfo"
     BEGIN
         VALUE "Translation", 0x409, 1252
--- a/dom/plugins/test/testplugin/secondplugin/nptest_name.cpp
+++ b/dom/plugins/test/testplugin/secondplugin/nptest_name.cpp
@@ -1,7 +1,7 @@
 /* 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/. */
 
 const char *sPluginName = "Second Test Plug-in";
 const char *sPluginDescription = "Second plug-in for testing purposes.";
-const char *sMimeDescription = "application/x-Second-Test:ts2:Second test type";
+const char *sMimeDescription = "application/x-second-test:ts2:Second test type";