Bug 1383299 - Fix test case error, r=jkt,mconley
The triggeringPrincipal needs to be consistent with the given userContextId.
MozReview-Commit-ID: Ao4hokoIcLb
--- a/browser/components/originattributes/test/browser/head.js
+++ b/browser/components/originattributes/test/browser/head.js
@@ -32,18 +32,22 @@ let gFirstPartyBasicPage = TEST_URL_PATH
* The url of the page.
* @param aUserContextId
* The user context id for this tab.
*
* @return tab - The tab object of this tab.
* browser - The browser object of this tab.
*/
async function openTabInUserContext(aURL, aUserContextId) {
+ let originAttributes = {
+ userContextId: aUserContextId
+ };
+ let triggeringPrincipal = Services.scriptSecurityManager.createCodebasePrincipal(makeURI(aURL), originAttributes);
// Open the tab in the correct userContextId.
- let tab = BrowserTestUtils.addTab(gBrowser, aURL, {userContextId: aUserContextId});
+ let tab = BrowserTestUtils.addTab(gBrowser, aURL, {userContextId: aUserContextId, triggeringPrincipal});
// Select tab and make sure its browser is focused.
gBrowser.selectedTab = tab;
tab.ownerGlobal.focus();
let browser = gBrowser.getBrowserForTab(tab);
await BrowserTestUtils.browserLoaded(browser);
return {tab, browser};