Bug 1483910: Clear seenTabIcon on pagehide so subsequent loads attempt to load the root favicon. r=kmag
authorDave Townsend <dtownsend@oxymoronical.com>
Thu, 16 Aug 2018 17:29:57 +0000
changeset 431914 3567e433384608b2df9c8b0124afa595edd2c3dc
parent 431913 d3c6ea00c0bd57c71d257191dbaa40c192ba1e26
child 431915 5a85654da581748b68bdf88aebcebf8bf4a47117
push id34455
push usertoros@mozilla.com
push dateThu, 16 Aug 2018 21:31:58 +0000
treeherdermozilla-central@bf74fe0e7f76 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1483910
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
browser/actors/LinkHandlerChild.jsm
browser/base/content/test/favicons/blank.html
browser/base/content/test/favicons/browser.ini
browser/base/content/test/favicons/browser_rooticon.js
--- a/browser/actors/LinkHandlerChild.jsm
+++ b/browser/actors/LinkHandlerChild.jsm
@@ -73,16 +73,18 @@ class LinkHandlerChild extends ActorChil
   onPageHide(event) {
     if (event.target != this.content.document) {
       return;
     }
 
     if (this._iconLoader) {
       this._iconLoader.onPageHide();
     }
+
+    this.seenTabIcon = false;
   }
 
   onLinkEvent(event) {
     let link = event.target;
     // Ignore sub-frames (bugs 305472, 479408).
     if (link.ownerGlobal != this.content) {
       return;
     }
--- a/browser/base/content/test/favicons/blank.html
+++ b/browser/base/content/test/favicons/blank.html
@@ -1,4 +1,6 @@
 <!DOCTYPE html>
 
 <html>
+<head>
+</head>
 </html>
--- a/browser/base/content/test/favicons/browser.ini
+++ b/browser/base/content/test/favicons/browser.ini
@@ -43,8 +43,11 @@ support-files =
 [browser_missing_favicon.js]
 support-files =
   blank.html
 [browser_redirect.js]
 support-files =
   file_favicon_redirect.html
   file_favicon_redirect.ico
   file_favicon_redirect.ico^headers^
+[browser_rooticon.js]
+support-files =
+  blank.html
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/favicons/browser_rooticon.js
@@ -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);
+});