Bug 1167229 - Make nsBrowserGlue instantiations use nsISupports and nsIObserver where nsIBrowserGlue is not needed. r=mak
authorMuhsin A. Steiman <ma.steiman@gmail.com>
Thu, 04 Jun 2015 10:11:00 -0400
changeset 278204 d538a04610e29aa733632937dfdd1bc5895a9ef1
parent 278203 33cc16699f798e001d31fa94c6adde9a74e6878e
child 278205 970330c5d6f3b4caa9c0be0a2d3b470b33329bb0
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1167229
milestone41.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 1167229 - Make nsBrowserGlue instantiations use nsISupports and nsIObserver where nsIBrowserGlue is not needed. r=mak
browser/components/places/tests/unit/test_421483.js
browser/components/places/tests/unit/test_browserGlue_bookmarkshtml.js
browser/components/places/tests/unit/test_browserGlue_corrupt.js
browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js
browser/components/places/tests/unit/test_browserGlue_restore.js
browser/components/test/browser_bug538331.js
--- a/browser/components/places/tests/unit/test_421483.js
+++ b/browser/components/places/tests/unit/test_421483.js
@@ -3,18 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 const SMART_BOOKMARKS_PREF = "browser.places.smartBookmarksVersion";
 
 let gluesvc = Cc["@mozilla.org/browser/browserglue;1"].
-                getService(Ci.nsIBrowserGlue).
-                QueryInterface(Ci.nsIObserver);
+                getService(Ci.nsIObserver);
 // Avoid default bookmarks import.
 gluesvc.observe(null, "initial-migration-will-import-default-bookmarks", "");
 
 function run_test() {
   run_next_test();
 }
 
 add_task(function* smart_bookmarks_disabled() {
--- a/browser/components/places/tests/unit/test_browserGlue_bookmarkshtml.js
+++ b/browser/components/places/tests/unit/test_browserGlue_bookmarkshtml.js
@@ -15,17 +15,17 @@ function run_test() {
 
 add_task(function* () {
   remove_bookmarks_html();
 
   Services.prefs.setBoolPref("browser.bookmarks.autoExportHTML", true);
   do_register_cleanup(() => Services.prefs.clearUserPref("browser.bookmarks.autoExportHTML"));
 
   // Initialize nsBrowserGlue before Places.
-  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
+  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsISupports);
 
   // Initialize Places through the History Service.
   Cc["@mozilla.org/browser/nav-history-service;1"]
     .getService(Ci.nsINavHistoryService);
 
   Services.obs.addObserver(function observer() {
     Services.obs.removeObserver(observer, "profile-before-change");
     check_bookmarks_html();
--- a/browser/components/places/tests/unit/test_browserGlue_corrupt.js
+++ b/browser/components/places/tests/unit/test_browserGlue_corrupt.js
@@ -27,17 +27,17 @@ do_register_cleanup(function () {
   return PlacesUtils.bookmarks.eraseEverything();
 });
 
 add_task(function* test_main() {
   // Create a corrupt database.
   yield createCorruptDB();
 
   // Initialize nsBrowserGlue before Places.
-  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
+  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsISupports);
 
   // Check the database was corrupt.
   // nsBrowserGlue uses databaseStatus to manage initialization.
   Assert.equal(PlacesUtils.history.databaseStatus,
                PlacesUtils.history.DATABASE_STATUS_CORRUPT);
 
   // The test will continue once restore has finished and smart bookmarks
   // have been created.
--- a/browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
+++ b/browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup.js
@@ -21,17 +21,17 @@ function run_test() {
 
 do_register_cleanup(remove_bookmarks_html);
 
 add_task(function* () {
   // Create a corrupt database.
   yield createCorruptDB();
 
   // Initialize nsBrowserGlue before Places.
-  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
+  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsISupports);
 
   // Check the database was corrupt.
   // nsBrowserGlue uses databaseStatus to manage initialization.
   Assert.equal(PlacesUtils.history.databaseStatus,
                PlacesUtils.history.DATABASE_STATUS_CORRUPT);
 
   // The test will continue once import has finished and smart bookmarks
   // have been created.
--- a/browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js
+++ b/browser/components/places/tests/unit/test_browserGlue_corrupt_nobackup_default.js
@@ -19,17 +19,17 @@ function run_test() {
   run_next_test();
 }
 
 add_task(function* () {
   // Create a corrupt database.
   yield createCorruptDB();
 
   // Initialize nsBrowserGlue before Places.
-  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
+  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsISupports);
 
   // Check the database was corrupt.
   // nsBrowserGlue uses databaseStatus to manage initialization.
   Assert.equal(PlacesUtils.history.databaseStatus,
                PlacesUtils.history.DATABASE_STATUS_CORRUPT);
 
   // The test will continue once import has finished and smart bookmarks
   // have been created.
--- a/browser/components/places/tests/unit/test_browserGlue_restore.js
+++ b/browser/components/places/tests/unit/test_browserGlue_restore.js
@@ -27,17 +27,17 @@ function run_test() {
 do_register_cleanup(function () {
   remove_bookmarks_html();
   remove_all_JSON_backups();
   return PlacesUtils.bookmarks.eraseEverything();
 });
 
 add_task(function* test_main() {
   // Initialize nsBrowserGlue before Places.
-  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIBrowserGlue);
+  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsISupports);
 
   // Initialize Places through the History Service.
   let hs = Cc["@mozilla.org/browser/nav-history-service;1"].
            getService(Ci.nsINavHistoryService);
 
   // Check a new database has been created.
   // nsBrowserGlue uses databaseStatus to manage initialization.
   Assert.equal(hs.databaseStatus, hs.DATABASE_STATUS_CREATE);
--- a/browser/components/test/browser_bug538331.js
+++ b/browser/components/test/browser_bug538331.js
@@ -105,18 +105,17 @@ const BCH_TESTS = [
 ];
 
 var gOriginalMStone;
 var gOriginalOverrideURL;
 
 this.__defineGetter__("gBG", function() {
   delete this.gBG;
   return this.gBG = Cc["@mozilla.org/browser/browserglue;1"].
-                    getService(Ci.nsIBrowserGlue).
-                    QueryInterface(Ci.nsIObserver);
+                    getService(Ci.nsIObserver);
 });
 
 function test()
 {
   waitForExplicitFinish();
 
   // Reset the startup page pref since it may have been set by other tests
   // and we will assume it is default.