diff options
Diffstat (limited to 'toolkit/mozapps')
7 files changed, 67 insertions, 5 deletions
diff --git a/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm b/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm index 11944ddf5..66147b9aa 100644 --- a/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm +++ b/toolkit/mozapps/extensions/internal/AddonRepository_SQLiteMigrator.jsm @@ -60,7 +60,11 @@ this.AddonRepository_SQLiteMigrator = { this._retrieveStoredData((results) => { this._closeConnection(); - let resultArray = [addon for ([,addon] of Iterator(results))]; + // Tycho: let resultArray = [addon for ([,addon] of Iterator(results))]; + let resultArray = []; + for (let [,addon] of Iterator(results)) { + resultArray.push(addon); + } logger.debug(resultArray.length + " addons imported.") aCallback(resultArray); }); diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 72a460e4a..c43811ba8 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -4436,7 +4436,18 @@ this.XPIProvider = { if (aAddon.type == "locale") return; - if (!(aMethod in this.bootstrapScopes[aAddon.id])) { + let method = undefined; + try { + method = Components.utils.evalInSandbox(`${aMethod};`, + this.bootstrapScopes[aAddon.id], + "ECMAv5"); + } + catch (e) { + // An exception will be caught if the expected method is not defined. + // That will be logged below. + } + + if (!method) { logger.warn("Add-on " + aAddon.id + " is missing bootstrap method " + aMethod); return; } @@ -4455,9 +4466,9 @@ this.XPIProvider = { } logger.debug("Calling bootstrap method " + aMethod + " on " + aAddon.id + " version " + - aAddon.version); + aAddon.version); try { - this.bootstrapScopes[aAddon.id][aMethod](params, aReason); + method(params, aReason); } catch (e) { logger.warn("Exception running bootstrap method " + aMethod + " on " + aAddon.id, e); diff --git a/toolkit/mozapps/extensions/nsBlocklistService.js b/toolkit/mozapps/extensions/nsBlocklistService.js index 936c9d1b5..487dae8e5 100644 --- a/toolkit/mozapps/extensions/nsBlocklistService.js +++ b/toolkit/mozapps/extensions/nsBlocklistService.js @@ -910,7 +910,7 @@ Blocklist.prototype = { let issuer = blocklistElement.getAttribute("issuerName"); for (let snElement of blocklistElement.children) { try { - gCertBlocklistService.addRevokedCert(issuer, snElement.textContent); + gCertBlocklistService.revokeCertByIssuerAndSerial(issuer, snElement.textContent); } catch (e) { // we want to keep trying other elements since missing all items // is worse than missing one diff --git a/toolkit/mozapps/extensions/test/addons/test_bootstrap_const/bootstrap.js b/toolkit/mozapps/extensions/test/addons/test_bootstrap_const/bootstrap.js new file mode 100644 index 000000000..498b76526 --- /dev/null +++ b/toolkit/mozapps/extensions/test/addons/test_bootstrap_const/bootstrap.js @@ -0,0 +1,5 @@ +Components.utils.import("resource://gre/modules/Services.jsm");
+
+const install = function() {
+ Services.obs.notifyObservers(null, "addon-install", "");
+}
\ No newline at end of file diff --git a/toolkit/mozapps/extensions/test/addons/test_bootstrap_const/install.rdf b/toolkit/mozapps/extensions/test/addons/test_bootstrap_const/install.rdf new file mode 100644 index 000000000..af3a749ce --- /dev/null +++ b/toolkit/mozapps/extensions/test/addons/test_bootstrap_const/install.rdf @@ -0,0 +1,24 @@ +<?xml version="1.0"?>
+
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>bootstrap@tests.mozilla.org</em:id>
+ <em:version>1.0</em:version>
+ <em:bootstrap>true</em:bootstrap>
+
+ <!-- Front End MetaData -->
+ <em:name>Test Bootstrap</em:name>
+ <em:description>Test Description</em:description>
+
+ <em:targetApplication>
+ <Description>
+ <em:id>xpcshell@tests.mozilla.org</em:id>
+ <em:minVersion>1</em:minVersion>
+ <em:maxVersion>1</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+
+ </Description>
+</RDF>
\ No newline at end of file diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js new file mode 100644 index 000000000..fb02b59be --- /dev/null +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap_const.js @@ -0,0 +1,17 @@ +/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
+startupManager();
+
+add_task(function*() {
+ let sawInstall = false;
+ Services.obs.addObserver(function() {
+ sawInstall = true;
+ }, "addon-install", false);
+
+ yield promiseInstallAllFiles([do_get_addon("test_bootstrap_const")]);
+
+ ok(sawInstall);
+});
\ No newline at end of file diff --git a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini index bab072e83..2a12f147a 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini +++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini @@ -29,6 +29,7 @@ skip-if = os == "android" [test_bootstrap.js] # Bug 676992: test consistently hangs on Android skip-if = os == "android" +[test_bootstrap_const.js] [test_bootstrap_resource.js] [test_bug299716.js] # Bug 676992: test consistently hangs on Android |