Closed Bug 1531303 Opened 8 months ago Closed 2 months ago

Add a PermissionTestUtils module

Categories

(Core :: Permission Manager, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: johannh, Assigned: pbz)

References

Details

Attachments

(3 files, 1 obsolete file)

One major obstacle to dropping the nsIURI interfaces of nsIPermissionManager and SitePermissions.jsm is that a ton of tests are currently using URIs and it seems impractical to switch them all to build a principal every time (and also annoying to write new tests like this).

How about we make a PermissionTestUtils module that helps with this task by providing an interface that accepts an origin string or an nsIURI and automagically handles the conversion to principal and then calls Services.perms.addFromPrincipal etc.

No longer blocks: DynamicFirstPartyIsolation
Assignee: nobody → pbz
Status: NEW → ASSIGNED
Attachment #9083678 - Attachment is obsolete: true
Pushed by pzuhlcke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/865c2a5d40da
Implemented a PermissionTestUtils module. r=johannh
https://hg.mozilla.org/integration/autoland/rev/0c75c3bac00b
Refactored tests using PermissionManager URI methods to use PermissionTestUtils. r=johannh
Pushed by pzuhlcke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/87305e83174e
Refactored tests using SitePermissions URI methods for PermissionTestUtils and principals. r=johannh
Flags: needinfo?(pbz)
Pushed by pzuhlcke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e6b0f70a739a
Implemented a PermissionTestUtils module. r=johannh
https://hg.mozilla.org/integration/autoland/rev/31b2a7bf2932
Refactored tests using PermissionManager URI methods to use PermissionTestUtils. r=johannh
https://hg.mozilla.org/integration/autoland/rev/20ecb90e7155
Refactored tests using SitePermissions URI methods for PermissionTestUtils and principals. r=johannh
Flags: needinfo?(pbz)
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

Fantastic work, thanks a lot for doing this, Paul!

You need to log in before you can comment on or make changes to this bug.