Backed out 8 changesets (bug 1277803) for frequent failures in browser_privatebrowsing_favicon.js
authorPhil Ringnalda <philringnalda@gmail.com>
Fri, 07 Oct 2016 18:41:27 -0700
changeset 317101 ef962d8857009eff3a2df14c06e4bc72acb13691
parent 317100 4d231a4b5a029423d60e7a6aa02be30123f174ca
child 317102 b89630e40c018a02e6e615eefd6abde52b364d94
push id20681
push userphilringnalda@gmail.com
push dateSat, 08 Oct 2016 23:57:20 +0000
treeherderfx-team@7a7ba250bb2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1277803
milestone52.0a1
backs outa046eef2014c7f872c34d37fd0ba0b80550ec070
61947b3073ba24bd1996ddc33d87e48ac6e68d11
ef181cdd290faf714d72bf4ea4ee9750b8040235
b6ea3bd2435964905014c94e4b8396affc5880bd
835470de461d0e321b82af7eb045f58a9ef63eff
f4adcb16d1ecf356dcea02da17ecca2397334148
58c23d794ba55823687eeae9548c6b7a7823cb0c
f29f88c5c1b9c9ac080f233bb4ecfd80b50af3d3
Backed out 8 changesets (bug 1277803) for frequent failures in browser_privatebrowsing_favicon.js Backed out changeset a046eef2014c (bug 1277803) Backed out changeset 61947b3073ba (bug 1277803) Backed out changeset ef181cdd290f (bug 1277803) Backed out changeset b6ea3bd24359 (bug 1277803) Backed out changeset 835470de461d (bug 1277803) Backed out changeset f4adcb16d1ec (bug 1277803) Backed out changeset 58c23d794ba5 (bug 1277803) Backed out changeset f29f88c5c1b9 (bug 1277803)
browser/base/content/tabbrowser.xml
browser/components/contextualidentity/test/browser/browser_favicon.js
browser/components/originattributes/test/browser/browser.ini
browser/components/originattributes/test/browser/browser_favicon_firstParty.js
browser/components/originattributes/test/browser/browser_favicon_userContextId.js
browser/components/originattributes/test/browser/file_favicon.html
browser/components/originattributes/test/browser/file_favicon.png
browser/components/originattributes/test/browser/file_favicon.png^headers^
browser/components/originattributes/test/browser/file_favicon_cache.html
browser/components/originattributes/test/browser/file_favicon_cache.png
browser/components/originattributes/test/browser/file_favicon_thirdParty.html
browser/components/privatebrowsing/test/browser/browser.ini
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js
browser/components/privatebrowsing/test/browser/file_favicon.html
browser/components/privatebrowsing/test/browser/file_favicon.png
browser/components/privatebrowsing/test/browser/file_favicon.png^headers^
dom/base/nsContentPolicyUtils.h
dom/base/nsContentUtils.cpp
dom/base/nsGkAtomList.h
dom/base/nsIContentPolicyBase.idl
dom/cache/DBSchema.cpp
dom/fetch/InternalRequest.cpp
dom/fetch/InternalRequest.h
dom/security/nsContentSecurityManager.cpp
dom/security/test/general/bug1277803.html
dom/security/test/general/chrome.ini
dom/security/test/general/favicon_bug1277803.ico
dom/security/test/general/test_bug1277803.xul
dom/security/test/moz.build
image/imgLoader.cpp
layout/xul/nsImageBoxFrame.cpp
netwerk/base/nsNetUtil.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/nsHttpChannel.cpp
toolkit/components/places/FaviconHelpers.cpp
toolkit/components/places/nsFaviconService.cpp
toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js
toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
toolkit/components/places/tests/favicons/test_page-icon_protocol.js
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -6455,17 +6455,17 @@
                     class="tab-background-end"/>
         </xul:hbox>
         <xul:hbox xbl:inherits="pinned,selected=visuallyselected,titlechanged,attention"
                   class="tab-content" align="center">
           <xul:image xbl:inherits="fadein,pinned,busy,progress,selected=visuallyselected"
                      class="tab-throbber"
                      role="presentation"
                      layer="true" />
-          <xul:image xbl:inherits="src=image,loadingprincipal=iconLoadingPrincipal,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
+          <xul:image xbl:inherits="src=image,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
                      anonid="tab-icon-image"
                      class="tab-icon-image"
                      validate="never"
                      role="presentation"/>
           <xul:image xbl:inherits="sharing,selected=visuallyselected"
                      anonid="sharing-icon"
                      class="tab-sharing-icon-overlay"
                      role="presentation"/>
--- a/browser/components/contextualidentity/test/browser/browser_favicon.js
+++ b/browser/components/contextualidentity/test/browser/browser_favicon.js
@@ -17,17 +17,17 @@ let gHttpServer = null;
 let gUserContextId;
 let gFaviconData;
 
 function getIconFile() {
   new Promise(resolve => {
     NetUtil.asyncFetch({
       uri: "http://www.example.com/browser/browser/components/contextualidentity/test/browser/favicon-normal32.png",
       loadUsingSystemPrincipal: true,
-      contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
+      contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
     }, function(inputStream, status) {
         let size = inputStream.available();
         gFaviconData = NetUtil.readInputStreamToString(inputStream, size);
         resolve();
     });
   });
 }
 
--- a/browser/components/originattributes/test/browser/browser.ini
+++ b/browser/components/originattributes/test/browser/browser.ini
@@ -1,19 +1,13 @@
 [DEFAULT]
 skip-if = buildapp == "mulet"
 tags = usercontextid firstpartyisolation originattributes
 support-files =
   dummy.html
-  file_favicon.html
-  file_favicon.png
-  file_favicon.png^headers^
-  file_favicon_cache.html
-  file_favicon_cache.png
-  file_favicon_thirdParty.html
   file_firstPartyBasic.html
   file_sharedworker.html
   file_sharedworker.js
   head.js
   test.js
   test.js^headers^
   test.html
   test2.html
@@ -25,16 +19,14 @@ support-files =
   test_firstParty_http_redirect.html
   test_firstParty_http_redirect.html^headers^
   test_firstParty_iframe_http_redirect.html
   test_firstParty_postMessage.html
   window.html
   worker_blobify.js
   worker_deblobify.js
 
-[browser_favicon_firstParty.js]
-[browser_favicon_userContextId.js]
 [browser_firstPartyIsolation.js]
 [browser_localStorageIsolation.js]
 [browser_blobURLIsolation.js]
 [browser_imageCacheIsolation.js]
 [browser_sharedworker.js]
 [browser_httpauth.js]
