fune/netwerk/test/browser/browser_test_favicon.js
Victor Porof 2c53a5dcd9 Bug 1561435 - Format netwerk/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : afa5bd771feba466ba7670c58f3d93233a14e202
2019-07-05 10:55:23 +02:00

26 lines
885 B
JavaScript

// Tests third party cookie blocking using a favicon loaded from a different
// domain. The cookie should be considered third party.
add_task(async function() {
const iconUrl =
"http://example.org/browser/netwerk/test/browser/damonbowling.jpg";
const pageUrl =
"http://example.com/browser/netwerk/test/browser/file_favicon.html";
await SpecialPowers.pushPrefEnv({
set: [["network.cookie.cookieBehavior", 1]],
});
let promise = TestUtils.topicObserved("cookie-rejected", subject => {
let uri = subject.QueryInterface(Ci.nsIURI);
return uri.spec == iconUrl;
});
// Kick off a page load that will load the favicon.
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
registerCleanupFunction(async function() {
BrowserTestUtils.removeTab(tab);
});
await promise;
ok(true, "foreign favicon cookie was blocked");
});