Bug 1053434 - Don't assume default values for prefs in browser_devedition.js;r=Gijs
authorBrian Grinstead <bgrinstead@mozilla.com>
Sat, 11 Oct 2014 18:37:01 -0500
changeset 233200 d18f4f55dd4e5e845a0ae6d6a22b4dc2bdd7f84a
parent 233199 bdba65a0ead7241c34a19fd6fb44d518755cb8f9
child 233201 0738005d0ff59a328a32a6d0ac181884e9d96e0e
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1053434
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1053434 - Don't assume default values for prefs in browser_devedition.js;r=Gijs
browser/base/content/test/general/browser_devedition.js
--- 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.");