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 OR tsan
- Manifest: browser/components/preferences/tests/browser.toml
/*
* This file contains tests for the Preferences search bar.
*/
/**
* Test for searching for the "Set Home Page" subdialog.
*/
add_task(async function () {
// Set custom URL so bookmark button will be shown on the page (otherwise it is hidden)
await SpecialPowers.pushPrefEnv({
set: [
["browser.startup.homepage", "about:robots"],
["browser.startup.page", 1],
],
});
await openPreferencesViaOpenPreferencesAPI("paneHome", { leaveOpen: true });
// Wait for Activity Stream to add its panels
await BrowserTestUtils.waitForCondition(() =>
SpecialPowers.spawn(
gBrowser.selectedTab.linkedBrowser,
[],
() => !!content.document.getElementById("homeContentsGroup")
)
);
await evaluateSearchResults("Set Home Page", "homepageGroup");
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
/**
* Test for searching for the "Languages" subdialog.
*/
add_task(async function () {
await openPreferencesViaOpenPreferencesAPI("paneGeneral", {
leaveOpen: true,
});
await evaluateSearchResults("Choose languages", "languagesGroup");
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});