Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: tsan OR http3 OR http2
- Manifest: devtools/client/performance-new/test/browser/browser.toml
/* 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
"use strict";
const FRONTEND_URL =
"https://example.com/browser/devtools/client/performance-new/test/browser/webchannel-favicons.html";
const TEST_FAVICON =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFAP//GVwvJQAAAA5JREFUeJxjZGBgJAUBAAHIABFDZFrTAAAAAElFTkSuQmCC";
ChromeUtils.defineESModuleGetters(this, {
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
});
add_setup(() => {
registerCleanupFunction(async () => {
PlacesUtils.favicons.expireAllFavicons();
await PlacesUtils.history.clear();
});
});
add_task(async function test() {
info("Test the WebChannel mechanism works for getting the page favicon data");
await PlacesTestUtils.addVisits(PAGE_URL);
await PlacesUtils.favicons.setFaviconForPage(
Services.io.newURI(PAGE_URL),
Services.io.newURI(FAVICON_URL),
Services.io.newURI(TEST_FAVICON)
);
await BrowserTestUtils.withNewTab(
{
gBrowser,
url: FRONTEND_URL,
},
async () => {
await waitForTabTitle("Favicons received");
ok(true, "The favicons are successfully retrieved by the WebChannel.");
}
);
});