From e8e2d952cd90a1b2d22e484234a7ed67ed5ac5bb Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Tue, 25 Jul 2023 13:00:37 +1200 Subject: [PATCH] Bug 1844609 - Stop browser_linkHandler.js attempting to contact an outside server. r=freaktechnik I'm not sure why upgrading a request from http://example.org:8000/favicon.ico to https://example.org:8000/favicon.ico triggers the external load assertion (surely it resolves to the same place regardless of the request type) but it does. Differential Revision: https://phabricator.services.mozilla.com/D184540 --HG-- extra : rebase_source : 6c4377874cb98556648634f90dd4f8a77d381326 extra : amend_source : d35770417ef98b28ff87354b6862b62d90e5ece6 --- mail/base/test/browser/browser_linkHandler.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mail/base/test/browser/browser_linkHandler.js b/mail/base/test/browser/browser_linkHandler.js index 38cb8e5b05..1bcbf8f7ac 100644 --- a/mail/base/test/browser/browser_linkHandler.js +++ b/mail/base/test/browser/browser_linkHandler.js @@ -128,6 +128,14 @@ let mockExternalProtocolServiceCID = MockRegistrar.register( mockExternalProtocolService ); +// This test deliberately loads content from http:// URLs. For some reason +// upgrading the icon URL to https:// causes it to attempt loading from an +// external server and this makes the test crash. +Services.prefs.setBoolPref( + "security.mixed_content.upgrade_display_content", + false +); + registerCleanupFunction(() => { let tabmail = document.getElementById("tabmail"); Assert.equal(tabmail.tabInfo.length, 1); @@ -137,6 +145,10 @@ registerCleanupFunction(() => { } MockRegistrar.unregister(mockExternalProtocolServiceCID); + + Services.prefs.clearUserPref( + "security.mixed_content.upgrade_display_content" + ); }); async function clickOnLink(