browser_permissions_mozAddonManager.js (1066B)
1 "use strict"; 2 3 const INSTALL_PAGE = `${BASE}/file_install_extensions.html`; 4 5 async function installMozAM(filename) { 6 BrowserTestUtils.startLoadingURIString( 7 gBrowser.selectedBrowser, 8 INSTALL_PAGE 9 ); 10 await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); 11 12 await SpecialPowers.pushPrefEnv({ 13 set: [ 14 // This test asserts that the extension icon is in the install dialog 15 // and so it requires the signature checks to be enabled (otherwise the 16 // extension icon is expected to be replaced by a warning icon) and the 17 // two test extension used by this test (browser_webext_nopermissions.xpi 18 // and browser_webext_permissions.xpi) are signed using AMO stage signatures. 19 ["xpinstall.signatures.dev-root", true], 20 ], 21 }); 22 23 await SpecialPowers.spawn( 24 gBrowser.selectedBrowser, 25 [`${BASE}/${filename}`], 26 async function (url) { 27 await content.wrappedJSObject.installMozAM(url); 28 } 29 ); 30 31 await SpecialPowers.popPrefEnv(); 32 } 33 34 add_task(() => testInstallMethod(installMozAM, "installAmo"));