deleted file mode 100644
--- a/browser/components/originattributes/test/browser/browser_favicon_firstParty.js
+++ /dev/null
@@ -1,304 +0,0 @@
-/**
- * Bug 1277803 - A test case for testing favicon loading across different first party domains.
- */
-
-const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-
-const FIRST_PARTY_ONE = "example.com";
-const FIRST_PARTY_TWO = "example.org";
-const THIRD_PARTY = "mochi.test:8888";
-
-const TEST_SITE_ONE = "http://" + FIRST_PARTY_ONE;
-const TEST_SITE_TWO = "http://" + FIRST_PARTY_TWO;
-const THIRD_PARTY_SITE = "http://" + THIRD_PARTY;
-const TEST_DIRECTORY = "/browser/browser/components/originattributes/test/browser/";
-
-const TEST_PAGE = TEST_DIRECTORY + "file_favicon.html";
-const TEST_THIRD_PARTY_PAGE = TEST_DIRECTORY + "file_favicon_thirdParty.html";
-const TEST_CACHE_PAGE = TEST_DIRECTORY + "file_favicon_cache.html";
-
-const FAVICON_URI = TEST_DIRECTORY + "file_favicon.png";
-const TEST_FAVICON_CACHE_URI = TEST_DIRECTORY + "file_favicon_cache.png";
-
-let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
-let makeURI = Cu.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
-
-
-
-function clearAllImageCaches() {
-  let tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
-                             .getService(SpecialPowers.Ci.imgITools);
-  let imageCache = tools.getImgCacheForDocument(window.document);
-  imageCache.clearCache(true);  // true=chrome
-  imageCache.clearCache(false); // false=content
-}
-
-function observeFavicon(aFirstPartyDomain, aExpectedCookie, aPageURI) {
-  let faviconReqXUL = false;
-  let faviconReqPlaces = false;
-  let expectedPrincipal = Services.scriptSecurityManager
-                                  .createCodebasePrincipal(aPageURI, { firstPartyDomain: aFirstPartyDomain });
-
-  return new Promise(resolve => {
-    let observer = {
-      observe(aSubject, aTopic, aData) {
-        // Make sure that the topic is 'http-on-modify-request'.
-        if (aTopic === "http-on-modify-request") {
-          // We check the firstPartyDomain for the originAttributes of the loading
-          // channel. All requests for the favicon should contain the correct
-          // firstPartyDomain. There are two requests for a favicon loading, one
-          // from the Places library and one from the XUL image. The difference
-          // of them is the loading principal. The Places will use the content
-          // principal and the XUL image will use the system principal.
-
-          let httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel);
-          let reqLoadInfo = httpChannel.loadInfo;
-          let loadingPrincipal = reqLoadInfo.loadingPrincipal;
-          let triggeringPrincipal = reqLoadInfo.triggeringPrincipal;
-
-          // Make sure this is a favicon request.
-          if (!httpChannel.URI.spec.endsWith(FAVICON_URI)) {
-            return;
-          }
-
-          // Check the first party domain.
-          is(reqLoadInfo.originAttributes.firstPartyDomain, aFirstPartyDomain,
-            "The loadInfo has correct first party domain");
-
-          if (loadingPrincipal.equals(systemPrincipal)) {
-            faviconReqXUL = true;
-            ok(triggeringPrincipal.equals(expectedPrincipal),
-              "The triggeringPrincipal of favicon loading from XUL should be the content principal.");
-          } else {
-            faviconReqPlaces = true;
-            ok(loadingPrincipal.equals(expectedPrincipal),
-              "The loadingPrincipal of favicon loading from Places should be the content prinicpal");
-          }
-
-          let faviconCookie = httpChannel.getRequestHeader("cookie");
-
-          is(faviconCookie, aExpectedCookie, "The cookie of the favicon loading is correct.");
-        } else {
-          ok(false, "Received unexpected topic: ", aTopic);
-        }
-
-        if (faviconReqXUL && faviconReqPlaces) {
-          Services.obs.removeObserver(observer, "http-on-modify-request", false);
-          resolve();
-        }
-      }
-    };
-
-    Services.obs.addObserver(observer, "http-on-modify-request", false);
-  });
-}
-
-function waitOnFaviconResponse(aFaviconURL) {
-  return new Promise(resolve => {
-    let observer = {
-      observe(aSubject, aTopic, aData) {
-        if (aTopic === "http-on-examine-response" ||
-            aTopic === "http-on-examine-cached-response") {
-
-          let httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel);
-          let loadInfo = httpChannel.loadInfo;
-
-          if (httpChannel.URI.spec !== aFaviconURL) {
-            return;
-          }
-
-          let result = {
-            topic: aTopic,
-            firstPartyDomain: loadInfo.originAttributes.firstPartyDomain
-          };
-
-          resolve(result);
-          Services.obs.removeObserver(observer, "http-on-examine-response", false);
-          Services.obs.removeObserver(observer, "http-on-examine-cached-response", false);
-        }
-      }
-    };
-
-    Services.obs.addObserver(observer, "http-on-examine-response", false);
-    Services.obs.addObserver(observer, "http-on-examine-cached-response", false);
-  });
-}
-
-function waitOnFaviconLoaded(aFaviconURL) {
-  return new Promise(resolve => {
-    let observer = {
-      onPageChanged(uri, attr, value, id) {
-
-        if (attr === Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON &&
-            value === aFaviconURL) {
-          resolve();
-          PlacesUtils.history.removeObserver(observer, false);
-        }
-      },
-    };
-
-    PlacesUtils.history.addObserver(observer, false);
-  });
-}
-
-function* openTab(aURL) {
-  let tab = gBrowser.addTab(aURL);
-
-  // Select tab and make sure its browser is focused.
-  gBrowser.selectedTab = tab;
-  tab.ownerGlobal.focus();
-
-  let browser = gBrowser.getBrowserForTab(tab);
-  yield BrowserTestUtils.browserLoaded(browser);
-  return {tab, browser};
-}
-
-function* assignCookiesUnderFirstParty(aURL, aFirstParty, aCookieValue){
-  // Open a tab under the given aFirstParty, and this tab will have an
-  // iframe which loads the aURL.
-  let tabInfo = yield openTabInFirstParty(aURL, aFirstParty);
-
-  // Add cookies into the iframe.
-  yield ContentTask.spawn(tabInfo.browser, aCookieValue, function* (value) {
-    content.document.cookie = value;
-  });
-
-  yield BrowserTestUtils.removeTab(tabInfo.tab);
-}
-
-function* generateCookies(aThirdParty) {
-  // we generate two different cookies for two first party domains.
-  let cookies = [];
-  cookies.push(Math.random().toString());
-  cookies.push(Math.random().toString());
-
-  let firstSiteURL;
-  let secondSiteURL;
-
-  if (aThirdParty) {
-    // Add cookies into the third party site with different first party domain.
-    firstSiteURL = THIRD_PARTY_SITE;
-    secondSiteURL = THIRD_PARTY_SITE;
-  } else {
-    // Add cookies into sites.
-    firstSiteURL = TEST_SITE_ONE;
-    secondSiteURL = TEST_SITE_TWO;
-  }
-
-  yield assignCookiesUnderFirstParty(firstSiteURL, TEST_SITE_ONE, cookies[0]);
-  yield assignCookiesUnderFirstParty(secondSiteURL, TEST_SITE_TWO, cookies[1]);
-
-  return cookies;
-}
-
-function* doTest(aTestPage, aExpectedCookies, aFaviconURL) {
-  let firstPageURI = makeURI(TEST_SITE_ONE + aTestPage);
-  let secondPageURI = makeURI(TEST_SITE_TWO + aTestPage);
-  let faviconURI = makeURI(aFaviconURL);
-
-  // Open the tab for the first site.
-  let tabInfo = yield openTab(TEST_SITE_ONE + aTestPage);
-
-  // Waiting until favicon requests are all made.
-  yield observeFavicon(FIRST_PARTY_ONE, aExpectedCookies[0], firstPageURI);
-  // Close the tab.
-  yield BrowserTestUtils.removeTab(tabInfo.tab);
-
-  // Open the tab for the second site.
-  tabInfo = yield openTab(TEST_SITE_TWO + aTestPage);
-
-  // Waiting until favicon requests are all made.
-  yield observeFavicon(FIRST_PARTY_TWO, aExpectedCookies[1], secondPageURI);
-
-  yield BrowserTestUtils.removeTab(tabInfo.tab);
-}
-
-add_task(function* setup() {
-  // Make sure first party isolation is enabled.
-  yield SpecialPowers.pushPrefEnv({"set": [
-      ["privacy.firstparty.isolate", true]
-  ]});
-});
-
-// A clean up function to prevent affecting other tests.
-registerCleanupFunction(() => {
-  // Clear all cookies.
-  let cookieMgr = Cc["@mozilla.org/cookiemanager;1"]
-                     .getService(Ci.nsICookieManager);
-  cookieMgr.removeAll();
-
-  // Clear all image caches and network caches.
-  clearAllImageCaches();
-
-  let networkCache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
-                        .getService(Ci.nsICacheStorageService);
-  networkCache.clear();
-});
-
-add_task(function* test_favicon_firstParty() {
-  for (let testThirdParty of [false, true]) {
-    // Clear all image caches before running the test.
-    clearAllImageCaches();
-
-    let cookies = yield generateCookies(testThirdParty);
-
-    if (testThirdParty) {
-      yield doTest(TEST_THIRD_PARTY_PAGE, cookies, THIRD_PARTY_SITE + FAVICON_URI);
-    } else {
-      yield doTest(TEST_PAGE, cookies, TEST_SITE_TWO + FAVICON_URI);
-    }
-  }
-});
-
-add_task(function* test_favicon_cache_firstParty() {
-  // Clear all image caches and network caches before running the test.
-  clearAllImageCaches();
-
-  let networkCache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
-                        .getService(Ci.nsICacheStorageService);
-  networkCache.clear();
-
-  // Open the tab for the first site.
-  let tabInfoA = yield openTab(TEST_SITE_ONE + TEST_CACHE_PAGE);
-
-  // Start to observer the event of that favicon has been fully loaded and cached.
-  let promiseForFaviconLoaded = waitOnFaviconLoaded(THIRD_PARTY_SITE + TEST_FAVICON_CACHE_URI);
-
-  // Wait for the favicon response of the first tab.
-  let response = yield waitOnFaviconResponse(THIRD_PARTY_SITE + TEST_FAVICON_CACHE_URI);
-
-  // Make sure the favicon is loaded through the network and its first party domain is correct.
-  is(response.topic, "http-on-examine-response", "The favicon image should be loaded through network.");
-  is(response.firstPartyDomain, FIRST_PARTY_ONE, "We should only observe the network response for the first first party.");
-
-  // Waiting until the favicon has been loaded and cached.
-  yield promiseForFaviconLoaded;
-
-  // Open the tab again for checking the image cache is working correctly.
-  let tabInfoB = yield openTab(TEST_SITE_ONE + TEST_CACHE_PAGE);
-
-  // Start to observe the favicon response, the second tab actually will not
-  // make any network request since the favicon will be loaded by the cache for
-  // both Places and XUL image. So here, we are going to observe the favicon
-  // response for the third tab which opens with the second first party.
-  let promiseForFaviconResponse = waitOnFaviconResponse(THIRD_PARTY_SITE + TEST_FAVICON_CACHE_URI);
-
-  // Open the tab for the second site.
-  let tabInfoC = yield openTab(TEST_SITE_TWO + TEST_CACHE_PAGE);
-
-  // Wait for the favicon response. In this case, we suppose to catch the
-  // response for the third tab but not the second tab since it will not
-  // go through the network.
-  response = yield promiseForFaviconResponse;
-
-  // Check that the favicon response has came from the network and it has the
-  // correct first party domain.
-  is(response.topic, "http-on-examine-response", "The favicon image should be loaded through network again.");
-  is(response.firstPartyDomain, FIRST_PARTY_TWO, "We should only observe the network response for the second first party.");
-
-  yield BrowserTestUtils.removeTab(tabInfoA.tab);
-  yield BrowserTestUtils.removeTab(tabInfoB.tab);
-  yield BrowserTestUtils.removeTab(tabInfoC.tab);
-});
deleted file mode 100644
--- a/browser/components/originattributes/test/browser/browser_favicon_userContextId.js
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * Bug 1277803 - A test caes for testing favicon loading across different userContextId.
- */
-
-const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
-
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-  "resource://gre/modules/Promise.jsm");
-
-const TEST_SITE = "http://mochi.test:8888";
-
-const TEST_PAGE = TEST_SITE + "/browser/browser/components/originattributes/" +
-                  "test/browser/file_favicon.html";
-const FAVICON_URI = TEST_SITE + "/browser/browser/components/originattributes/" +
-                    "test/browser/file_favicon.png";
-const TEST_THIRD_PARTY_PAGE = "http://example.com/browser/browser/components/" +
-                              "originattributes/test/browser/file_favicon_thirdParty.html";
-
-const USER_CONTEXT_ID_PERSONAL = 1;
-const USER_CONTEXT_ID_WORK     = 2;
-
-let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
-let makeURI = Cu.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
-
-function clearAllImageCaches() {
-  var tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
-                             .getService(SpecialPowers.Ci.imgITools);
-  var imageCache = tools.getImgCacheForDocument(window.document);
-  imageCache.clearCache(true);  // true=chrome
-  imageCache.clearCache(false); // false=content
-}
-
-function FaviconObserver(aUserContextId, aExpectedCookie, aPageURI) {
-  this.reset(aUserContextId, aExpectedCookie, aPageURI);
-}
-
-FaviconObserver.prototype = {
-  observe(aSubject, aTopic, aData) {
-    // Make sure that the topic is 'http-on-modify-request'.
-    if (aTopic === "http-on-modify-request") {
-      // We check the userContextId for the originAttributes of the loading
-      // channel. All requests for the favicon should contain the correct
-      // userContextId. There are two requests for a favicon loading, one
-      // from the Places library and one from the XUL image. The difference
-      // of them is the loading principal. The Places will use the content
-      // principal and the XUL image will use the system principal.
-
-      let httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel);
-      let reqLoadInfo = httpChannel.loadInfo;
-      let loadingPrincipal;
-      let triggeringPrincipal;
-
-      // Make sure this is a favicon request.
-      if (httpChannel.URI.spec !== FAVICON_URI) {
-        return;
-      }
-
-      if (reqLoadInfo) {
-        loadingPrincipal = reqLoadInfo.loadingPrincipal;
-        triggeringPrincipal = reqLoadInfo.triggeringPrincipal;
-      }
-
-      // Check the userContextId.
-      is(reqLoadInfo.originAttributes.userContextId, this._curUserContextId,
-        "The loadInfo has correct userContextId");
-
-      if (loadingPrincipal.equals(systemPrincipal)) {
-        this._faviconReqXUL = true;
-        ok(triggeringPrincipal.equals(this._expectedPrincipal),
-          "The triggeringPrincipal of favicon loading from XUL should be the content principal.");
-      } else {
-        this._faviconReqPlaces = true;
-        ok(loadingPrincipal.equals(this._expectedPrincipal),
-          "The loadingPrincipal of favicon loading from Places should be the content prinicpal");
-      }
-
-      let faviconCookie = httpChannel.getRequestHeader("cookie");
-
-      is(faviconCookie, this._expectedCookie, "The cookie of the favicon loading is correct.");
-    } else {
-      ok(false, "Received unexpected topic: ", aTopic);
-    }
-
-    if (this._faviconReqXUL && this._faviconReqPlaces) {
-      this._faviconLoaded.resolve();
-    }
-  },
-
-  reset(aUserContextId, aExpectedCookie, aPageURI) {
-    this._curUserContextId = aUserContextId;
-    this._expectedCookie = aExpectedCookie;
-    this._expectedPrincipal = Services.scriptSecurityManager
-                                      .createCodebasePrincipal(aPageURI, { userContextId: aUserContextId });
-    this._faviconReqXUL = false;
-    this._faviconReqPlaces = false;
-    this._faviconLoaded = new Promise.defer();
-  },
-
-  get promise() {
-    return this._faviconLoaded.promise;
-  }
-};
-
-function* generateCookies() {
-  // we generate two different cookies for two userContextIds.
-  let cookies = [];
-  cookies.push(Math.random().toString());
-  cookies.push(Math.random().toString());
-
-  // Then, we add cookies into the site for 'personal' and 'work'.
-  let tabInfoA = yield openTabInUserContext(TEST_SITE, USER_CONTEXT_ID_PERSONAL);
-  let tabInfoB = yield openTabInUserContext(TEST_SITE, USER_CONTEXT_ID_WORK);
-
-  yield ContentTask.spawn(tabInfoA.browser, cookies[0], function* (value) {
-    content.document.cookie = value;
-  });
-
-  yield ContentTask.spawn(tabInfoB.browser, cookies[1], function* (value) {
-    content.document.cookie = value;
-  });
-
-  yield BrowserTestUtils.removeTab(tabInfoA.tab);
-  yield BrowserTestUtils.removeTab(tabInfoB.tab);
-
-  return cookies;
-}
-
-function* doTest(aTestPage) {
-  let cookies = yield generateCookies();
-  let pageURI = makeURI(aTestPage);
-
-  // Create the observer object for observing request channels of the personal
-  // container.
-  let observer = new FaviconObserver(USER_CONTEXT_ID_PERSONAL, cookies[0], pageURI);
-
-  Services.obs.addObserver(observer, "http-on-modify-request", false);
-
-  // Open the tab with the personal container.
-  let tabInfo = yield openTabInUserContext(aTestPage, USER_CONTEXT_ID_PERSONAL);
-
-  // Waiting for favicon requests are all made.
-  yield observer.promise;
-  // Close the tab.
-  yield BrowserTestUtils.removeTab(tabInfo.tab);
-
-  // Reset the observer for observing requests for the work container.
-  observer.reset(USER_CONTEXT_ID_WORK, cookies[1], pageURI);
-  tabInfo = yield openTabInUserContext(aTestPage, USER_CONTEXT_ID_WORK);
-
-  // Waiting for favicon requests are all made.
-  yield observer.promise;
-
-  Services.obs.removeObserver(observer, "http-on-modify-request", false);
-
-  yield BrowserTestUtils.removeTab(tabInfo.tab);
-}
-
-add_task(function* setup() {
-  // Make sure userContext is enabled.
-  yield SpecialPowers.pushPrefEnv({"set": [
-      ["privacy.userContext.enabled", true]
-  ]});
-});
-
-// A clean up function to prevent affecting other tests.
-registerCleanupFunction(() => {
-  // Clear all cookies.
-  let cookieMgr = Cc["@mozilla.org/cookiemanager;1"]
-                     .getService(Ci.nsICookieManager);
-  cookieMgr.removeAll();
-
-  // Clear all image caches and network caches.
-  clearAllImageCaches();
-
-  let networkCache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
-                        .getService(Ci.nsICacheStorageService);
-  networkCache.clear();
-});
-
-add_task(function* test_favicon_userContextId() {
-  // Clear all image caches before running the test.
-  clearAllImageCaches();
-
-  yield doTest(TEST_PAGE);
-});
-
-add_task(function* test_thirdPartyFavicon_userContextId() {
-  // Clear all image caches before running the test.
-  clearAllImageCaches();
-
-  yield doTest(TEST_THIRD_PARTY_PAGE);
-});
deleted file mode 100644
--- a/browser/components/originattributes/test/browser/file_favicon.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'>
-    <title>Favicon Test for originAttributes</title>
-    <link rel="icon" type="image/png" href="file_favicon.png" />
-  </head>
-  <body>
-    Favicon!!
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
index 5535363c94df7314765551f65311ec6f98729d8e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/browser/components/originattributes/test/browser/file_favicon.png^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Cache-Control: no-cache
deleted file mode 100644
--- a/browser/components/originattributes/test/browser/file_favicon_cache.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'>
-    <title>Favicon Test for originAttributes</title>
-    <link rel="icon" type="image/png" href="http://mochi.test:8888/browser/browser/components/originattributes/test/browser/file_favicon_cache.png" />
-  </head>
-  <body>
-    Third Party Favicon!!
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
index 5535363c94df7314765551f65311ec6f98729d8e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/browser/components/originattributes/test/browser/file_favicon_thirdParty.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'>
-    <title>Favicon Test for originAttributes</title>
-    <link rel="icon" type="image/png" href="http://mochi.test:8888/browser/browser/components/originattributes/test/browser/file_favicon.png" />
-  </head>
-  <body>
-    Third Party Favicon!!
-  </body>
-</html>
\ No newline at end of file
--- a/browser/components/privatebrowsing/test/browser/browser.ini
+++ b/browser/components/privatebrowsing/test/browser/browser.ini
@@ -10,34 +10,30 @@ support-files =
   browser_privatebrowsing_localStorage_page2.html
   browser_privatebrowsing_placesTitleNoUpdate.html
   browser_privatebrowsing_protocolhandler_page.html
   browser_privatebrowsing_windowtitle_page.html
   head.js
   popup.html
   title.sjs
   empty_file.html
