Bug 1253957 - Fix e10s race issue for test from bug 1165981; r=bsmedberg
authorKyle Machulis <kyle@nonpolynomial.com>
Mon, 28 Mar 2016 15:37:26 -0700
changeset 290769 ff80f543f561301942a8e510470b01f5c9851ad2
parent 290768 98dd6cb59d8e0fbbea8fdbc736cb840f93689e6a
child 290770 ca78a5af2576347a318789f34060e0abfd5c9640
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1253957, 1165981
milestone48.0a1
Bug 1253957 - Fix e10s race issue for test from bug 1165981; r=bsmedberg
dom/plugins/base/nsPluginHost.cpp
dom/plugins/test/mochitest/mochitest.ini
dom/plugins/test/mochitest/test_bug1165981.html
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -1856,17 +1856,18 @@ nsPluginHost::GetSpecialType(const nsACS
 
   if (aMIMEType.LowerCaseEqualsASCII("application/x-shockwave-flash") ||
       aMIMEType.LowerCaseEqualsASCII("application/futuresplash") ||
       aMIMEType.LowerCaseEqualsASCII("application/x-shockwave-flash-test")) {
     return eSpecialType_Flash;
   }
 
   if (aMIMEType.LowerCaseEqualsASCII("application/x-silverlight") ||
-      aMIMEType.LowerCaseEqualsASCII("application/x-silverlight-2")) {
+      aMIMEType.LowerCaseEqualsASCII("application/x-silverlight-2") ||
+      aMIMEType.LowerCaseEqualsASCII("application/x-silverlight-test")) {
     return eSpecialType_Silverlight;
   }
 
   if (aMIMEType.LowerCaseEqualsASCII("audio/x-pn-realaudio-plugin")) {
     NS_WARNING("You are loading RealPlayer");
     return eSpecialType_RealPlayer;
   }
 
--- a/dom/plugins/test/mochitest/mochitest.ini
+++ b/dom/plugins/test/mochitest/mochitest.ini
@@ -132,10 +132,10 @@ skip-if = os != "win"
 [test_windowless_flash.html]
 skip-if = !(os == "win" && processor == "x86_64" && !e10s) # Bug 1253957
 [test_windowless_ime.html]
 skip-if = os != "win" || e10s
 [test_visibility.html]
 skip-if = toolkit == "cocoa"
 [test_zero_opacity.html]
 [test_bug1165981.html]
-skip-if = !(os == "win" && processor == "x86_64" && !e10s) # Bug 1253957
+skip-if = !(os == "win" && processor == "x86_64")
 [test_bug1245545.html]
--- a/dom/plugins/test/mochitest/test_bug1165981.html
+++ b/dom/plugins/test/mochitest/test_bug1165981.html
@@ -1,18 +1,16 @@
 <html>
   <head>
      <title>Bug 1165981 Test</title>
 
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <script type="text/javascript" src="plugin-utils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   </head>
-
-  <body onload="run()">
     <script class="testbody" type="application/javascript">
       "use strict";
 
       SimpleTest.waitForExplicitFinish();
       ok(SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Flash Test Plug-in"), "Should find allowed test flash plugin");
       ok(SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Silverlight Test Plug-in"), "Should find allowed test silverlight plugin");
       ok(!SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Third Test Plug-in"), "Should not find disallowed plugin");
 
@@ -31,17 +29,29 @@
             var mimeType = navigator.mimeTypes[i];
             if (mimeType.type === mimeTypeType) {
               return mimeType;
             }
           }
           return null;
       }
 
+      function createNode(id, type) {
+          let obj = document.createElement("object");
+          obj.type = type;
+          obj.id = id;
+          obj.width = 200;
+          obj.height = 200;
+          document.body.appendChild(obj);
+      }
+
       function run() {
+        createNode("plugin-flash", "application/x-shockwave-flash-test");
+        createNode("plugin-silverlight", "application/x-silverlight-test");
+        createNode("disallowedPlugin", "application/x-third-test");
         var pluginElement = document.getElementById("plugin-flash");
         is(pluginElement.identifierToStringTest("foo"), "foo", "Should be able to call a function provided by the plugin");
 
         pluginElement = document.getElementById("plugin-silverlight");
         is(pluginElement.identifierToStringTest("foo"), "foo", "Should be able to call a function provided by the plugin");
 
         pluginElement = document.getElementById("disallowedPlugin");
         is(typeof pluginElement.identifierToStringTest, "undefined", "Should NOT be able to call a function on a disallowed plugin");
@@ -61,13 +71,11 @@
         ok(findMimeType("application/x-shockwave-flash-test"), "Should have found a MIME type named 'application/x-shockwave-flash-test'");
         ok(findMimeType("application/x-silverlight-test"), "Should have found a MIME type named 'application/x-silverlight-test'");
         ok(!findMimeType("application/x-third-test"), "Should NOT have found a disallowed MIME type named 'application/x-third-test'");
 
         SimpleTest.finish();
       }
     </script>
 
-    <object id="plugin-flash" type="application/x-shockwave-flash-test" width=200 height=200></object>
-    <object id="plugin-silverlight" type="application/x-silverlight-test" width=200 height=200></object>
-    <object id="disallowedPlugin" type="application/x-third-test" width=200 height=200></object>
+  <body onload="run()">
   </body>
 </html>