Bug 1480319: Follow-up: Re-enable favicon guessing during WebRequest tests. r=Mossop
☠☠ backed out by e19fc7991514 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 15 Aug 2018 14:56:49 -0700
changeset 486912 186ad2d171c1f2348703b119ad5983515ead58a7
parent 486911 baba90c7c28f86218bbf7f0fc8ae5c3831f33b34
child 486913 7793f8a2b14f3d2b0b7ee1a76aff5ccaadb6327e
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs1480319
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 1480319: Follow-up: Re-enable favicon guessing during WebRequest tests. r=Mossop
browser/actors/LinkHandlerChild.jsm
toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html
--- a/browser/actors/LinkHandlerChild.jsm
+++ b/browser/actors/LinkHandlerChild.jsm
@@ -31,16 +31,17 @@ class LinkHandlerChild extends ActorChil
 
   addRootIcon() {
     if (!this.seenTabIcon && Services.prefs.getBoolPref("browser.chrome.guess_favicon", true) &&
         Services.prefs.getBoolPref("browser.chrome.site_icons", true)) {
       // Inject the default icon. Use documentURIObject so that we do the right
       // thing with about:-style error pages. See bug 453442
       let baseURI = this.content.document.documentURIObject;
       if (["http", "https"].includes(baseURI.scheme)) {
+        this.seenTabIcon = true;
         this.iconLoader.addDefaultIcon(baseURI);
       }
     }
   }
 
   onHeadParsed(event) {
     if (event.target.ownerDocument != this.content.document) {
       return;
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html
@@ -35,18 +35,17 @@ add_task(async function setup() {
   let cache = imgTools.getImgCacheForDocument(document);
   cache.clearCache(false);
   function clearCache() {
     ChromeUtils.import("resource://gre/modules/Services.jsm", {}).Services.cache2.clear();
   }
   SpecialPowers.loadChromeScript(clearCache);
 
   await SpecialPowers.pushPrefEnv({
-    set: [["network.http.rcwn.enabled", false],
-          ["browser.chrome.guess_favicon", false]],
+    set: [["network.http.rcwn.enabled", false]],
   });
 
   extension = makeExtension();
   await extension.startup();
 });
 
 // expect is a set of test values used by the background script.
 //
@@ -273,16 +272,24 @@ add_task(async function test_webRequest_
 
   let linkUrl = `file_WebRequest_page3.html?trigger=a&nocache=${Math.random()}`;
   let expect = {
     "file_WebRequest_page3.html": {
       type: "main_frame",
     },
   };
 
+  if (AppConstants.platform != "android") {
+    expect["favicon.ico"] = {
+      type: "image",
+      origin: SimpleTest.getTestFileURL(linkUrl),
+      cached: false,
+    };
+  }
+
   extension.sendMessage("set-expected", {expect, origin: location.href});
   await extension.awaitMessage("continue");
   let a = addLink(linkUrl);
   a.click();
   await extension.awaitMessage("done");
 
   let closed = tabExt.awaitMessage("tab-closed");
   tabExt.sendMessage("close-tab");
@@ -319,16 +326,24 @@ add_task(async function test_webRequest_
   });
 
   let expect = {
     "file_sample.html": {
       type: "main_frame",
     },
   };
 
+  if (AppConstants.platform != "android") {
+    expect["favicon.ico"] = {
+      type: "image",
+      origin: pageUrl,
+      cached: true,
+    };
+  }
+
   await tabExt.startup();
   let origin = await tabExt.awaitMessage("origin");
 
   // expecting origin == extension baseUrl
   extension.sendMessage("set-expected", {expect, origin});
   await extension.awaitMessage("continue");
 
   // open a tab from an extension principal