Bug 1371762 Part 1 Let cert shim code selectively identify some xpis as privileged
MozReview-Commit-ID: L628sUEyHcL
--- a/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
@@ -499,17 +499,21 @@ var AddonTestUtils = {
try {
let manifestURI = this.getManifestURI(file);
let id = await this.getIDFromManifest(manifestURI);
let fakeCert = {commonName: id};
if (this.usePrivilegedSignatures) {
- fakeCert.organizationalUnit = "Mozilla Extensions";
+ let privileged = typeof this.usePrivilegedSignatures == "function" ?
+ this.usePrivilegedSignatures(id) : this.usePrivilegedSignatures;
+ if (privileged) {
+ fakeCert.organizationalUnit = "Mozilla Extensions";
+ }
}
return [callback, Cr.NS_OK, fakeCert];
} catch (e) {
// If there is any error then just pass along the original results
} finally {
// Make sure to close the open zip file or it will be locked.
if (file.isFile())