-  file_favicon.html
-  file_favicon.png
-  file_favicon.png^headers^
 
 [browser_privatebrowsing_DownloadLastDirWithCPS.js]
 [browser_privatebrowsing_about.js]
 tags = trackingprotection
 [browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js]
 [browser_privatebrowsing_aboutSessionRestore.js]
 [browser_privatebrowsing_cache.js]
 [browser_privatebrowsing_certexceptionsui.js]
 [browser_privatebrowsing_concurrent.js]
 [browser_privatebrowsing_context_and_chromeFlags.js]
 [browser_privatebrowsing_crh.js]
 [browser_privatebrowsing_downloadLastDir.js]
 [browser_privatebrowsing_downloadLastDir_c.js]
 [browser_privatebrowsing_downloadLastDir_toggle.js]
-[browser_privatebrowsing_favicon.js]
 [browser_privatebrowsing_geoprompt.js]
 [browser_privatebrowsing_lastpbcontextexited.js]
 [browser_privatebrowsing_localStorage.js]
 [browser_privatebrowsing_localStorage_before_after.js]
 [browser_privatebrowsing_noSessionRestoreMenuOption.js]
 [browser_privatebrowsing_nonbrowser.js]
 [browser_privatebrowsing_opendir.js]
 [browser_privatebrowsing_placesTitleNoUpdate.js]
