Bug 1371762 Part 1 Let cert shim code selectively identify some xpis as privileged draft
authorAndrew Swan <aswan@mozilla.com>
Wed, 19 Jul 2017 10:27:21 -0700
changeset 611403 f15343f26adde16d8f799f7e518404121be99ec5
parent 610649 dece50457378ac4934afe9fb3c2a8054e8894588
child 611404 404502e41135d8a88299209e0522c0801d8d28ed
push id69215
push useraswan@mozilla.com
push dateWed, 19 Jul 2017 17:29:25 +0000
bugs1371762
milestone56.0a1
Bug 1371762 Part 1 Let cert shim code selectively identify some xpis as privileged MozReview-Commit-ID: L628sUEyHcL
toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
--- 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())