mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 926830 - Test cleanup for plugin enabledState usage, toolkit. r=bsmedberg
This commit is contained in:
parent
b9f40a548b
commit
83af0fd5df
@ -35,8 +35,7 @@ function test() {
|
||||
waitForExplicitFinish();
|
||||
Services.prefs.setBoolPref("plugins.click_to_play", true);
|
||||
Services.prefs.setBoolPref("extensions.blocklist.suppressUI", true);
|
||||
let pluginTag = getTestPluginTag();
|
||||
pluginTag.enabledState = Ci.nsIPluginTag.STATE_CLICKTOPLAY;
|
||||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
|
||||
open_manager("addons://list/plugin", part1);
|
||||
}
|
||||
|
||||
@ -219,8 +218,6 @@ 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();
|
||||
|
@ -1268,3 +1268,17 @@ 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;
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user