deleted file mode 100644
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_favicon.js
+++ /dev/null
@@ -1,253 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// This test make sure that the favicon of the private browsing is isolated.
-
-const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
-
-const TEST_SITE = "http://mochi.test:8888";
-const TEST_DIRECTORY = "/browser/browser/components/privatebrowsing/test/browser/";
-
-const TEST_PAGE = TEST_SITE + TEST_DIRECTORY + "file_favicon.html";
-const FAVICON_URI = TEST_SITE + TEST_DIRECTORY + "file_favicon.png";
-
-let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
-let makeURI = Cu.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
-
-function clearAllImageCaches() {
-  var tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
-                             .getService(SpecialPowers.Ci.imgITools);
-  var imageCache = tools.getImgCacheForDocument(window.document);
-  imageCache.clearCache(true);  // true=chrome
-  imageCache.clearCache(false); // false=content
-}
-
-function observeFavicon(aIsPrivate, aExpectedCookie, aPageURI) {
-  let faviconReqXUL = false;
-  let faviconReqPlaces = false;
-  let attr = {};
-
-  if (aIsPrivate) {
-    attr.privateBrowsingId = 1;
-  }
-
-  let expectedPrincipal = Services.scriptSecurityManager
-                                  .createCodebasePrincipal(aPageURI, attr);
-
-  return new Promise(resolve => {
-    let observer = {
-      observe(aSubject, aTopic, aData) {
-        // Make sure that the topic is 'http-on-modify-request'.
-        if (aTopic === "http-on-modify-request") {
-          // We check the privateBrowsingId for the originAttributes of the loading
-          // channel. All requests for the favicon should contain the correct
-          // privateBrowsingId. There are two requests for a favicon loading, one
-          // from the Places library and one from the XUL image. The difference
-          // of them is the loading principal. The Places will use the content
-          // principal and the XUL image will use the system principal.
-
-          let httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel);
-          let reqLoadInfo = httpChannel.loadInfo;
-          let loadingPrincipal = reqLoadInfo.loadingPrincipal;
-          let triggeringPrincipal = reqLoadInfo.triggeringPrincipal;
-
-          // Make sure this is a favicon request.
-          if (httpChannel.URI.spec !== FAVICON_URI) {
-            return;
-          }
-
-          // Check the privateBrowsingId.
-          if (aIsPrivate) {
-            is(reqLoadInfo.originAttributes.privateBrowsingId, 1, "The loadInfo has correct privateBrowsingId");
-          } else {
-            is(reqLoadInfo.originAttributes.privateBrowsingId, 0, "The loadInfo has correct privateBrowsingId");
-          }
-
-          if (loadingPrincipal.equals(systemPrincipal)) {
-            faviconReqXUL = true;
-            ok(triggeringPrincipal.equals(expectedPrincipal),
-              "The triggeringPrincipal of favicon loading from XUL should be the content principal.");
-          } else {
-            faviconReqPlaces = true;
-            ok(loadingPrincipal.equals(expectedPrincipal),
-              "The loadingPrincipal of favicon loading from Places should be the content prinicpal");
-          }
-
-          let faviconCookie = httpChannel.getRequestHeader("cookie");
-
-          is(faviconCookie, aExpectedCookie, "The cookie of the favicon loading is correct.");
-        } else {
-          ok(false, "Received unexpected topic: ", aTopic);
-        }
-
-        if (faviconReqXUL && faviconReqPlaces) {
-          resolve();
-          Services.obs.removeObserver(observer, "http-on-modify-request", false);
-        }
-      }
-    };
-
-    Services.obs.addObserver(observer, "http-on-modify-request", false);
-  });
-}
-
-function waitOnFaviconResponse(aFaviconURL) {
-  return new Promise(resolve => {
-    let observer = {
-      observe(aSubject, aTopic, aData) {
-        if (aTopic === "http-on-examine-response" ||
-            aTopic === "http-on-examine-cached-response") {
-
-          let httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel);
-          let loadInfo = httpChannel.loadInfo;
-
-          if (httpChannel.URI.spec !== aFaviconURL) {
-            return;
-          }
-
-          let result = {
-            topic: aTopic,
-            privateBrowsingId: loadInfo.originAttributes.privateBrowsingId
-          };
-
-          resolve(result);
-          Services.obs.removeObserver(observer, "http-on-examine-response", false);
-          Services.obs.removeObserver(observer, "http-on-examine-cached-response", false);
-        }
-      }
-    };
-
-    Services.obs.addObserver(observer, "http-on-examine-response", false);
-    Services.obs.addObserver(observer, "http-on-examine-cached-response", false);
-  });
-}
-
-function* assignCookies(aBrowser, aURL, aCookieValue){
-  let tabInfo = yield openTab(aBrowser, aURL);
-
-  yield ContentTask.spawn(tabInfo.browser, aCookieValue, function* (value) {
-    content.document.cookie = value;
-  });
-
-  yield BrowserTestUtils.removeTab(tabInfo.tab);
-}
-
-function* openTab(aBrowser, aURL) {
-  let tab = aBrowser.addTab(aURL);
-
-  // Select tab and make sure its browser is focused.
-  aBrowser.selectedTab = tab;
-  tab.ownerGlobal.focus();
-
-  let browser = aBrowser.getBrowserForTab(tab);
-  yield BrowserTestUtils.browserLoaded(browser);
-  return {tab, browser};
-}
-
-// A clean up function to prevent affecting other tests.
-registerCleanupFunction(() => {
-  // Clear all cookies.
-  let cookieMgr = Cc["@mozilla.org/cookiemanager;1"]
-                     .getService(Ci.nsICookieManager);
-  cookieMgr.removeAll();
-
-  // Clear all image caches and network caches.
-  clearAllImageCaches();
-
-  let networkCache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
-                        .getService(Ci.nsICacheStorageService);
-  networkCache.clear();
-});
-
-add_task(function* test_favicon_privateBrowsing() {
-  // Clear all image caches before running the test.
-  clearAllImageCaches();
-
-  // Create a private browsing window.
-  let privateWindow = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
-  let pageURI = makeURI(TEST_PAGE);
-
-  // Generate two random cookies for non-private window and private window
-  // respectively.
-  let cookies = [];
-  cookies.push(Math.random().toString());
-  cookies.push(Math.random().toString());
-
-  // Open a tab in non-private window and add a cookie into it.
-  yield assignCookies(gBrowser, TEST_SITE, cookies[0]);
-
-  // Open a tab in private window and add a cookie into it.
-  yield assignCookies(privateWindow.gBrowser, TEST_SITE, cookies[1]);
-
-  // Add the observer earlier in case we don't capture events in time.
-  let promiseObserveFavicon = observeFavicon(false, cookies[0], pageURI);
-
-  // Open a tab for the non-private window.
-  let tabInfo = yield openTab(gBrowser, TEST_PAGE);
-
-  // Waiting until favicon requests are all made.
-  yield promiseObserveFavicon;
-
-  // Close the tab.
-  yield BrowserTestUtils.removeTab(tabInfo.tab);
-
-  // Add the observer earlier in case we don't capture events in time.
-  promiseObserveFavicon = observeFavicon(true, cookies[1], pageURI);
-
-  // Open a tab for the private window.
-  tabInfo = yield openTab(privateWindow.gBrowser, TEST_PAGE);
-
-  // Waiting until favicon requests are all made.
-  yield promiseObserveFavicon;
-
-  yield BrowserTestUtils.removeTab(tabInfo.tab);
-  yield BrowserTestUtils.closeWindow(privateWindow);
-});
-
-add_task(function* test_favicon_cache_privateBrowsing() {
-  // Clear all image cahces and network cache before running the test.
-  clearAllImageCaches();
-
-  let networkCache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
-                        .getService(Ci.nsICacheStorageService);
-  networkCache.clear();
-
-  // Create a private browsing window.
-  let privateWindow = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
-
-  // Open a tab for the private window.
-  let tabInfoPrivateA = yield openTab(privateWindow.gBrowser, TEST_PAGE);
-
-  // Wait for the favicon response of the private tab.
-  let response = yield waitOnFaviconResponse(FAVICON_URI);
-
-  // Make sure the favicon is loaded through the network and its privateBrowsingId is correct.
-  is(response.topic, "http-on-examine-response", "The favicon image should be loaded through the network.");
-  is(response.privateBrowsingId, 1, "We should observe the network response for the private tab.");
-
-  // Open the tab again for checking the favicon is not cached for private tab.
-  let tabInfoPrivateB = yield openTab(privateWindow.gBrowser, TEST_PAGE);
-
-  // Wait for the favicon response of the private tab.
-  response = yield waitOnFaviconResponse(FAVICON_URI);
-
-  // Make sure the favicon is loaded through the network again and its privateBrowsingId is correct.
-  is(response.topic, "http-on-examine-response", "The favicon image should be loaded through the network.");
-  is(response.privateBrowsingId, 1, "We should observe the network response for the private tab.");
-
-  // Open a tab for the non-private window.
-  let tabInfoNonPrivate = yield openTab(gBrowser, TEST_PAGE);
-
-  response = yield waitOnFaviconResponse(FAVICON_URI);
-
-  // Check that the favicon response has come from the network and it has the
-  // correct privateBrowsingId.
-  is(response.topic, "http-on-examine-response", "The favicon image should be loaded through network again.");
-  is(response.privateBrowsingId, 0, "We should observe the network response for the non-private tab.");
-
-  yield BrowserTestUtils.removeTab(tabInfoPrivateA.tab);
-  yield BrowserTestUtils.removeTab(tabInfoPrivateB.tab);
-  yield BrowserTestUtils.removeTab(tabInfoNonPrivate.tab);
-  yield BrowserTestUtils.closeWindow(privateWindow);
-});
deleted file mode 100644
--- a/browser/components/privatebrowsing/test/browser/file_favicon.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-  <head>
-    <meta charset='utf-8'>
-    <title>Favicon Test for originAttributes</title>
-    <link rel="icon" type="image/png" href="file_favicon.png" />
-  </head>
-  <body>
-    Favicon!!
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
index 5535363c94df7314765551f65311ec6f98729d8e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/browser/components/privatebrowsing/test/browser/file_favicon.png^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Cache-Control: no-cache
--- a/dom/base/nsContentPolicyUtils.h
+++ b/dom/base/nsContentPolicyUtils.h
@@ -126,17 +126,16 @@ NS_CP_ContentTypeName(uint32_t contentTy
     CASE_RETURN( TYPE_INTERNAL_VIDEO              );
     CASE_RETURN( TYPE_INTERNAL_TRACK              );
     CASE_RETURN( TYPE_INTERNAL_XMLHTTPREQUEST     );
     CASE_RETURN( TYPE_INTERNAL_EVENTSOURCE        );
     CASE_RETURN( TYPE_INTERNAL_SERVICE_WORKER     );
     CASE_RETURN( TYPE_INTERNAL_SCRIPT_PRELOAD     );
     CASE_RETURN( TYPE_INTERNAL_IMAGE              );
     CASE_RETURN( TYPE_INTERNAL_IMAGE_PRELOAD      );
-    CASE_RETURN( TYPE_INTERNAL_IMAGE_FAVICON      );
     CASE_RETURN( TYPE_INTERNAL_STYLESHEET         );
     CASE_RETURN( TYPE_INTERNAL_STYLESHEET_PRELOAD );
    default:
     return "<Unknown Type>";
   }
 }
 
 #undef CASE_RETURN
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -8412,17 +8412,16 @@ nsContentUtils::InternalContentPolicyTyp
     return nsIContentPolicy::TYPE_MEDIA;
 
   case nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST:
   case nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE:
     return nsIContentPolicy::TYPE_XMLHTTPREQUEST;
 
   case nsIContentPolicy::TYPE_INTERNAL_IMAGE:
   case nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD:
