mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-30 14:17:36 -10:00
20 lines
1023 B
JavaScript
20 lines
1023 B
JavaScript
add_task(async function() {
|
|
// Add a permission for example.com, start a new content process, and make
|
|
// sure that the permission has been sent down.
|
|
Services.perms.add(Services.io.newURI("http://example.com"),
|
|
"viewsourceTestingPerm",
|
|
Services.perms.ALLOW_ACTION);
|
|
|
|
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
|
|
"view-source:http://example.com",
|
|
/* waitForLoad */ true,
|
|
/* waitForStateStop */ false,
|
|
/* forceNewProcess */ true);
|
|
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
|
|
is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
|
|
"viewsourceTestingPerm"),
|
|
Services.perms.ALLOW_ACTION);
|
|
});
|
|
await BrowserTestUtils.removeTab(tab);
|
|
});
|