Bug 1204983 - Deprecate NewTabURL and forward calls to AboutNewTabService (r=florian,olivier)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Tue, 20 Oct 2015 18:51:25 -0700
changeset 303894 bf0ce9ac5997bbee33fd8a8e2d24d990986063c7
parent 303893 11e0112b3dec3dc44ad0e82dec63e187df0e56ee
child 303895 41bfa6144994a773f86404061a58d6dd1fde2e79
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, olivier
bugs1204983
milestone44.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 1204983 - Deprecate NewTabURL and forward calls to AboutNewTabService (r=florian,olivier)
browser/base/content/tabbrowser.xml
browser/base/content/test/general/browser_bug763468_perwindowpb.js
browser/base/content/test/general/browser_bug767836_perwindowpb.js
browser/base/content/utilityOverlay.js
browser/components/extensions/ext-tabs.js
browser/components/extensions/ext-windows.js
browser/components/newtab/NewTabURL.jsm
browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js
browser/components/newtab/tests/xpcshell/xpcshell.ini
browser/components/nsBrowserGlue.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_urlbarfocus.js
testing/talos/talos/tests/tabswitch/bootstrap.js
testing/talos/talos/tests/tabswitch/content/test.html
testing/talos/talos/tests/tart/addon/content/tart.js
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1648,17 +1648,17 @@
 
       <method name="_isPreloadingEnabled">
         <body>
           <![CDATA[
             // Preloading for the newtab page is enabled when the pref is true
             // and the URL is "about:newtab". We do not support preloading for
             // custom newtab URLs.
             return Services.prefs.getBoolPref("browser.newtab.preload") &&
-                   !NewTabURL.overridden;
+                   !aboutNewTabService.overridden;
           ]]>
         </body>
       </method>
 
       <method name="_createPreloadBrowser">
         <body>
           <![CDATA[
             // Do nothing if we have a preloaded browser already
--- a/browser/base/content/test/general/browser_bug763468_perwindowpb.js
+++ b/browser/base/content/test/general/browser_bug763468_perwindowpb.js
@@ -1,29 +1,32 @@
 /* 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/. */
 
 // This test makes sure that opening a new tab in private browsing mode opens about:privatebrowsing
 function test() {
   // initialization
   waitForExplicitFinish();
+  let aboutNewTabService = Components.classes["@mozilla.org/browser/aboutnewtab-service;1"]
+                                     .getService(Components.interfaces.nsIAboutNewTabService);
+
   let windowsToClose = [];
   let newTab;
   let newTabURL;
   let mode;
 
   function doTest(aIsPrivateMode, aWindow, aCallback) {
     whenNewTabLoaded(aWindow, function () {
       if (aIsPrivateMode) {
         mode = "per window private browsing";
         newTabURL = "about:privatebrowsing";
       } else {
         mode = "normal";
-        newTabURL = NewTabURL.get();
+        newTabURL = aboutNewTabService.newTabURL;
       }
 
       is(aWindow.gBrowser.currentURI.spec, newTabURL,
         "URL of NewTab should be " + newTabURL + " in " + mode +  " mode");
 
       aWindow.gBrowser.removeTab(aWindow.gBrowser.selectedTab);
       aCallback()
     });
--- a/browser/base/content/test/general/browser_bug767836_perwindowpb.js
+++ b/browser/base/content/test/general/browser_bug767836_perwindowpb.js
@@ -1,61 +1,63 @@
 /* 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/. */
 
 function test() {
   //initialization
   waitForExplicitFinish();
+  let aboutNewTabService = Components.classes["@mozilla.org/browser/aboutnewtab-service;1"]
+                                     .getService(Components.interfaces.nsIAboutNewTabService);
   let newTabURL;
   let testURL = "http://example.com/";
   let mode;
 
   function doTest(aIsPrivateMode, aWindow, aCallback) {
     openNewTab(aWindow, function () {
       if (aIsPrivateMode) {
         mode = "per window private browsing";
         newTabURL = "about:privatebrowsing";
       } else {
         mode = "normal";
-        newTabURL = NewTabURL.get();
+        newTabURL = aboutNewTabService.newTabURL;
       }
 
       // Check the new tab opened while in normal/private mode
       is(aWindow.gBrowser.selectedBrowser.currentURI.spec, newTabURL,
         "URL of NewTab should be " + newTabURL + " in " + mode +  " mode");
       // Set the custom newtab url
-      NewTabURL.override(testURL);
-      is(NewTabURL.get(), testURL, "Custom newtab url is set");
+      aboutNewTabService.newTabURL = testURL;
+      is(aboutNewTabService.newTabURL, testURL, "Custom newtab url is set");
 
       // Open a newtab after setting the custom newtab url
       openNewTab(aWindow, function () {
         is(aWindow.gBrowser.selectedBrowser.currentURI.spec, testURL,
            "URL of NewTab should be the custom url");
 
         // Clear the custom url.
-        NewTabURL.reset();
-        is(NewTabURL.get(), "about:newtab", "No custom newtab url is set");
+        aboutNewTabService.resetNewTabURL();
+        is(aboutNewTabService.newTabURL, "about:newtab", "No custom newtab url is set");
 
         aWindow.gBrowser.removeTab(aWindow.gBrowser.selectedTab);
         aWindow.gBrowser.removeTab(aWindow.gBrowser.selectedTab);
         aWindow.close();
         aCallback()
       });
     });
   }
 
   function testOnWindow(aIsPrivate, aCallback) {
     whenNewWindowLoaded({private: aIsPrivate}, function(win) {
       executeSoon(() => aCallback(win));
     });
   }
 
   // check whether any custom new tab url has been configured
-  ok(!NewTabURL.overridden, "No custom newtab url is set");
+  ok(!aboutNewTabService.overridden, "No custom newtab url is set");
 
   // test normal mode
   testOnWindow(false, function(aWindow) {
     doTest(false, aWindow, function() {
       // test private mode
       testOnWindow(true, function(aWindow) {
         doTest(true, aWindow, function() {
           finish();
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -4,26 +4,27 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 // Services = object with smart getters for common XPCOM services
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 Components.utils.import("resource:///modules/RecentWindow.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "NewTabURL",
-  "resource:///modules/NewTabURL.jsm");
+XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
+                                   "@mozilla.org/browser/aboutnewtab-service;1",
+                                   "nsIAboutNewTabService");
 
 this.__defineGetter__("BROWSER_NEW_TAB_URL", () => {
   if (PrivateBrowsingUtils.isWindowPrivate(window) &&
       !PrivateBrowsingUtils.permanentPrivateBrowsing &&
-      !NewTabURL.overridden) {
+      !aboutNewTabService.overridden) {
     return "about:privatebrowsing";
   }
-  return NewTabURL.get();
+  return aboutNewTabService.newTabURL;
 });
 
 var TAB_DROP_TYPE = "application/x-moz-tabbrowser-tab";
 
 var gBidiUI = false;
 
 /**
  * Determines whether the given url is considered a special URL for new tabs.
--- a/browser/components/extensions/ext-tabs.js
+++ b/browser/components/extensions/ext-tabs.js
@@ -1,10 +1,11 @@
-XPCOMUtils.defineLazyModuleGetter(this, "NewTabURL",
-                                  "resource:///modules/NewTabURL.jsm");
+XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
+                                   "@mozilla.org/browser/aboutnewtab-service;1",
+                                   "nsIAboutNewTabService");
 
 Cu.import("resource://gre/modules/ExtensionUtils.jsm");
 var {
   EventManager,
   ignoreEvent,
   runSafe,
 } = ExtensionUtils;
 
@@ -241,17 +242,17 @@ extensions.registerAPI((extension, conte
         };
       }).api(),
 
       create: function(createProperties, callback) {
         if (!createProperties) {
           createProperties = {};
         }
 
-        let url = createProperties.url || NewTabURL.get();
+        let url = createProperties.url || aboutNewTabService.newTabURL;
         url = extension.baseURI.resolve(url);
 
         function createInWindow(window) {
           let tab = window.gBrowser.addTab(url);
 
           let active = true;
           if ("active" in createProperties) {
             active = createProperties.active;
--- a/browser/components/extensions/ext-windows.js
+++ b/browser/components/extensions/ext-windows.js
@@ -1,10 +1,11 @@
-XPCOMUtils.defineLazyModuleGetter(this, "NewTabURL",
-                                  "resource:///modules/NewTabURL.jsm");
+XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
+                                   "@mozilla.org/browser/aboutnewtab-service;1",
+                                   "nsIAboutNewTabService");
 
 Cu.import("resource://gre/modules/ExtensionUtils.jsm");
 var {
   EventManager,
   ignoreEvent,
   runSafe,
 } = ExtensionUtils;
 
@@ -90,17 +91,17 @@ extensions.registerAPI((extension, conte
             for (let url of createData.url) {
               array.AppendElement(mkstr(url));
             }
             args.AppendElement(array);
           } else {
             args.AppendElement(mkstr(createData.url));
           }
         } else {
-          args.AppendElement(mkstr(NewTabURL.get()));
+          args.AppendElement(mkstr(aboutNewTabService.newTabURL));
         }
 
         let extraFeatures = "";
         if ("incognito" in createData) {
           if (createData.incognito) {
             extraFeatures += ",private";
           } else {
             extraFeatures += ",non-private";
--- a/browser/components/newtab/NewTabURL.jsm
+++ b/browser/components/newtab/NewTabURL.jsm
@@ -5,39 +5,39 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 this.EXPORTED_SYMBOLS = [ "NewTabURL" ];
 
-Components.utils.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
+                                   "@mozilla.org/browser/aboutnewtab-service;1",
+                                   "nsIAboutNewTabService");
+XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
+                                  "resource://gre/modules/Deprecated.jsm");
+
+const DepecationURL = "https://bugzilla.mozilla.org/show_bug.cgi?id=1204983#c89";
 
 this.NewTabURL = {
-  _url: "about:newtab",
-  _remoteUrl: "about:remote-newtab",
-  _overridden: false,
 
   get: function() {
-    let output = this._url;
-    if (Services.prefs.getBoolPref("browser.newtabpage.remote")) {
-      output = this._remoteUrl;
-    }
-    return output;
+    Deprecated.warning("NewTabURL.get is deprecated, please query aboutNewTabService.newTabURL", DepecationURL);
+    return aboutNewTabService.newTabURL;
   },
 
   get overridden() {
-    return this._overridden;
+    Deprecated.warning("NewTabURL.overridden is deprecated, please query aboutNewTabService.overridden", DepecationURL);
+    return aboutNewTabService.overridden;
   },
 
   override: function(newURL) {
-    this._url = newURL;
-    this._overridden = true;
-    Services.obs.notifyObservers(null, "newtab-url-changed", this._url);
+    Deprecated.warning("NewTabURL.override is deprecated, please set aboutNewTabService.newTabURL", DepecationURL);
+    aboutNewTabService.newTabURL = newURL;
   },
 
   reset: function() {
-    this._url = "about:newtab";
-    this._overridden = false;
-    Services.obs.notifyObservers(null, "newtab-url-changed", this._url);
+    Deprecated.warning("NewTabURL.reset is deprecated, please use aboutNewTabService.resetNewTabURL()", DepecationURL);
+    aboutNewTabService.resetNewTabURL();
   }
 };
copy from browser/components/newtab/tests/xpcshell/test_NewTabURL.js
copy to browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js
--- a/browser/components/newtab/tests/xpcshell/test_NewTabURL.js
+++ b/browser/components/newtab/tests/xpcshell/test_AboutNewTabService.js
@@ -1,35 +1,36 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 "use strict";
 
-Components.utils.import("resource:///modules/NewTabURL.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
+let aboutNewTabService = Components.classes["@mozilla.org/browser/aboutnewtab-service;1"]
+                                   .getService(Components.interfaces.nsIAboutNewTabService);
 
 add_task(function* () {
-  Assert.equal(NewTabURL.get(), "about:newtab", "Default newtab URL should be about:newtab");
+  Assert.equal(aboutNewTabService.newTabURL, "about:newtab", "Default newtab URL should be about:newtab");
   let url = "http://example.com/";
   let notificationPromise = promiseNewtabURLNotification(url);
-  NewTabURL.override(url);
+  aboutNewTabService.newTabURL = url;
   yield notificationPromise;
-  Assert.ok(NewTabURL.overridden, "Newtab URL should be overridden");
-  Assert.equal(NewTabURL.get(), url, "Newtab URL should be the custom URL");
+  Assert.ok(aboutNewTabService.overridden, "Newtab URL should be overridden");
+  Assert.equal(aboutNewTabService.newTabURL, url, "Newtab URL should be the custom URL");
 
   notificationPromise = promiseNewtabURLNotification("about:newtab");
-  NewTabURL.reset();
+  aboutNewTabService.resetNewTabURL();
   yield notificationPromise;
-  Assert.ok(!NewTabURL.overridden, "Newtab URL should not be overridden");
-  Assert.equal(NewTabURL.get(), "about:newtab", "Newtab URL should be the about:newtab");
+  Assert.ok(!aboutNewTabService.overridden, "Newtab URL should not be overridden");
+  Assert.equal(aboutNewTabService.newTabURL, "about:newtab", "Newtab URL should be the about:newtab");
 
   // change newtab page to remote
   Services.prefs.setBoolPref("browser.newtabpage.remote", true);
-  Assert.equal(NewTabURL.get(), "about:remote-newtab", "Newtab URL should be the about:remote-newtab");
-  Assert.ok(!NewTabURL.overridden, "Newtab URL should not be overridden");
+  Assert.equal(aboutNewTabService.newTabURL, "about:remote-newtab", "Newtab URL should be the about:remote-newtab");
+  Assert.ok(!aboutNewTabService.overridden, "Newtab URL should not be overridden");
 });
 
 function promiseNewtabURLNotification(aNewURL) {
   return new Promise(resolve => {
     Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
       Services.obs.removeObserver(observer, aTopic);
       Assert.equal(aData, aNewURL, "Data for newtab-url-changed notification should be new URL.");
       resolve();
--- a/browser/components/newtab/tests/xpcshell/xpcshell.ini
+++ b/browser/components/newtab/tests/xpcshell/xpcshell.ini
@@ -1,11 +1,12 @@
 [DEFAULT]
 head =
 tail =
 firefox-appdir = browser
 skip-if = toolkit == 'android' || toolkit == 'gonk'
 
+[test_AboutNewTabService.js]
 [test_NewTabURL.js]
 [test_PlacesProvider.js]
 [test_RemoteDirectoryLinksProvider.js]
 [test_RemoteNewTabLocation.js]
 [test_RemoteNewTabUtils.js]
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2487,16 +2487,19 @@ function AboutNewTabService()
   this._overridden = false;
 }
 
 AboutNewTabService.prototype = {
   classID: Components.ID("{97eea4bb-db50-4ae0-9147-1e5ed55b4ed5}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutNewTabService]),
 
   get newTabURL() {
+    if (Services.prefs.getBoolPref("browser.newtabpage.remote")) {
+      return "about:remote-newtab";
+    }
     return this._newTabURL;
   },
 
   set newTabURL(aNewTabURL) {
     if (aNewTabURL === ABOUT_NEWTAB) {
       this.resetNewTabURL();
       return;
     }
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_urlbarfocus.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_urlbarfocus.js
@@ -1,16 +1,18 @@
 /* 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/. */
 
 // This test makes sure that the URL bar is focused when entering the private window.
 
 "use strict";
 Components.utils.import("resource://gre/modules/Promise.jsm", this);
+let aboutNewTabService = Components.classes["@mozilla.org/browser/aboutnewtab-service;1"]
+                                   .getService(Components.interfaces.nsIAboutNewTabService);
 
 function checkUrlbarFocus(win) {
   let urlbar = win.gURLBar;
   is(win.document.activeElement, urlbar.inputField, "URL Bar should be focused");
   is(urlbar.value, "", "URL Bar should be empty");
 }
 
 function openNewPrivateWindow() {
@@ -23,19 +25,19 @@ function openNewPrivateWindow() {
 
 add_task(function* () {
   let win = yield openNewPrivateWindow();
   checkUrlbarFocus(win);
   win.close();
 });
 
 add_task(function* () {
-  NewTabURL.override("about:blank");
+  aboutNewTabService.newTabURL = "about:blank";
   registerCleanupFunction(() => {
-    NewTabURL.reset();
+    aboutNewTabService.resetNewTabURL();
   });
 
   let win = yield openNewPrivateWindow();
   checkUrlbarFocus(win);
   win.close();
 
-  NewTabURL.reset();
+  aboutNewTabService.resetNewTabURL();
 });
--- a/testing/talos/talos/tests/tabswitch/bootstrap.js
+++ b/testing/talos/talos/tests/tabswitch/bootstrap.js
@@ -1,36 +1,38 @@
 
 // -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
 
 var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-Cu.import("resource:///modules/NewTabURL.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
+let aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"]
+                           .getService(Ci.nsIAboutNewTabService);
+
 var aboutBlankTab = null;
 var Profiler = null;
 
 var windowListener = {
   onOpenWindow: function(aWindow) {
     // Ensure we don't get tiles which contact the network
-    NewTabURL.override("about:blank")
+    aboutNewTabService.newTabURL = "about:blank";
 
     // Wait for the window to finish loading
     let window = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
     let cb = function() {
       window.removeEventListener("load", cb, false);
       loadIntoWindow(window);
     };
     window.addEventListener("load", cb, false);
   },
 
   onCloseWindow: function(aWindow) {
-    NewTabURL.reset()
+    aboutNewTabService.resetNewTabURL();
   },
 
   onWindowTitleChange: function(aWindow, aTitle) {
   }
 };
 
 function promiseOneEvent(target, eventName, capture) {
   let deferred = Promise.defer();
--- a/testing/talos/talos/tests/tabswitch/content/test.html
+++ b/testing/talos/talos/tests/tabswitch/content/test.html
@@ -1,14 +1,13 @@
 <html>
   <head>
     <script>
       const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
       Cu.import("resource://gre/modules/Services.jsm");
-      Cu.import("resource:///modules/NewTabURL.jsm");
       function do_test(override) {
         if (override || document.location.hash.indexOf("#auto") == 0) {
           var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                    .getInterface(Components.interfaces.nsIWebNavigation)
                    .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
                    .rootTreeItem
                    .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                    .getInterface(Components.interfaces.nsIDOMWindow);
--- a/testing/talos/talos/tests/tart/addon/content/tart.js
+++ b/testing/talos/talos/tests/tart/addon/content/tart.js
@@ -22,16 +22,19 @@
 // X - have preview images: hard to make work across versions
 // - Tests:
 //   V - With favicon
 //   V - Different DPIs
 //   V - with fade only (no tab open/close overhead)
 //   X - tab drag
 //   X - tab remove from the middle
 //   X - Without add-tab button -> can be hidden while testing manually. in talos always with the button
+let aboutNewTabService = Components.classes["@mozilla.org/browser/aboutnewtab-service;1"]
+                                   .getService(Components.interfaces.nsIAboutNewTabService);
+
 function Tart() {
 }
 
 Tart.prototype = {
   // Detector methods expect 'this' to be the detector object.
   // Detectors must support measureNow(e) which indicates to collect the intervals and stop the recording.
   // Detectors may support keepListening(e) to indicate to keep waiting before continuing to the next animation.
 
@@ -466,29 +469,29 @@ Tart.prototype = {
       // Hardcoded fallback in case the value doesn't make sense as tab animation duration.
       tabRefDuration = 250;
     }
 
     var custRefDuration = getReferenceCustomizationDuration();
 
     var subtests = {
       init: [ // This is called before each subtest, so it's safe to assume the following prefs:
-        function(){NewTabURL.override("about:blank");
+        function(){aboutNewTabService.newTabURL = "about:blank";
                    Services.prefs.setBoolPref("browser.newtabpage.enabled", true); // preview images if using about:newtab
                    Services.prefs.setBoolPref("browser.newtab.preload", false);
                    //Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1");
                    self.pinTart();
                    //Services.prefs.setIntPref ("docshell.event_starvation_delay_hint", 1);
                    next();
         }
       ],
 
       restore: [
         // Restore prefs which were modified during the test
-        function(){NewTabURL.reset();
+        function(){aboutNewTabService.resetNewTabURL();
                    Services.prefs.setBoolPref("browser.newtabpage.enabled", origNewtabEnabled);
                    Services.prefs.setBoolPref("browser.newtab.preload", origPreload);
                    Services.prefs.setCharPref("layout.css.devPixelsPerPx", origDpi);
                    if (origPinned) self.pinTart(); else self.unpinTart();
                    //if (origStarveHint != -9999) Services.prefs.setIntPref("docshell.event_starvation_delay_hint", origStarveHint);
                    next();
         }
       ],
@@ -499,48 +502,48 @@ Tart.prototype = {
         function(){animate(0, addTab, next);},
         function(){animate(0, closeCurrentTab, next);},
         function(){animate(rest, addTab, next, true, "simple-open-DPI1", tabRefDuration);},
         function(){animate(rest, closeCurrentTab, next, true, "simple-close-DPI1", tabRefDuration);}
       ],
 
       iconDpi1: [
         function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1"); next();},
-        function(){NewTabURL.override("chrome://tart/content/blank.icon.html"); next();},
+        function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
 
         function(){animate(0, addTab, next);},
         function(){animate(0, closeCurrentTab, next);},
         function(){animate(rest, addTab, next, true, "icon-open-DPI1", tabRefDuration);},
         function(){animate(rest, closeCurrentTab, next, true, "icon-close-DPI1", tabRefDuration);}
       ],
 
       iconDpi2: [
         function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2"); next();},
-        function(){NewTabURL.override("chrome://tart/content/blank.icon.html"); next();},
+        function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
 
         function(){animate(0, addTab, next);},
         function(){animate(0, closeCurrentTab, next);},
         function(){animate(rest, addTab, next, true, "icon-open-DPI2", tabRefDuration);},
         function(){animate(rest, closeCurrentTab, next, true, "icon-close-DPI2", tabRefDuration);}
       ],
 
       newtabNoPreload: [
-        function(){NewTabURL.override("about:newtab");
+        function(){aboutNewTabService.newTabURL = "about:newtab";
                    Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1");
                    Services.prefs.setBoolPref("browser.newtab.preload", false);
                    next();
         },
 
         function(){animate(rest, addTab, next, true, "newtab-open-preload-no", tabRefDuration);},
 
         function(){animate(0, closeCurrentTab, next);}
       ],
 
       newtabYesPreload: [
-        function(){NewTabURL.override("about:newtab");
+        function(){aboutNewTabService.newTabURL = "about:newtab";
                    Services.prefs.setCharPref("layout.css.devPixelsPerPx", "-1");
                    Services.prefs.setBoolPref("browser.newtab.preload", true);
                    next();
         },
 
         function(){animate(0, addTab, next);},
         function(){animate(0, closeCurrentTab, next);},
 
@@ -556,17 +559,17 @@ Tart.prototype = {
 
         function(){animate(rest, closeCurrentTab, next, true, "simple3-3-close-DPIcurrent", tabRefDuration);},
         function(){animate(rest, closeCurrentTab, next, true, "simple3-2-close-DPIcurrent", tabRefDuration);},
         function(){animate(rest, closeCurrentTab, next, true, "simple3-1-close-DPIcurrent", tabRefDuration);}
       ],
 
       multi: [
         function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "1.0"); next();},
-        function(){NewTabURL.override("chrome://tart/content/blank.icon.html"); next();},
+        function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
 
         function(){animate(0, addTab, next);},
         function(){animate(0, addTab, next);},
         function(){animate(0, addTab, next);},
         function(){animate(0, addTab, next);},
         function(){animate(0, addTab, next);},
         function(){animate(0, addTab, next);},
 
@@ -585,36 +588,36 @@ Tart.prototype = {
         function(){animate(0, closeCurrentTab, next);},
         function(){animate(0, closeCurrentTab, next);},
         function(){animate(0, closeCurrentTab, next);},
         function(){animate(0, closeCurrentTab, next);},
         function(){animate(0, closeCurrentTab, next);},
       ],
 
       simpleFadeDpiCurrent: [
-        function(){NewTabURL.override("about:blank"); next();},
+        function(){aboutNewTabService.newTabURL = "about:blank"; next();},
 
         function(){animate(0, addTab, next);},
         function(){animate(rest, fadeout, next, true, "simpleFade-close-DPIcurrent", tabRefDuration);},
         function(){animate(rest, fadein, next, true, "simpleFade-open-DPIcurrent", tabRefDuration);},
         function(){animate(0, closeCurrentTab, next);},
       ],
 
       iconFadeDpiCurrent: [
-        function(){NewTabURL.override("chrome://tart/content/blank.icon.html"); next();},
+        function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
 
         function(){animate(0, addTab, next);},
         function(){animate(rest, fadeout, next, true, "iconFade-close-DPIcurrent", tabRefDuration);},
         function(){animate(rest, fadein, next, true, "iconFade-open-DPIcurrent", tabRefDuration);},
         function(){animate(0, closeCurrentTab, next);},
       ],
 
       iconFadeDpi2: [
         function(){Services.prefs.setCharPref("layout.css.devPixelsPerPx", "2"); next();},
-        function(){NewTabURL.override("chrome://tart/content/blank.icon.html"); next();},
+        function(){aboutNewTabService.newTabURL = "chrome://tart/content/blank.icon.html"; next();},
 
         function(){animate(0, addTab, next);},
         function(){animate(rest, fadeout, next, true, "iconFade-close-DPI2", tabRefDuration);},
         function(){animate(rest, fadein, next, true, "iconFade-open-DPI2", tabRefDuration);},
         function(){animate(0, closeCurrentTab, next);},
       ],
 
       lastTabFadeDpiCurrent: [