Bug 1245956 - Don't distinguish preliminary signing for add-ons. r=mossop

This commit is contained in:
Andrew Swan 2016-02-18 16:17:09 -08:00
parent 1a76988d54
commit 07870756c9
5 changed files with 12 additions and 24 deletions

View File

@ -205,8 +205,6 @@ function isCorrectlySigned(aAddon) {
return true;
if (aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING)
return false;
if (aAddon.foreignInstall && aAddon.signedState < AddonManager.SIGNEDSTATE_SIGNED)
return false;
return true;
}

View File

@ -693,8 +693,6 @@ function isUsableAddon(aAddon) {
mustSign(aAddon.type)) {
if (aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING)
return false;
if (aAddon.foreignInstall && aAddon.signedState < AddonManager.SIGNEDSTATE_SIGNED)
return false;
}
if (aAddon.blocklistState == Blocklist.STATE_BLOCKED)

View File

@ -868,13 +868,11 @@ add_test(function() {
is_element_hidden(get("detail-disable-btn"), "Disable button should be hidden");
is_element_visible(get("detail-uninstall-btn"), "Remove button should be visible");
is_element_hidden(get("detail-warning"), "Warning message should be hidden");
is_element_visible(get("detail-warning"), "Warning message should be visible");
is(get("detail-warning").textContent, "Test add-on 11 is incompatible with " + gApp + " " + gVersion + ".", "Warning message should be correct");
is_element_hidden(get("detail-warning-link"), "Warning link should be hidden");
is_element_visible(get("detail-error"), "Error message should be visible");
is(get("detail-error").textContent, "Test add-on 11 could not be verified for use in " + gApp + " and has been disabled.", "Error message should be correct");
is_element_visible(get("detail-error-link"), "Error link should be visible");
is(get("detail-error-link").value, "More Information", "Error link text should be correct");
is(get("detail-error-link").href, infoURL, "Error link should be correct");
is_element_hidden(get("detail-error"), "Error message should be hidden");
is_element_hidden(get("detail-error-link"), "Error link should be hidden");
close_manager(gManagerWindow, function() {
Services.prefs.setBoolPref("xpinstall.signatures.required", false);

View File

@ -110,8 +110,6 @@ add_task(function*() {
id: "addon12@tests.mozilla.org",
name: "Test add-on 12",
signedState: AddonManager.SIGNEDSTATE_PRELIMINARY,
isActive: false,
appDisabled: true,
foreignInstall: true,
}, {
id: "addon13@tests.mozilla.org",
@ -892,16 +890,13 @@ add_task(function*() {
is_element_hidden(get_node(addon, "preferences-btn"), "Preferences button should be hidden");
is_element_hidden(get_node(addon, "enable-btn"), "Enable button should be hidden");
is_element_hidden(get_node(addon, "disable-btn"), "Disable button should be hidden");
is_element_visible(get_node(addon, "disable-btn"), "Disable button should be visible");
is_element_visible(get_node(addon, "remove-btn"), "Remove button should be visible");
is_element_hidden(get_node(addon, "warning"), "Warning message should be hidden");
is_element_hidden(get_node(addon, "warning-link"), "Warning link should be hidden");
is_element_visible(get_node(addon, "error"), "Error message should be visible");
is(get_node(addon, "error").textContent, "Test add-on 12 could not be verified for use in " + gApp + " and has been disabled.", "Error message should be correct");
is_element_visible(get_node(addon, "error-link"), "Error link should be visible");
is(get_node(addon, "error-link").value, "More Information", "Error link text should be correct");
is(get_node(addon, "error-link").href, infoURL, "Error link should be correct");
is_element_hidden(get_node(addon, "error"), "Error message should be hidden");
is_element_hidden(get_node(addon, "error-link"), "Error link should be hidden");
info("Addon 13");
addon = items["Test add-on 13"];
@ -936,10 +931,9 @@ add_task(function*() {
is_element_visible(signingInfoUI, "Signing info UI should be visible");
items = get_test_items();
is(Object.keys(items).length, 3, "Two add-ons should be shown");
is(Object.keys(items).length, 2, "Two add-ons should be shown");
is(Object.keys(items)[0], "Test add-on 10", "The disabled unsigned extension should be shown");
is(Object.keys(items)[1], "Test add-on 11", "The disabled unsigned extension should be shown");
is(Object.keys(items)[2], "Test add-on 12", "The disabled foreign installed extension should be shown");
showAllButton.click();

View File

@ -336,7 +336,7 @@ add_task(function*() {
resetPrefs();
});
// Only fully-signed sideloaded add-ons should work
// Preliminarily-signed sideloaded add-ons should work
add_task(function*() {
let file = manuallyInstall(do_get_file(DATA + ADDONS.bootstrap.preliminary), profileDir, ID);
@ -345,10 +345,10 @@ add_task(function*() {
// Currently we leave the sideloaded add-on there but just don't run it
let addon = yield promiseAddonByID(ID);
do_check_neq(addon, null);
do_check_true(addon.appDisabled);
do_check_false(addon.isActive);
do_check_false(addon.appDisabled);
do_check_true(addon.isActive);
do_check_eq(addon.signedState, AddonManager.SIGNEDSTATE_PRELIMINARY);
do_check_eq(getActiveVersion(), -1);
do_check_eq(getActiveVersion(), 2);
addon.uninstall();
yield promiseShutdownManager();