Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'linux' && os_version == '18.04' && asan OR os == 'linux' && os_version == '18.04' && tsan OR win11_2009 && asan
- Manifest: browser/components/preferences/tests/browser.toml
function whenMainPaneLoadedFinished() {
return new Promise(function (resolve) {
const topic = "main-pane-loaded";
Services.obs.addObserver(function observer() {
Services.obs.removeObserver(observer, topic);
resolve();
}, topic);
});
}
// Temporary test for an experimental new localization API.
add_task(async function () {
// The string is used only when `browserTabsRemoteAutostart` is true
if (!Services.appinfo.browserTabsRemoteAutostart) {
ok(true, "fake test to avoid harness complaining");
return;
}
await Promise.all([
openPreferencesViaOpenPreferencesAPI("general", { leaveOpen: true }),
whenMainPaneLoadedFinished(),
]);
let doc = gBrowser.contentDocument;
await doc.l10n.ready;
let [msg] = await doc.l10n.formatMessages([{ id: "category-general" }]);
let elem = doc.querySelector(`#category-general`);
Assert.deepEqual(msg, {
value: null,
attributes: [
{ name: "tooltiptext", value: elem.getAttribute("tooltiptext") },
],
});
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});