mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-29 20:57:43 -10:00
The lazy loading is a little more complex because we want this to be a constant in the scope so extensions can't trivially replace it. This also changes the test to be more like the proof of concept from bug 1244248. I took the opportunity to promisify a bunch of things which ultimately made the verifySignatures code nicer. MozReview-Commit-ID: 2P890uRY1Si
30 lines
941 B
JavaScript
30 lines
941 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
|
*/
|
|
|
|
// We require signature checks for this test
|
|
Services.prefs.setBoolPref(PREF_XPI_SIGNATURES_REQUIRED, true);
|
|
gUseRealCertChecks = true;
|
|
|
|
const profileDir = gProfD.clone();
|
|
profileDir.append("extensions");
|
|
|
|
const ID = "[email protected]";
|
|
|
|
add_task(async function() {
|
|
createAppInfo("[email protected]", "XPCShell", "1", "1.9.2");
|
|
|
|
AddonTestUtils.manuallyInstall(do_get_addon("test_cache_certdb"), profileDir, ID);
|
|
|
|
startupManager();
|
|
|
|
// Force a rescan of signatures
|
|
const { XPIProvider } = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {});
|
|
await XPIProvider.verifySignatures();
|
|
|
|
let addon = await AddonManager.getAddonByID(ID);
|
|
do_check_eq(addon.signedState, AddonManager.SIGNEDSTATE_MISSING);
|
|
do_check_false(addon.isActive);
|
|
do_check_true(addon.appDisabled);
|
|
});
|