-  case nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON:
     return nsIContentPolicy::TYPE_IMAGE;
 
   case nsIContentPolicy::TYPE_INTERNAL_STYLESHEET:
   case nsIContentPolicy::TYPE_INTERNAL_STYLESHEET_PRELOAD:
     return nsIContentPolicy::TYPE_STYLESHEET;
 
   default:
     return aType;
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -552,17 +552,16 @@ GK_ATOM(listcol, "listcol")
 GK_ATOM(listcols, "listcols")
 GK_ATOM(listener, "listener")
 GK_ATOM(listhead, "listhead")
 GK_ATOM(listheader, "listheader")
 GK_ATOM(listing, "listing")
 GK_ATOM(listitem, "listitem")
 GK_ATOM(listrows, "listrows")
 GK_ATOM(load, "load")
-GK_ATOM(loadingprincipal, "loadingprincipal")
 GK_ATOM(localedir, "localedir")
 GK_ATOM(localName, "local-name")
 GK_ATOM(longdesc, "longdesc")
 GK_ATOM(loop, "loop")
 GK_ATOM(low, "low")
 GK_ATOM(lowerFirst, "lower-first")
 GK_ATOM(lowest, "lowest")
 GK_ATOM(lowsrc, "lowsrc")
--- a/dom/base/nsIContentPolicyBase.idl
+++ b/dom/base/nsIContentPolicyBase.idl
@@ -316,24 +316,16 @@ interface nsIContentPolicyBase : nsISupp
   /**
    * Indicates an internal constant for *preloaded* stylesheets.
    *
    * This will be mapped to TYPE_STYLESHEET before being passed
    * to content policy implementations.
    */
   const nsContentPolicyType TYPE_INTERNAL_STYLESHEET_PRELOAD = 40;
 
