mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
3879c01876
commit
f1bdc45b2a
25
content/html/content/test/enableTestPlugin.js
Normal file
25
content/html/content/test/enableTestPlugin.js
Normal 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;
|
||||
});
|
||||
})();
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user