Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
/* Any copyright is dedicated to the Public Domain.
"use strict";
registerCleanupFunction(function restore_pref_values() {
// These two prefs are set as user prefs in case the "Locked"
// option from this policy was not used. In this case, it won't
// be tracked nor restored by the PoliciesPrefTracker.
Services.prefs.clearUserPref("browser.startup.homepage");
});
add_task(async function homepage_test_simple() {
await setupPolicyEngineWithJson({
},
});
});
add_task(async function homepage_test_repeat_same_policy_value() {
// Simulate homepage change after policy applied
Services.prefs.setStringPref(
"browser.startup.homepage",
);
Services.prefs.setIntPref("browser.startup.page", 3);
// Policy should have no effect. Homepage has not been locked and policy value
// has not changed. We should be respecting the homepage that the user gave.
await setupPolicyEngineWithJson({
},
});
await check_homepage({
expectedPageVal: 3,
});
Services.prefs.clearUserPref("browser.startup.page");
Services.prefs.clearUserPref("browser.startup.homepage");
});
add_task(async function homepage_test_empty_additional() {
await setupPolicyEngineWithJson({
},
});
});
add_task(async function homepage_test_single_additional() {
await setupPolicyEngineWithJson({
},
});
await check_homepage({
});
});
add_task(async function homepage_test_multiple_additional() {
await setupPolicyEngineWithJson({
policies: {
Homepage: {
},
},
});
await check_homepage({
expectedURL:
});
});
add_task(async function homepage_test_locked() {
await setupPolicyEngineWithJson({
policies: {
Homepage: {
Locked: true,
},
},
});
await check_homepage({
expectedURL:
locked: true,
});
});
add_task(async function homepage_test_anchor_link() {
await setupPolicyEngineWithJson({
},
});
});