Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 3c38008

Browse files
committed
Bug 1868766 - BrowserTestUtils shouldn't default to allowInheritPrincipal set to true, r=robwu,settings-reviewers,mossop
Differential Revision: https://phabricator.services.mozilla.com/D236337
1 parent dbed838 commit 3c38008

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

accessible/tests/browser/shared-head.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ function accessibleTask(doc, task, options = {}) {
533533
gBrowser,
534534
"about:blank",
535535
{
536+
allowInheritPrincipal: true,
536537
forceNotRemote: true,
537538
}
538539
);

browser/components/preferences/tests/head.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ async function openPreferencesViaOpenPreferencesAPI(aPane, aOptions) {
106106
? "sync-pane-loaded"
107107
: "privacy-pane-loaded";
108108
let finalPrefPaneLoaded = TestUtils.topicObserved(finalPaneEvent, () => true);
109-
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
109+
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {
110+
allowInheritPrincipal: true,
111+
});
110112
openPreferences(aPane, aOptions);
111113
let newTabBrowser = gBrowser.selectedBrowser;
112114

security/sandbox/test/browser_content_sandbox_utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ function GetBrowserType(type) {
402402
// open a tab in a `type` content process
403403
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {
404404
preferredRemoteType: type,
405+
allowInheritPrincipal: true,
405406
});
406407
// get the browser for the `type` process tab
407408
GetBrowserType[type] = gBrowser.getBrowserForTab(gBrowser.selectedTab);

testing/mochitest/BrowserTestUtils/BrowserTestUtils.sys.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,9 +2660,6 @@ export var BrowserTestUtils = {
26602660
params.triggeringPrincipal =
26612661
Services.scriptSecurityManager.getSystemPrincipal();
26622662
}
2663-
if (!params.allowInheritPrincipal) {
2664-
params.allowInheritPrincipal = true;
2665-
}
26662663
if (beforeLoadFunc) {
26672664
let window = tabbrowser.ownerGlobal;
26682665
window.addEventListener(

0 commit comments

Comments
 (0)