Bug 1053434 - Don't assume default values for prefs in browser_devedition.js;r=Gijs
--- a/browser/base/content/test/general/browser_devedition.js
+++ b/browser/base/content/test/general/browser_devedition.js
@@ -19,17 +19,19 @@ registerCleanupFunction(() => {
});
function test() {
waitForExplicitFinish();
startTests();
}
function startTests() {
- ok (!DevEdition.styleSheet, "There is no devedition style sheet by default.");
+ info ("Setting browser.devedition.theme.enabled to false.");
+ Services.prefs.setBoolPref(PREF_DEVEDITION_THEME, false);
+ ok (!DevEdition.styleSheet, "There is no devedition style sheet when the pref is false.");
info ("Setting browser.devedition.theme.enabled to true.");
Services.prefs.setBoolPref(PREF_DEVEDITION_THEME, true);
ok (DevEdition.styleSheet, "There is a devedition stylesheet when no themes are applied and pref is set.");
info ("Adding a lightweight theme.");
Services.prefs.setBoolPref(PREF_LWTHEME, true);
ok (!DevEdition.styleSheet, "The devedition stylesheet has been removed when a lightweight theme is applied.");
@@ -48,16 +50,17 @@ function startTests() {
Services.prefs.clearUserPref(PREF_THEME);
ok (DevEdition.styleSheet, "The devedition stylesheet is still here when a complete theme is removed.");
info ("Setting browser.devedition.theme.enabled to false.");
Services.prefs.setBoolPref(PREF_DEVEDITION_THEME, false);
ok (!DevEdition.styleSheet, "The devedition stylesheet has been removed.");
info ("Checking :root attributes based on devtools theme.");
+ Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
is (document.documentElement.getAttribute("devtoolstheme"), "light",
"The documentElement has an attribute based on devtools theme.");
Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "dark");
is (document.documentElement.getAttribute("devtoolstheme"), "dark",
"The documentElement has an attribute based on devtools theme.");
Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
is (document.documentElement.getAttribute("devtoolstheme"), "light",
"The documentElement has an attribute based on devtools theme.");