-  /**
-   * Indicates an internal constant for favicon.
-   *
-   * This will be mapped to TYPE_IMAGE before being passed
-   * to content policy implementations.
-   */
-  const nsContentPolicyType TYPE_INTERNAL_IMAGE_FAVICON = 41;
-
   /* When adding new content types, please update nsContentBlocker,
    * NS_CP_ContentTypeName, nsCSPContext, all nsIContentPolicy
    * implementations, the static_assert in dom/cache/DBSchema.cpp,
    * and other things that are not listed here that are related to
    * nsIContentPolicy. */
 
   //////////////////////////////////////////////////////////////////////
 
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -287,18 +287,17 @@ static_assert(nsIContentPolicy::TYPE_INV
               nsIContentPolicy::TYPE_INTERNAL_TRACK == 32 &&
               nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST == 33 &&
               nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE == 34 &&
               nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER == 35 &&
               nsIContentPolicy::TYPE_INTERNAL_SCRIPT_PRELOAD == 36 &&
               nsIContentPolicy::TYPE_INTERNAL_IMAGE == 37 &&
               nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD == 38 &&
               nsIContentPolicy::TYPE_INTERNAL_STYLESHEET == 39 &&
-              nsIContentPolicy::TYPE_INTERNAL_STYLESHEET_PRELOAD == 40 &&
-              nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON == 41,
+              nsIContentPolicy::TYPE_INTERNAL_STYLESHEET_PRELOAD == 40,
               "nsContentPolicyType values are as expected");
 
 namespace {
 
 typedef int32_t EntryId;
 
 struct IdCount
 {
--- a/dom/fetch/InternalRequest.cpp
+++ b/dom/fetch/InternalRequest.cpp
@@ -176,17 +176,16 @@ InternalRequest::MapContentPolicyTypeToR
   case nsIContentPolicy::TYPE_INTERNAL_WORKER:
     context = RequestContext::Worker;
     break;
   case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER:
     context = RequestContext::Sharedworker;
     break;
   case nsIContentPolicy::TYPE_INTERNAL_IMAGE:
   case nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD:
-  case nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON:
     context = RequestContext::Image;
     break;
   case nsIContentPolicy::TYPE_INTERNAL_STYLESHEET:
   case nsIContentPolicy::TYPE_INTERNAL_STYLESHEET_PRELOAD:
     context = RequestContext::Style;
     break;
   case nsIContentPolicy::TYPE_INTERNAL_OBJECT:
     context = RequestContext::Object;
--- a/dom/fetch/InternalRequest.h
+++ b/dom/fetch/InternalRequest.h
@@ -40,17 +40,17 @@ namespace dom {
  * eventsource       |
  * favicon           |
  * fetch             | TYPE_FETCH
  * font              | TYPE_FONT
  * form              |
  * frame             | TYPE_INTERNAL_FRAME
  * hyperlink         |
  * iframe            | TYPE_INTERNAL_IFRAME
- * image             | TYPE_INTERNAL_IMAGE, TYPE_INTERNAL_IMAGE_PRELOAD, TYPE_INTERNAL_IMAGE_FAVICON
+ * image             | TYPE_INTERNAL_IMAGE, TYPE_INTERNAL_IMAGE_PRELOAD
  * imageset          | TYPE_IMAGESET
  * import            | Not supported by Gecko
  * internal          | TYPE_DOCUMENT, TYPE_XBL, TYPE_OTHER
  * location          |
  * manifest          | TYPE_WEB_MANIFEST
  * object            | TYPE_INTERNAL_OBJECT
  * ping              | TYPE_PING
  * plugin            | TYPE_OBJECT_SUBREQUEST
--- a/dom/security/nsContentSecurityManager.cpp
+++ b/dom/security/nsContentSecurityManager.cpp
@@ -46,17 +46,16 @@ static bool SchemeIs(nsIURI* aURI, const
 static bool IsImageLoadInEditorAppType(nsILoadInfo* aLoadInfo)
 {
   // Editor apps get special treatment here, editors can load images
   // from anywhere.  This allows editor to insert images from file://
   // into documents that are being edited.
   nsContentPolicyType type = aLoadInfo->InternalContentPolicyType();
   if (type != nsIContentPolicy::TYPE_INTERNAL_IMAGE  &&
       type != nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD &&
-      type != nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON &&
       type != nsIContentPolicy::TYPE_IMAGESET) {
     return false;
   }
 
   uint32_t appType = nsIDocShell::APP_TYPE_UNKNOWN;
   nsINode* node = aLoadInfo->LoadingNode();
   if (!node) {
     return false;
deleted file mode 100644
--- a/dom/security/test/general/bug1277803.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-
-<head>
-  <link rel='icon' href='favicon_bug1277803.ico'>
-</head>
-
-<body>
-Nothing to see here...
-</body>
-
-</html>
deleted file mode 100644
--- a/dom/security/test/general/chrome.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-support-files =
-    favicon_bug1277803.ico
-    bug1277803.html
-
-[test_bug1277803.xul]
-skip-if = os == 'android'
deleted file mode 100644
index d44438903b751f4732f5365783eb0229b0501f9a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/dom/security/test/general/test_bug1277803.xul
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Bug 1277803 test"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        width="600"
-        height="600"
-        onload="runTest();">
-
-  <script type="application/javascript"
-          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-  <body xmlns="http://www.w3.org/1999/xhtml">
-  </body>
-
-  <script type="application/javascript"><![CDATA[
-    SimpleTest.requestCompleteLog();
-    let Ci = Components.interfaces;
-    let Cc = Components.classes;
-    let Cu = Components.utils;
-    let makeURI = Cu.import("resource://gre/modules/BrowserUtils.jsm", {}).BrowserUtils.makeURI;
-
-    const BASE_URI = "http://mochi.test:8888/chrome/dom/security/test/general/";
-    const FAVICON_URI = BASE_URI + "favicon_bug1277803.ico";
-    const LOADING_URI = BASE_URI + "bug1277803.html";
-    let testWindow; //will be used to trigger favicon load
-
-    let securityManager = Cc["@mozilla.org/scriptsecuritymanager;1"].
-                          getService(Ci.nsIScriptSecurityManager);
-    let expectedPrincipal = securityManager.createCodebasePrincipal(makeURI(LOADING_URI), {});
-    let systemPrincipal = Cc["@mozilla.org/systemprincipal;1"].createInstance();
-
-    // We expect 2 favicon loads, one from PlacesUIUtils.loadFavicon and one
-    // from XUL:image loads.
-    let requestXUL = false;
-    let requestPlaces = false;
-
-    function runTest() {
-      // Register our observer to intercept favicon requests.
-      let os = Cc["@mozilla.org/observer-service;1"].
-               getService(Ci.nsIObserverService);
-      let observer = {
-        observe: function(aSubject, aTopic, aData)
-        {
-          // Make sure this is a favicon request.
-          let httpChannel = aSubject.QueryInterface(Ci.nsIHttpChannel);
-          if (FAVICON_URI != httpChannel.URI.spec) {
-            return;
-          }
-
-          // Ensure the topic is the one we set an observer for.
-          is(aTopic, "http-on-modify-request", "Expected observer topic");
-
-          // Check for the correct loadingPrincipal, triggeringPrincipal.
-          let triggeringPrincipal = httpChannel.loadInfo.triggeringPrincipal;
-          let loadingPrincipal = httpChannel.loadInfo.loadingPrincipal;
-
-          if (loadingPrincipal.equals(systemPrincipal)) {
-            // This is the favicon loading from XUL, which will have the system
-            // principal as its loading principal and have a content principal
-            // as its triggering principal.
-            ok(triggeringPrincipal.equals(expectedPrincipal),
-              "Correct triggeringPrincipal for favicon from XUL.");
-            requestXUL = true;
-          } else if (loadingPrincipal.equals(expectedPrincipal)) {
-            // This is the favicon loading from Places, which will have a
-            // content principal as its loading principal and triggering
-            // principal.
-            ok(triggeringPrincipal.equals(expectedPrincipal),
-              "Correct triggeringPrincipal for favicon from Places.");
-            requestPlaces = true;
-          } else {
-            ok(false, "An unexpected favicon request.")
-          }
-
-          // Cleanup after ourselves...
-          if (requestXUL && requestPlaces) {
-            os.removeObserver(this, "http-on-modify-request");
-            SimpleTest.finish();
-          }
-        }
-      }
-      os.addObserver(observer, "http-on-modify-request", false);
-
-      // Now that the observer is set up, trigger a favicon load with navigation
-      testWindow = window.open(LOADING_URI);
-    }
-
-    SimpleTest.waitForExplicitFinish();
-    SimpleTest.registerCleanupFunction(function() {
-      if (testWindow) {
-        testWindow.close();
-      }
-    });
-  ]]></script>
-
-  <browser type="content-primary" flex="1" id="content" src="about:blank"/>
-</window>
--- a/dom/security/test/moz.build
+++ b/dom/security/test/moz.build
@@ -17,16 +17,15 @@ MOCHITEST_MANIFESTS += [
     'csp/mochitest.ini',
     'general/mochitest.ini',
     'mixedcontentblocker/mochitest.ini',
     'sri/mochitest.ini',
 ]
 
 MOCHITEST_CHROME_MANIFESTS += [
     'csp/chrome.ini',
-    'general/chrome.ini',
 ]
 
 BROWSER_CHROME_MANIFESTS += [
     'contentverifier/browser.ini',
     'csp/browser.ini',
     'hsts/browser.ini',
 ]
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -738,38 +738,24 @@ NewImageChannel(nsIChannel** aResult,
                                               aURI,
                                               requestingNode,
                                               aLoadingPrincipal,
                                               securityFlags,
                                               aPolicyType,
                                               nullptr,   // loadGroup
                                               callbacks,
                                               aLoadFlags);
-
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-
-    if (aPolicyType == nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON) {
-      // If this is a favicon loading, we will use the originAttributes from the
-      // loadingPrincipal as the channel's originAttributes. This allows the favicon
-      // loading from XUL will use the correct originAttributes.
-      NeckoOriginAttributes neckoAttrs;
-      neckoAttrs.InheritFromDocToNecko(BasePrincipal::Cast(aLoadingPrincipal)->OriginAttributesRef());
-
-      nsCOMPtr<nsILoadInfo> loadInfo = (*aResult)->GetLoadInfo();
-      rv = loadInfo->SetOriginAttributes(neckoAttrs);
-    }
   } else {
     // either we are loading something inside a document, in which case
     // we should always have a requestingNode, or we are loading something
     // outside a document, in which case the loadingPrincipal and
     // triggeringPrincipal should always be the systemPrincipal.
-    // However, there are exceptions: one is Notifications which create a
-    // channel in the parent prcoess in which case we can't get a requestingNode.
+    // However, there are two exceptions: one is Notifications and the
+    // other one is Favicons which create a channel in the parent prcoess
+    // in which case we can't get a requestingNode.
     rv = NS_NewChannel(aResult,
                        aURI,
                        nsContentUtils::GetSystemPrincipal(),
                        securityFlags,
                        aPolicyType,
                        nullptr,   // loadGroup
                        callbacks,
                        aLoadFlags);
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -43,17 +43,16 @@
 #include "nsIURI.h"
 #include "nsThreadUtils.h"
 #include "nsDisplayList.h"
 #include "ImageLayers.h"
 #include "ImageContainer.h"
 #include "nsIContent.h"
 
 #include "nsContentUtils.h"
-#include "nsSerializationHelper.h"
 
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/Maybe.h"
 
 #define ONLOAD_CALLED_TOO_EARLY 1
 
 using namespace mozilla;
@@ -222,51 +221,27 @@ nsImageBoxFrame::UpdateImage()
 
   // get the new image src
   nsAutoString src;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::src, src);
   mUseSrcAttr = !src.IsEmpty();
   if (mUseSrcAttr) {
     nsIDocument* doc = mContent->GetComposedDoc();
     if (doc) {
-      // Use the serialized loadingPrincipal from the image element. Fall back
-      // to mContent's principal (SystemPrincipal) if not available.
-      nsContentPolicyType contentPolicyType = nsIContentPolicy::TYPE_INTERNAL_IMAGE;
-      nsCOMPtr<nsIPrincipal> loadingPrincipal = mContent->NodePrincipal();
-      nsAutoString imageLoadingPrincipal;
-      mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::loadingprincipal,
-                        imageLoadingPrincipal);
-      if (!imageLoadingPrincipal.IsEmpty()) {
-        nsCOMPtr<nsISupports> serializedPrincipal;
-        NS_DeserializeObject(NS_ConvertUTF16toUTF8(imageLoadingPrincipal),
-                             getter_AddRefs(serializedPrincipal));
-        loadingPrincipal = do_QueryInterface(serializedPrincipal);
-
-        if (loadingPrincipal) {
-          // Set the content policy type to TYPE_INTERNAL_IMAGE_FAVICON for
-          // indicating it's a favicon loading.
-          contentPolicyType = nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON;
-        } else {
-          // Fallback if the deserialization is failed.
-          loadingPrincipal = mContent->NodePrincipal();
-        }
-      }
-
       nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
       nsCOMPtr<nsIURI> uri;
       nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(uri),
                                                 src,
                                                 doc,
                                                 baseURI);
       if (uri) {
-        nsresult rv = nsContentUtils::LoadImage(uri, mContent, doc, loadingPrincipal,
+        nsresult rv = nsContentUtils::LoadImage(uri, mContent, doc, mContent->NodePrincipal(),
                                                 doc->GetDocumentURI(), doc->GetReferrerPolicy(),
                                                 mListener, mLoadFlags,
-                                                EmptyString(), getter_AddRefs(mImageRequest),
-                                                contentPolicyType);
+                                                EmptyString(), getter_AddRefs(mImageRequest));
 
         if (NS_SUCCEEDED(rv) && mImageRequest) {
           nsLayoutUtils::RegisterImageRequestIfAnimated(presContext,
                                                         mImageRequest,
                                                         &mRequestRegistered);
         }
       }
     }
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -2403,28 +2403,16 @@ NS_CompareLoadInfoAndLoadContext(nsIChan
                     spec.EqualsLiteral("about:sync-tabs");
     }
   }
 
   if (isAboutPage) {
     return NS_OK;
   }
 
-  // We skip the favicon loading here. The favicon loading might be
-  // triggered by the XUL image. For that case, the loadContext will have
-  // default originAttributes since the XUL image uses SystemPrincipal, but
-  // the loadInfo will use originAttributes from the content. Thus, the
-  // originAttributes between loadInfo and loadContext will be different.
-  // That's why we have to skip the comparison for the favicon loading.
-  if (nsContentUtils::IsSystemPrincipal(loadInfo->LoadingPrincipal()) &&
-      loadInfo->InternalContentPolicyType() ==
-        nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON) {
-    return NS_OK;
-  }
-
   uint32_t loadContextAppId = 0;
   nsresult rv = loadContext->GetAppId(&loadContextAppId);
   if (NS_FAILED(rv)) {
     return NS_ERROR_UNEXPECTED;
   }
 
   bool loadContextIsInBE = false;
   rv = loadContext->GetIsInIsolatedMozBrowserElement(&loadContextIsInBE);
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -2659,43 +2659,28 @@ HttpBaseChannel::ShouldIntercept(nsIURI*
                                                         &shouldIntercept);
     if (NS_FAILED(rv)) {
       return false;
     }
   }
   return shouldIntercept;
 }
 
-#ifdef DEBUG
-void HttpBaseChannel::AssertPrivateBrowsingId()
+void HttpBaseChannel::CheckPrivateBrowsing()
 {
   nsCOMPtr<nsILoadContext> loadContext;
   NS_QueryNotificationCallbacks(this, loadContext);
   // For addons it's possible that mLoadInfo is null.
-  if (!mLoadInfo) {
-    return;
-  }
-
-  if (!loadContext) {
-    return;
+  if (mLoadInfo && loadContext) {
+      DocShellOriginAttributes docShellAttrs;
+      loadContext->GetOriginAttributes(docShellAttrs);
+      MOZ_ASSERT(mLoadInfo->GetOriginAttributes().mPrivateBrowsingId == docShellAttrs.mPrivateBrowsingId,
+                 "PrivateBrowsingId values are not the same between LoadInfo and LoadContext.");
   }
-
-  // We skip testing of favicon loading here since it could be triggered by XUL image
-  // which uses SystemPrincipal. The SystemPrincpal doesn't have mPrivateBrowsingId.
-  if (nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal()) &&
-      mLoadInfo->InternalContentPolicyType() == nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON) {
-    return;
-  }
-
-  DocShellOriginAttributes docShellAttrs;
-  loadContext->GetOriginAttributes(docShellAttrs);
-  MOZ_ASSERT(mLoadInfo->GetOriginAttributes().mPrivateBrowsingId == docShellAttrs.mPrivateBrowsingId,
-             "PrivateBrowsingId values are not the same between LoadInfo and LoadContext.");
 }
-#endif
 
 //-----------------------------------------------------------------------------
 // nsHttpChannel::nsITraceableChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpBaseChannel::SetNewListener(nsIStreamListener *aListener, nsIStreamListener **_retval)
 {
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -377,20 +377,18 @@ protected:
   nsIPrincipal *GetURIPrincipal();
 
   bool BypassServiceWorker() const;
 
   // Returns true if this channel should intercept the network request and prepare
   // for a possible synthesized response instead.
   bool ShouldIntercept(nsIURI* aURI = nullptr);
 
-#ifdef DEBUG
   // Check if mPrivateBrowsingId matches between LoadInfo and LoadContext.
-  void AssertPrivateBrowsingId();
-#endif
+  void CheckPrivateBrowsing();
 
   friend class PrivateBrowsingChannel<HttpBaseChannel>;
   friend class InterceptFailedOnStop;
 
   nsCOMPtr<nsIURI>                  mURI;
   nsCOMPtr<nsIURI>                  mOriginalURI;
   nsCOMPtr<nsIURI>                  mDocumentURI;
   nsCOMPtr<nsIStreamListener>       mListener;
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -1791,17 +1791,17 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
              mLoadInfo->GetInitialSecurityCheckDone() ||
              (mLoadInfo->GetSecurityMode() == nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
               nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
              "security flags in loadInfo but asyncOpen2() not called");
 
   LOG(("HttpChannelChild::AsyncOpen [this=%p uri=%s]\n", this, mSpec.get()));
 
 #ifdef DEBUG
-  AssertPrivateBrowsingId();
+  CheckPrivateBrowsing();
 #endif
 
   if (mCanceled)
     return mStatus;
 
   NS_ENSURE_TRUE(gNeckoChild != nullptr, NS_ERROR_FAILURE);
   NS_ENSURE_ARG_POINTER(listener);
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -5654,17 +5654,17 @@ nsHttpChannel::AsyncOpen(nsIStreamListen
                 nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
                "security flags in loadInfo but asyncOpen2() not called");
 
     LOG(("nsHttpChannel::AsyncOpen [this=%p]\n", this));
 
     NS_CompareLoadInfoAndLoadContext(this);
 
 #ifdef DEBUG
-    AssertPrivateBrowsingId();
+    CheckPrivateBrowsing();
 #endif
 
     NS_ENSURE_ARG_POINTER(listener);
     NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
     NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
 
     nsresult rv;
 
--- a/toolkit/components/places/FaviconHelpers.cpp
+++ b/toolkit/components/places/FaviconHelpers.cpp
@@ -417,17 +417,17 @@ AsyncFetchAndSetIconForPage::FetchFromNe
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIChannel> channel;
   rv = NS_NewChannel(getter_AddRefs(channel),
                      iconURI,
                      mLoadingPrincipal,
                      nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS |
                      nsILoadInfo::SEC_ALLOW_CHROME |
                      nsILoadInfo::SEC_DISALLOW_SCRIPT,
-                     nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON);
+                     nsIContentPolicy::TYPE_INTERNAL_IMAGE);
 
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIInterfaceRequestor> listenerRequestor =
     do_QueryInterface(reinterpret_cast<nsISupports*>(this));
   NS_ENSURE_STATE(listenerRequestor);
   rv = channel->SetNotificationCallbacks(listenerRequestor);
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel = do_QueryInterface(channel);
--- a/toolkit/components/places/nsFaviconService.cpp
+++ b/toolkit/components/places/nsFaviconService.cpp
@@ -408,17 +408,17 @@ nsFaviconService::ReplaceFaviconDataFrom
 
   nsCOMPtr<nsILoadInfo> loadInfo =
     new mozilla::LoadInfo(loadingPrincipal,
                           nullptr, // aTriggeringPrincipal
                           nullptr, // aLoadingNode
                           nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS |
                           nsILoadInfo::SEC_ALLOW_CHROME |
                           nsILoadInfo::SEC_DISALLOW_SCRIPT,
-                          nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON);
+                          nsIContentPolicy::TYPE_INTERNAL_IMAGE);
 
   nsCOMPtr<nsIChannel> channel;
   rv = protocolHandler->NewChannel2(dataURI, loadInfo, getter_AddRefs(channel));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Blocking stream is OK for data URIs.
   nsCOMPtr<nsIInputStream> stream;
   rv = channel->Open2(getter_AddRefs(stream));
