Backed out changeset 44dbd2276837 (bug 926830) for mochitest memory leak on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2014-02-21 14:32:39 +01:00
parent eaa4884681
commit 9402413367
2 changed files with 4 additions and 15 deletions

View File

@ -35,7 +35,8 @@ 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);
}
@ -218,6 +219,8 @@ function part13() {
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();

View File

@ -1268,17 +1268,3 @@ function getTestPluginTag() {
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;
});
}