Bug 1483910: Clear seenTabIcon on pagehide so subsequent loads attempt to load the root favicon. r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D3534

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dave Townsend 2018-08-16 17:29:57 +00:00
Родитель 0ba415cc98
Коммит 35b08ddffc
4 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -78,6 +78,8 @@ class LinkHandlerChild extends ActorChild {
if (this._iconLoader) {
this._iconLoader.onPageHide();
}
this.seenTabIcon = false;
}
onLinkEvent(event) {

Просмотреть файл

@ -1,4 +1,6 @@
<!DOCTYPE html>
<html>
<head>
</head>
</html>

Просмотреть файл

@ -48,3 +48,6 @@ support-files =
file_favicon_redirect.html
file_favicon_redirect.ico
file_favicon_redirect.ico^headers^
[browser_rooticon.js]
support-files =
blank.html

Просмотреть файл

@ -0,0 +1,21 @@
add_task(async () => {
const testPath = "http://example.com/browser/browser/base/content/test/favicons/blank.html";
const expectedIcon = "http://example.com/favicon.ico";
let tab = BrowserTestUtils.addTab(gBrowser, testPath);
gBrowser.selectedTab = tab;
let browser = tab.linkedBrowser;
let faviconPromise = waitForLinkAvailable(browser);
await BrowserTestUtils.browserLoaded(browser);
let iconURI = await faviconPromise;
is(iconURI, expectedIcon, "Got correct initial icon.");
faviconPromise = waitForLinkAvailable(browser);
BrowserTestUtils.loadURI(browser, testPath);
await BrowserTestUtils.browserLoaded(browser);
iconURI = await faviconPromise;
is(iconURI, expectedIcon, "Got correct icon on second load.");
BrowserTestUtils.removeTab(tab);
});