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
/* Any copyright is dedicated to the Public Domain.
"use strict";
add_task(async function default_homepage_test() {
await SpecialPowers.pushPrefEnv({
set: [["browser.startup.page", 1]],
});
let defaults = Services.prefs.getDefaultBranch("");
// Simulate a homepage set via policy or a distribution.
await openPreferencesViaOpenPreferencesAPI("paneHome", { leaveOpen: true });
let doc = gBrowser.contentDocument;
let homeMode = doc.getElementById("homeMode");
Assert.equal(homeMode.value, 2, "homeMode should be 2 (Custom URL)");
let homePageUrl = doc.getElementById("homePageUrl");
Assert.equal(
homePageUrl.value,
"homePageUrl should be example.com"
);
registerCleanupFunction(async () => {
defaults.setStringPref("browser.startup.homepage", "about:home");
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
});