Bug 1551239 - Keep tab icon when reloading Customize Mode tab. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D100784
This commit is contained in:
Oriol Brufau 2021-01-05 18:25:59 +00:00
parent 8521ee6581
commit 8e5c5588b8
2 changed files with 13 additions and 0 deletions

View File

@ -6202,10 +6202,13 @@
// Don't clear the favicon if this tab is in the pending
// state, as SessionStore will have set the icon for us even
// though we're pointed at an about:blank. Also don't clear it
// if the tab is in customize mode, to keep the one set by
// gCustomizeMode.setTab (bug 1551239). Also don't clear it
// if onLocationChange was triggered by a pushState or a
// replaceState (bug 550565) or a hash change (bug 408415).
if (
!this.mTab.hasAttribute("pending") &&
!this.mTab.hasAttribute("customizemode") &&
aWebProgress.isLoadingDocument
) {
// Removing the tab's image here causes flickering, wait until the

View File

@ -43,6 +43,11 @@ add_task(async function reload_tab() {
gBrowser.reloadTab(customizeTab);
await tabReloaded;
is(
gBrowser.getIcon(customizeTab),
"chrome://browser/skin/customize.svg",
"Tab should have customize icon"
);
is(
customizeTab.getAttribute("customizemode"),
"true",
@ -71,6 +76,11 @@ add_task(async function reload_tab() {
await BrowserTestUtils.switchTab(gBrowser, customizeTab);
await customizePromise;
is(
gBrowser.getIcon(customizeTab),
"chrome://browser/skin/customize.svg",
"Tab should still have customize icon"
);
is(
customizeTab.getAttribute("customizemode"),
"true",