зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1608545 - ensure userContextId inherited from relatedTab is used throughout addTab and test for it, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D60017 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0700c14b2d
Коммит
9d4ffbfc01
|
@ -2634,12 +2634,17 @@
|
|||
this.tabContainer.getAttribute("overflow") != "true" &&
|
||||
this.animationsEnabled;
|
||||
|
||||
// Related tab inherits current tab's user context unless a different
|
||||
// usercontextid is specified
|
||||
if (userContextId == null && openerTab) {
|
||||
userContextId = openerTab.getAttribute("usercontextid") || 0;
|
||||
}
|
||||
|
||||
this.setTabAttributes(t, {
|
||||
animate,
|
||||
noInitialLabel,
|
||||
aURI,
|
||||
userContextId,
|
||||
openerTab,
|
||||
skipBackgroundNotify,
|
||||
pinned,
|
||||
skipAnimation,
|
||||
|
@ -3111,7 +3116,6 @@
|
|||
noInitialLabel,
|
||||
aURI,
|
||||
userContextId,
|
||||
openerTab,
|
||||
skipBackgroundNotify,
|
||||
pinned,
|
||||
skipAnimation,
|
||||
|
@ -3126,12 +3130,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Related tab inherits current tab's user context unless a different
|
||||
// usercontextid is specified
|
||||
if (userContextId == null && openerTab) {
|
||||
userContextId = openerTab.getAttribute("usercontextid") || 0;
|
||||
}
|
||||
|
||||
if (userContextId) {
|
||||
tab.setAttribute("usercontextid", userContextId);
|
||||
ContextualIdentityService.setTabStyle(tab);
|
||||
|
|
|
@ -23,6 +23,11 @@ add_task(async function() {
|
|||
1,
|
||||
"Related tab (relatedToCurrent) inherits current tab's usercontextid"
|
||||
);
|
||||
is(
|
||||
relatedTab.linkedBrowser.contentPrincipal.userContextId,
|
||||
1,
|
||||
"Related tab's browser actually inherits the current tab's usercontextid"
|
||||
);
|
||||
BrowserTestUtils.removeTab(relatedTab);
|
||||
|
||||
gBrowser.selectedTab = tab;
|
||||
|
@ -35,6 +40,11 @@ add_task(async function() {
|
|||
2,
|
||||
"Related tab (relatedToCurrent) with overridden usercontextid"
|
||||
);
|
||||
is(
|
||||
relatedTab.linkedBrowser.contentPrincipal.userContextId,
|
||||
2,
|
||||
"Related tab's browser actually gets overridden usercontextid"
|
||||
);
|
||||
BrowserTestUtils.removeTab(relatedTab);
|
||||
|
||||
gBrowser.selectedTab = tab;
|
||||
|
@ -51,6 +61,11 @@ add_task(async function() {
|
|||
1,
|
||||
"Related tab (referrer) inherits current tab's usercontextid"
|
||||
);
|
||||
is(
|
||||
relatedTab.linkedBrowser.contentPrincipal.userContextId,
|
||||
1,
|
||||
"Related tab's browser (referrer) actually inherits the current tab's usercontextid"
|
||||
);
|
||||
BrowserTestUtils.removeTab(relatedTab);
|
||||
|
||||
gBrowser.selectedTab = tab;
|
||||
|
@ -68,6 +83,11 @@ add_task(async function() {
|
|||
2,
|
||||
"Related tab (referrer) with overridden usercontextid"
|
||||
);
|
||||
is(
|
||||
relatedTab.linkedBrowser.contentPrincipal.userContextId,
|
||||
2,
|
||||
"Related tab's browser (referrer) actually gets overridden usercontextid"
|
||||
);
|
||||
BrowserTestUtils.removeTab(relatedTab);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
|
|
Загрузка…
Ссылка в новой задаче