Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

/* Any copyright is dedicated to the Public Domain.
"use strict";
const TEST_ROOT =
const TEST_URL = TEST_ROOT + "file_favicon_change.html";
add_task(async function () {
let extraTab = (gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser));
let haveChanged = waitForFavicon(
extraTab.linkedBrowser,
TEST_ROOT + "file_bug970276_favicon1.ico"
);
BrowserTestUtils.startLoadingURIString(extraTab.linkedBrowser, TEST_URL);
await BrowserTestUtils.browserLoaded(extraTab.linkedBrowser);
await haveChanged;
haveChanged = waitForFavicon(extraTab.linkedBrowser, TEST_ROOT + "moz.png");
SpecialPowers.spawn(extraTab.linkedBrowser, [], function () {
let ev = new content.CustomEvent("PleaseChangeFavicon", {});
content.dispatchEvent(ev);
});
await haveChanged;
ok(true, "Saw all the icons we expected.");
gBrowser.removeTab(extraTab);
});