Bug 718255 - Merge nsIPrefBranch2 with nsIPrefBranch - Part F, remove uses of nsIPrefBranch2 in testing/ and layout/tools/reftest/ ; r=bsmedberg
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 17 Jan 2012 15:01:25 +1300
changeset 86761 fc98d884f0f09c7e15849a7ad975b4c86610ec55
parent 86760 07800b5b4d838d1b7581bb78afeb8cd207ab3626
child 86762 04ac18d14436ffa2769ae560fb82203cf0d0861f
push id6022
push usergeoff@darktrojan.net
push dateMon, 13 Feb 2012 23:44:11 +0000
treeherdermozilla-inbound@04ac18d14436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs718255
milestone13.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 718255 - Merge nsIPrefBranch2 with nsIPrefBranch - Part F, remove uses of nsIPrefBranch2 in testing/ and layout/tools/reftest/ ; r=bsmedberg
layout/tools/reftest/reftest.js
testing/mochitest/tests/SimpleTest/SpecialPowersObserverAPI.js
testing/mochitest/tests/SimpleTest/specialpowersAPI.js
--- a/layout/tools/reftest/reftest.js
+++ b/layout/tools/reftest/reftest.js
@@ -239,17 +239,17 @@ function OnRefTestLoad(win)
                     .get("ProfD", CI.nsIFile);
     gCrashDumpDir.append("minidumps");
     
     var env = CC["@mozilla.org/process/environment;1"].
               getService(CI.nsIEnvironment);
     gVerbose = !!env.get("MOZ_REFTEST_VERBOSE");
 
     var prefs = Components.classes["@mozilla.org/preferences-service;1"].