--- a/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js
+++ b/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js
@@ -28,17 +28,17 @@ function test() {
       aWin.close();
     });
   });
 
   function getIconFile(aCallback) {
     NetUtil.asyncFetch({
       uri: favIconLocation,
       loadUsingSystemPrincipal: true,
-      contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
+      contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
     }, function(inputStream, status) {
         if (!Components.isSuccessCode(status)) {
           ok(false, "Could not get the icon file");
           // Handle error.
           return;
         }
 
         // Check the returned size versus the expected size.
--- a/toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
+++ b/toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
@@ -57,39 +57,39 @@ function run_test()
            getService(Ci.nsIFaviconService);
   let ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
 
   // Test that the default icon has the content type of image/png.
   let channel = NetUtil.newChannel({
     uri: fs.defaultFavicon,
     loadUsingSystemPrincipal: true,
-    contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
+    contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
   });
   channel.asyncOpen2(new streamListener("image/png"));
   do_test_pending();
 
   // Test URI that we don't know anything about.  Will end up being the default
   // icon, so expect image/png.
   channel = NetUtil.newChannel({
     uri: moz_anno_favicon_prefix + "http://mozilla.org",
     loadUsingSystemPrincipal: true,
-    contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
+    contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
   });
   channel.asyncOpen2(new streamListener("image/png"));
   do_test_pending();
 
   // Test that the content type of a favicon we add ends up being image/png.
   let testURI = uri("http://mozilla.org/");
   // Add the data before opening
   fs.replaceFaviconDataFromDataURL(testURI, testFaviconData,
                                    (Date.now() + 60 * 60 * 24 * 1000) * 1000,
                                    Services.scriptSecurityManager.getSystemPrincipal());
 
   // Open the channel
   channel = NetUtil.newChannel({
     uri: moz_anno_favicon_prefix + testURI.spec,
     loadUsingSystemPrincipal: true,
-    contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
+    contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
   });
   channel.asyncOpen2(new streamListener("image/png"));
   do_test_pending();
 }
--- a/toolkit/components/places/tests/favicons/test_page-icon_protocol.js
+++ b/toolkit/components/places/tests/favicons/test_page-icon_protocol.js
@@ -2,17 +2,17 @@ const ICON_DATA = "data:image/png;base64
 const TEST_URI = NetUtil.newURI("http://mozilla.org/");
 const ICON_URI = NetUtil.newURI("http://mozilla.org/favicon.ico");
 
 function fetchIconForSpec(spec) {
  return new Promise((resolve, reject) => {
     NetUtil.asyncFetch({
       uri: NetUtil.newURI("page-icon:" + TEST_URI.spec),
       loadUsingSystemPrincipal: true,
-      contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
+      contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
     }, (input, status, request) => {
        if (!Components.isSuccessCode(status)) {
         reject(new Error("unable to load icon"));
         return;
       }
 
       try {
         let data = NetUtil.readInputStreamToString(input, input.available());