mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
26 lines
818 B
JavaScript
26 lines
818 B
JavaScript
// this automatically sets the test plugin to be enabled (not e.g. click-to-play)
|
|
// and resets this afterwards
|
|
|
|
(function() {
|
|
function getTestPlugin(aPluginName) {
|
|
var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"]
|
|
.getService(SpecialPowers.Ci.nsIPluginHost);
|
|
var tags = ph.getPluginTags();
|
|
for (var tag of tags) {
|
|
if (tag.name == aPluginName) {
|
|
return tag;
|
|
}
|
|
}
|
|
|
|
ok(false, "Could not find plugin tag with plugin name '" + name + "'");
|
|
return null;
|
|
}
|
|
|
|
var plugin = getTestPlugin("Test Plug-in");
|
|
var oldEnabledState = plugin.enabledState;
|
|
plugin.enabledState = SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED;
|
|
SimpleTest.registerCleanupFunction(function() {
|
|
getTestPlugin("Test Plug-in").enabledState = oldEnabledState;
|
|
});
|
|
})();
|