зеркало из https://github.com/mozilla/pjs.git
Bug 561878: xpinstall.enabled isn't properly blocking installation by webpages. r=robstrong
This commit is contained in:
Родитель
d10111676b
Коммит
c927f73498
|
@ -100,6 +100,9 @@ amManager.prototype = {
|
|||
if (aUris.length == 0)
|
||||
return false;
|
||||
|
||||
if (!AddonManager.isInstallEnabled(aMimetype))
|
||||
return false;
|
||||
|
||||
let retval = true;
|
||||
if (!AddonManager.isInstallAllowed(aMimetype, aReferer)) {
|
||||
aCallback = null;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
// ----------------------------------------------------------------------------
|
||||
// Test whether an InstallTrigger.install call fails when xpinstall is disabled
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
Harness.installBlockedCallback = allow_blocked;
|
||||
Harness.installConfirmCallback = confirm_install;
|
||||
Harness.setup();
|
||||
|
||||
Services.prefs.setBoolPref("xpinstall.enabled", false);
|
||||
|
||||
|
@ -17,12 +19,22 @@ function test() {
|
|||
gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
|
||||
}
|
||||
|
||||
function allow_blocked(installInfo) {
|
||||
ok(false, "Should never see the blocked install notification");
|
||||
return false;
|
||||
}
|
||||
|
||||
function confirm_install(window) {
|
||||
ok(false, "Should never see an install confirmation dialog");
|
||||
return false;
|
||||
}
|
||||
|
||||
function page_loaded() {
|
||||
Services.prefs.clearUserPref("xpinstall.enabled");
|
||||
|
||||
var doc = gBrowser.contentDocument;
|
||||
is(doc.getElementById("return").textContent, "false", "installTrigger should have not been enabled");
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
Harness.finish();
|
||||
}
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
Загрузка…
Ссылка в новой задаче