Backed out 5 changesets (bug 1294341) for frequent mochitest(cl) failures due to random plugins being discovered a=backout CLOSED TREE

Backed out changeset 183727ce6551 (bug 1294341)
Backed out changeset 0f9c9d933a42 (bug 1294341)
Backed out changeset 5a582bbcc549 (bug 1294341)
Backed out changeset be81e6841555 (bug 1294341)
Backed out changeset 154d446586b4 (bug 1294341)
This commit is contained in:
Wes Kocher 2016-09-28 16:51:47 -07:00
parent c09d407ee8
commit 82e2302974
5 changed files with 7 additions and 64 deletions

View File

@ -329,12 +329,6 @@ operator<(const RefPtr<nsPluginElement>& lhs,
return lhs->PluginTag()->Name() < rhs->PluginTag()->Name();
}
static bool
PluginShouldBeHidden(nsCString aName) {
// This only supports one hidden plugin
return Preferences::GetCString("plugins.navigator.hidden_ctp_plugin").Equals(aName);
}
void
nsPluginArray::EnsurePlugins()
{
@ -363,7 +357,8 @@ nsPluginArray::EnsurePlugins()
if (pluginTag->IsClicktoplay()) {
nsCString name;
pluginTag->GetName(name);
if (PluginShouldBeHidden(name)) {
if (name.EqualsLiteral("Shockwave Flash") &&
Preferences::GetBool("plugins.navigator_hide_disabled_flash", false)) {
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
nsCString permString;
nsresult rv = pluginHost->GetPermissionStringForTag(pluginTag, 0, permString);
@ -382,12 +377,6 @@ nsPluginArray::EnsurePlugins()
}
}
if (mPlugins.Length() == 0 && mCTPPlugins.Length() != 0) {
nsCOMPtr<nsPluginTag> hiddenTag = new nsPluginTag("Hidden Plugin", NULL, "dummy.plugin", NULL, NULL,
NULL, NULL, NULL, 0, 0, false);
mPlugins.AppendElement(new nsPluginElement(mWindow, hiddenTag));
}
// Alphabetize the enumeration order of non-hidden plugins to reduce
// fingerprintable entropy based on plugins' installation file times.
mPlugins.Sort();

View File

@ -73,8 +73,6 @@ skip-if = !crashreporter || e10s
[test_getauthenticationinfo.html]
[test_hanging.html]
skip-if = !crashreporter || e10s
[test_hidden_plugin.html]
skip-if = os == "linux"
[test_instance_re-parent.html]
skip-if = release_build # Bug 1172627
[test_instance_unparent1.html]

View File

@ -27,6 +27,10 @@ function getTestPlugin(pluginName) {
// ends
function setTestPluginEnabledState(newEnabledState, pluginName) {
var oldEnabledState = SpecialPowers.setTestPluginEnabledState(newEnabledState, pluginName);
if (!oldEnabledState) {
ok(false, "Cannot find plugin '" + plugin + "'");
return;
}
var plugin = getTestPlugin(pluginName);
while (plugin.enabledState != newEnabledState) {
// Run a nested event loop to wait for the preference change to

View File

@ -1,45 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Test whether we are adding the dummy plugin correctly when there is only 1 plugin and its hidden</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="plugin-utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<body>
<script type="application/javascript;version=1.7">
"use strict"
{
SimpleTest.waitForExplicitFinish();
let ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"].getService(SpecialPowers.Ci.nsIPluginHost);
let plugins = ph.getPluginTags();
let testPluginName = plugins[0].name;
let oldPrefVal = null;
let prefName = "plugins.navigator.hidden_ctp_plugin";
try {
oldPrefVal = SpecialPowers.getCharPref(prefName);
} catch (ex) {}
let promise = SpecialPowers.pushPrefEnv({ set: [[prefName, testPluginName]]});
promise.then(function() {
for (let i = 0; i < plugins.length; i++) {
let plugin = plugins[i];
let newState = (plugin.name == testPluginName ? SpecialPowers.Ci.nsIPluginTag.STATE_CLICKTOPLAY :
SpecialPowers.Ci.nsIPluginTag.STATE_DISABLED);
if (plugin.enabledState != newState) {
let oldState = plugin.enabledState;
setTestPluginEnabledState(newState, plugin.name);
SimpleTest.registerCleanupFunction(function() {
if (plugin.enabledState != oldState)
setTestPluginEnabledState(oldState, plugin.name);
});
}
}
// we have disabled all the plugins except for 1 which is click to play and hidden. The
// navigator.plugins list should have only one entry and it should be the dummy plugin.
is(navigator.plugins.length, 1, "navigator.plugins length should be 1");
is(navigator.plugins[0].name, "Hidden Plugin", "the one plugin should be the dummy plugin");
SimpleTest.finish();
});
}
</script>
</body>

View File

@ -2755,10 +2755,7 @@ pref("hangmonitor.timeout", 0);
pref("plugins.load_appdir_plugins", false);
// If true, plugins will be click to play
pref("plugins.click_to_play", false);
#ifdef NIGHTLY_BUILD
// This only supports one hidden ctp plugin, edit nsPluginArray.cpp if adding a second
pref("plugins.navigator.hidden_ctp_plugin", "Shockwave Flash");
#endif
// The default value for nsIPluginTag.enabledState (STATE_ENABLED = 2)
pref("plugin.default.state", 2);