Bug 946065. Part 5.1: Enable test plugin for test_object_plugin_nav.html. r=smaug

--HG--
rename : layout/base/tests/enableTestPlugin.js => content/html/content/test/enableTestPlugin.js
extra : rebase_source : cd567303771e837981bb37cfcd1a2005ecdb6fc1
This commit is contained in:
Robert O'Callahan 2014-01-14 15:20:26 +13:00
parent 3879c01876
commit f1bdc45b2a
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// 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;
});
})();

View File

@ -8,6 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=720130
<title>Test for Bug 720130</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="application/javascript" src="enableTestPlugin.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>