-                getService(Components.interfaces.nsIPrefBranch2);
+                getService(Components.interfaces.nsIPrefBranch);
     try {
         gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote");
     } catch (e) {
         gBrowserIsRemote = false;
     }
     
     if (win === undefined || win == null) {
       win = window;
@@ -283,17 +283,17 @@ function OnRefTestLoad(win)
     RegisterMessageListenersAndLoadContentScript();
 }
 
 function InitAndStartRefTests()
 {
     /* These prefs are optional, so we don't need to spit an error to the log */
     try {
         var prefs = Components.classes["@mozilla.org/preferences-service;1"].
-                    getService(Components.interfaces.nsIPrefBranch2);
+                    getService(Components.interfaces.nsIPrefBranch);
     } catch(e) {
         gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | EXCEPTION: " + e + "\n");
     }
     
     /* set the gLoadTimeout */
     try {
         gLoadTimeout = prefs.getIntPref("reftest.timeout");
     } catch(e) { 
@@ -396,17 +396,17 @@ function StartHTTPServer()
 }
 
 function StartTests()
 {
 #if BOOTSTRAP
     /* These prefs are optional, so we don't need to spit an error to the log */
     try {
         var prefs = Components.classes["@mozilla.org/preferences-service;1"].
-                    getService(Components.interfaces.nsIPrefBranch2);
+                    getService(Components.interfaces.nsIPrefBranch);
     } catch(e) {
         gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | EXCEPTION: " + e + "\n");
     }
     
     try {
         gNoCanvasCache = prefs.getIntPref("reftest.nocache");
     } catch(e) { 
         gNoCanvasCache = false;
@@ -558,17 +558,17 @@ function BuildConditionSandbox(aURL) {
     // Set a flag on sandbox if the windows default theme is active
     var box = gContainingWindow.document.createElement("box");
     box.setAttribute("id", "_box_windowsDefaultTheme");
     gContainingWindow.document.documentElement.appendChild(box);
     sandbox.windowsDefaultTheme = (gContainingWindow.getComputedStyle(box, null).display == "none");
     gContainingWindow.document.documentElement.removeChild(box);
 
     var prefs = CC["@mozilla.org/preferences-service;1"].
-                getService(CI.nsIPrefBranch2);
+                getService(CI.nsIPrefBranch);
     try {
         sandbox.nativeThemePref = !prefs.getBoolPref("mozilla.widget.disable-native-theme");
     } catch (e) {
         sandbox.nativeThemePref = true;
     }
 
     sandbox.prefs = {
         __exposedProps__: {
@@ -1031,17 +1031,17 @@ function StartCurrentTest()
             gDumpLog("REFTEST TEST-KNOWN-FAIL | " + test.url1.spec + " | (SKIPPED; COULDN'T GET FOCUS)\n");
             gURLs.shift();
         } else if (test.slow && !gRunSlowTests) {
             ++gTestResults.Slow;
             gDumpLog("REFTEST TEST-KNOWN-SLOW | " + test.url1.spec + " | (SLOW)\n");
             gURLs.shift();
         } else if (gURLs[0].prefSettings.length > 0) {
             var prefs = Components.classes["@mozilla.org/preferences-service;1"].
-                        getService(Components.interfaces.nsIPrefBranch2);
+                        getService(Components.interfaces.nsIPrefBranch);
             var badPref = undefined;
             try {
                 gURLs[0].prefSettings.forEach(function(ps) {
                     var oldVal;
                     if (ps.type == PREF_BOOLEAN) {
                         try {
                             oldVal = prefs.getBoolPref(ps.name);
                         } catch (e) {
@@ -1607,17 +1607,17 @@ function ResetRenderingState()
     SendResetRenderingState();
     // We would want to clear any viewconfig here, if we add support for it
 }
 
 function RestoreChangedPreferences()
 {
     if (gPrefsToRestore.length > 0) {
         var prefs = Components.classes["@mozilla.org/preferences-service;1"].
-                    getService(Components.interfaces.nsIPrefBranch2);
+                    getService(Components.interfaces.nsIPrefBranch);
         gPrefsToRestore.forEach(function(ps) {
             var value = ps.value;
             if (ps.type == PREF_BOOLEAN) {
                 prefs.setBoolPref(ps.name, value);
             } else if (ps.type == PREF_STRING) {
                 prefs.setCharPref(ps.name, value);
                 value = '"' + value + '"';
             } else if (ps.type == PREF_INTEGER) {
--- a/testing/mochitest/tests/SimpleTest/SpecialPowersObserverAPI.js
+++ b/testing/mochitest/tests/SimpleTest/SpecialPowersObserverAPI.js
@@ -130,17 +130,17 @@ SpecialPowersObserverAPI.prototype = {
   /**
    * messageManager callback function
    * This will get requests from our API in the window and process them in chrome for it
    **/
   _receiveMessageAPI: function(aMessage) {
     switch(aMessage.name) {
       case "SPPrefService":
         var prefs = Components.classes["@mozilla.org/preferences-service;1"].
-                    getService(Components.interfaces.nsIPrefBranch2);
+                    getService(Components.interfaces.nsIPrefBranch);
         var prefType = aMessage.json.prefType.toUpperCase();
         var prefName = aMessage.json.prefName;
         var prefValue = "prefValue" in aMessage.json ? aMessage.json.prefValue : null;
 
         if (aMessage.json.op == "get") {
           if (!prefName || !prefType)
             throw new SpecialPowersException("Invalid parameters for get in SPPrefService");
         } else if (aMessage.json.op == "set") {
--- a/testing/mochitest/tests/SimpleTest/specialpowersAPI.js
+++ b/testing/mochitest/tests/SimpleTest/specialpowersAPI.js
@@ -116,17 +116,17 @@ Observer.prototype = {
         content.window.setTimeout(this._sp._finishPrefEnv, 0);
       }
     }
   },
 
   cleanup: function() {
     if (this._isPref) {
       var os = Cc["@mozilla.org/preferences-service;1"].getService()
-               .QueryInterface(Ci.nsIPrefBranch2);
+               .QueryInterface(Ci.nsIPrefBranch);
       os.removeObserver(this._topic, this);
     } else {
       var os = Cc["@mozilla.org/observer-service;1"]
               .getService(Ci.nsIObserverService)
               .QueryInterface(Ci.nsIObserverService);
       os.removeObserver(this, this._topic);
     }
   },
@@ -620,17 +620,17 @@ SpecialPowersAPI.prototype = {
     }
   },
 
   _addObserver: function(aTopic, aCallback, aIsPref) {
     var observer = new Observer(this, aTopic, aCallback, aIsPref);
 
     if (aIsPref) {
       var os = Cc["@mozilla.org/preferences-service;1"].getService()
-               .QueryInterface(Ci.nsIPrefBranch2);	
+               .QueryInterface(Ci.nsIPrefBranch);	
       os.addObserver(aTopic, observer, false);
     } else {
       var os = Cc["@mozilla.org/observer-service;1"]
               .getService(Ci.nsIObserverService)
               .QueryInterface(Ci.nsIObserverService);
       os.addObserver(observer, aTopic, false);
     }
   },