Backed out changeset 44dbd2276837 (bug 926830) for mochitest memory leak on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 21 Feb 2014 14:32:39 +0100
changeset 170242 b994e8b4c3690b443f6c4dd11eb109e443c1c91c
parent 170241 203b1197d4137f02abc72c126962550ebd486dbb
child 170243 4bb782896814631e19e8e021080962b5c56d2256
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
bugs926830
milestone30.0a1
backs out44dbd2276837ebb221f5971a1c45b695518b2c51
Backed out changeset 44dbd2276837 (bug 926830) for mochitest memory leak on a CLOSED TREE
toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js
toolkit/mozapps/extensions/test/browser/head.js
--- a/toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js
@@ -30,17 +30,18 @@ function setAndUpdateBlocklist(aURL, aCa
 function resetBlocklist(aCallback) {
   Services.prefs.setCharPref("extensions.blocklist.url", _originalBlocklistURL);
 }
 
 function test() {
   waitForExplicitFinish();
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
-  setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
+  let pluginTag = getTestPluginTag();
+  pluginTag.enabledState = Ci.nsIPluginTag.STATE_CLICKTOPLAY;
   open_manager("addons://list/plugin", part1);
 }
 
 function part1(aWindow) {
   gManagerWindow = aWindow;
   AddonManager.getAddonsByTypes(["plugin"], part2);
 }
 
@@ -213,13 +214,15 @@ function part13() {
   setAndUpdateBlocklist(gHttpTestRoot + "blockNoPlugins.xml", function() {
     run_next_test();
   });
 }
 
 function end_test() {
   Services.prefs.clearUserPref("plugins.click_to_play");
   Services.prefs.clearUserPref("extensions.blocklist.suppressUI");
+  let pluginTag = getTestPluginTag();
+  pluginTag.enabledState = Ci.nsIPluginTag.STATE_ENABLED;
   resetBlocklist();
   close_manager(gManagerWindow, function() {
     finish();
   });
 }
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -1263,22 +1263,8 @@ function getTestPluginTag() {
   // Find the test plugin
   for (let i = 0; i < tags.length; i++) {
     if (tags[i].name == "Test Plug-in")
       return tags[i];
   }
   ok(false, "Unable to find plugin");
   return null;
 }
-
-// Call this to set the test plugin(s) initially expected enabled state.
-// It will automatically be reset to it's previous value after the test
-// ends
-function setTestPluginEnabledState(newEnabledState, pluginTag) {
-  if (!pluginTag) {
-    pluginTag = getTestPluginTag();
-  }
-  var oldEnabledState = pluginTag.enabledState;
-  pluginTag.enabledState = newEnabledState;
-  SimpleTest.registerCleanupFunction(function() {
-    pluginTag.enabledState = oldEnabledState;
-  });
-}
\ No newline at end of file