Bug 1484753: Loading an insecure favicon should make the page show as mixed content. r=johannh

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

--HG--
extra : rebase_source : 5ee794a7079a8b7c42df18f8a7638344bb00dece
This commit is contained in:
Dave Townsend 2018-08-21 10:40:42 -07:00
parent 204fe23163
commit aaea0203ca
3 changed files with 32 additions and 0 deletions

View File

@ -51,3 +51,7 @@ support-files =
[browser_rooticon.js]
support-files =
blank.html
[browser_mixed_content.js]
support-files =
file_insecure_favicon.html
file_favicon.png

View File

@ -0,0 +1,17 @@
add_task(async () => {
const testPath = "https://example.com/browser/browser/base/content/test/favicons/file_insecure_favicon.html";
const expectedIcon = "http://example.com/browser/browser/base/content/test/favicons/file_favicon.png";
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 icon.");
ok(gIdentityHandler._isMixedPassiveContentLoaded, "Should have seen mixed content.");
BrowserTestUtils.removeTab(tab);
});

View File

@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'>
<title>Favicon Test for mixed content</title>
<link rel="icon" type="image/png" href="http://example.com/browser/browser/base/content/test/favicons/file_favicon.png" />
</head>
<body>
Favicon!!
</body>
</html>