Bug 772272 - Remove do_load_httpd_js from xpcshell tests, r=ted, f=gps
authorMark Capella <markcapella@twcny.rr.com>
Wed, 08 Aug 2012 00:51:28 -0400
changeset 101786 3029842b3204577804136244486cc947986a3a1a
parent 101785 841cd6e1e585831a25ab406d48b3e5750c564781
child 101787 a468dc4bfaf49203a4cf50b4acfea35fd4cea7f4
push idunknown
push userunknown
push dateunknown
reviewersted
bugs772272
milestone17.0a1
Bug 772272 - Remove do_load_httpd_js from xpcshell tests, r=ted, f=gps
toolkit/mozapps/extensions/test/unit/test_bug463819.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_compatmode.js
toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js
toolkit/mozapps/extensions/test/xpcshell/test_badschema.js
toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js
toolkit/mozapps/extensions/test/xpcshell/test_bug299716.js
toolkit/mozapps/extensions/test/xpcshell/test_bug299716_2.js
toolkit/mozapps/extensions/test/xpcshell/test_bug324121.js
toolkit/mozapps/extensions/test/xpcshell/test_bug335238.js
toolkit/mozapps/extensions/test/xpcshell/test_bug384052.js
toolkit/mozapps/extensions/test/xpcshell/test_bug394300.js
toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js
toolkit/mozapps/extensions/test/xpcshell/test_bug430120.js
toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
toolkit/mozapps/extensions/test/xpcshell/test_bug455906.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_1.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_1_strictcompat.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_2.js
toolkit/mozapps/extensions/test/xpcshell/test_bug514327_3.js
toolkit/mozapps/extensions/test/xpcshell/test_bug542391.js
toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
toolkit/mozapps/extensions/test/xpcshell/test_bug570173.js
toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js
toolkit/mozapps/extensions/test/xpcshell/test_bug620837.js
toolkit/mozapps/extensions/test/xpcshell/test_bug655254.js
toolkit/mozapps/extensions/test/xpcshell/test_compatoverrides.js
toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
toolkit/mozapps/extensions/test/xpcshell/test_corrupt_strictcompat.js
toolkit/mozapps/extensions/test/xpcshell/test_dictionary.js
toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/test_hotfix.js
toolkit/mozapps/extensions/test/xpcshell/test_install.js
toolkit/mozapps/extensions/test/xpcshell/test_install_strictcompat.js
toolkit/mozapps/extensions/test/xpcshell/test_locked.js
toolkit/mozapps/extensions/test/xpcshell/test_locked_strictcompat.js
toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js
toolkit/mozapps/extensions/test/xpcshell/test_update.js
toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
toolkit/mozapps/extensions/test/xpcshell/test_update_ignorecompat.js
toolkit/mozapps/extensions/test/xpcshell/test_update_strictcompat.js
toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
toolkit/mozapps/extensions/test/xpcshell/test_updateid.js
--- a/toolkit/mozapps/extensions/test/unit/test_bug463819.js
+++ b/toolkit/mozapps/extensions/test/unit/test_bug463819.js
@@ -7,48 +7,48 @@ const INSTALLERROR_SUCCESS              
 const INSTALLERROR_INCOMPATIBLE_VERSION  = -3;
 const INSTALLERROR_BLOCKLISTED           = -6;
 const INSTALLERROR_SOFTBLOCKED           = -10;
 
 // Disables security checking our updates which haven't been signed
 gPrefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 // Get the HTTP server.
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 // This allows the EM to attempt to display errors to the user without failing
 var promptService = {
   alert: function(aParent, aDialogTitle, aText) {
   },
-  
+
   alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
   },
-  
+
   confirm: function(aParent, aDialogTitle, aText) {
   },
-  
+
   confirmCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) {
   },
-  
+
   confirmEx: function(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState) {
   },
-  
+
   prompt: function(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState) {
   },
-  
+
   promptUsernameAndPassword: function(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) {
   },
 
   promptPassword: function(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState) {
   },
-  
+
   select: function(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection) {
   },
-  
+
   QueryInterface: function(iid) {
     if (iid.equals(Components.interfaces.nsIPromptService)
      || iid.equals(Components.interfaces.nsISupports))
       return this;
   
     throw Components.results.NS_ERROR_NO_INTERFACE;
   }
 };
@@ -125,17 +125,17 @@ var installListener = {
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
 
   // Install the blocklist
   var blocklist = do_get_file("data/test_bug463819.xml");
   blocklist.copyTo(gProfD, "blocklist.xml");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/", do_get_file("data"));
   testserver.start(4444);
 
   startupEM();
   gEM.addInstallListener(installListener);
 
   // These add-ons require no update check so will complete installation immediately
   dump("Installing add-on 1\n");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests AddonRepository.jsm
 
 Components.utils.import("resource://gre/modules/AddonRepository.jsm");
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var gServer;
 
 const PREF_GETADDONS_BROWSEADDONS        = "extensions.getAddons.browseAddons";
 const PREF_GETADDONS_BYIDS               = "extensions.getAddons.get.url";
 const PREF_GETADDONS_BROWSERECOMMENDED   = "extensions.getAddons.recommended.browseURL";
 const PREF_GETADDONS_GETRECOMMENDED      = "extensions.getAddons.recommended.url";
 const PREF_GETADDONS_BROWSESEARCHRESULTS = "extensions.getAddons.search.browseURL";
 const PREF_GETADDONS_GETSEARCHRESULTS    = "extensions.getAddons.search.url";
@@ -359,17 +359,17 @@ function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   startupManager();
 
   // Install an add-on so can check that it isn't returned in the results
   installAllFiles([do_get_addon("test_AddonRepository_1")], function() {
     restartManager();
 
-    gServer = new nsHttpServer();
+    gServer = new HttpServer();
 
     // Register other add-on XPI files
     gServer.registerFile(INSTALL_URL2,
                         do_get_addon("test_AddonRepository_2"));
     gServer.registerFile(INSTALL_URL3,
                         do_get_addon("test_AddonRepository_3"));
 
     // Register files used to test search failure
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests caching in AddonRepository.jsm
 
 Components.utils.import("resource://gre/modules/AddonRepository.jsm");
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 let gServer;
 
 const PORT      = 4444;
 const BASE_URL  = "http://localhost:" + PORT;
 
 const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
 const PREF_GETADDONS_CACHE_TYPES   = "extensions.getAddons.cache.types";
 const PREF_GETADDONS_BYIDS         = "extensions.getAddons.get.url";
@@ -528,17 +528,17 @@ function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   startupManager();
 
   // Install XPI add-ons
   installAllFiles(ADDON_FILES, function() {
     restartManager();
 
-    gServer = new nsHttpServer();
+    gServer = new HttpServer();
     gServer.registerDirectory("/data/", do_get_file("data"));
     gServer.start(PORT);
 
     run_test_1();
   });
 }
 
 function end_test() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_compatmode.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_compatmode.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that AddonRepository correctly fills in the
 // %COMPATIBILITY_MODE% token in the Search API URL.
 
 const PREF_GETADDONS_GETSEARCHRESULTS    = "extensions.getAddons.search.url";
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var gServer;
 var COMPATIBILITY_PREF;
 
 function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   var channel = "default";
@@ -24,17 +24,17 @@ function run_test() {
       channel != "release") {
     var version = "nightly";
   } else {
     version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
   }
   COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
 
   // Create and configure the HTTP server.
-  gServer = new nsHttpServer();
+  gServer = new HttpServer();
   gServer.registerDirectory("/data/", do_get_file("data"));
   gServer.start(4444);
 
   Services.prefs.setCharPref(PREF_GETADDONS_GETSEARCHRESULTS,
                              "http://localhost:4444/data/test_AddonRepository_compatmode_%COMPATIBILITY_MODE%.xml");
   startupManager();
   run_test_1();
 }
--- a/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_backgroundupdate.js
@@ -2,26 +2,26 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that background updates & notifications work as expected
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   startupManager();
 
   do_test_pending();
   run_test_1();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_badschema.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_badschema.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Checks that we rebuild something sensible from a database with a bad schema
 
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 // Will be enabled
 var addon1 = {
   id: "addon1@tests.mozilla.org",
@@ -138,17 +138,17 @@ function run_test() {
   writeInstallRDFForExtension(addon4, profileDir);
   writeInstallRDFForExtension(addon5, profileDir);
   writeInstallRDFForExtension(addon6, profileDir);
   writeInstallRDFForExtension(addon7, profileDir);
   writeInstallRDFForExtension(theme1, profileDir);
   writeInstallRDFForExtension(theme2, profileDir);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.start(4444);
 
   // Startup the profile and setup the initial state
   startupManager();
 
   AddonManager.getAddonsByIDs(["addon2@tests.mozilla.org",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_blocklistchange.js
@@ -22,24 +22,28 @@
 // softblock4 is disabled while unblocked and so should never have softDisabled
 // set to true and stay userDisabled. This add-on is not used in tests that
 // start with add-ons blocked as it would be identical to softblock3
 
 // softblock5 is a theme. Currently themes just get disabled when they become
 // softblocked and have to be manually re-enabled if they become completely
 // unblocked (bug 657520)
 
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
+Cu.import("resource://gre/modules/NetUtil.jsm");
 
 // Allow insecure updates
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false)
 
-do_load_httpd_js();
+Cu.import("resource://testing-common/httpd.js");
 var testserver;
 
 var default_theme = {
   id: "default@tests.mozilla.org",
   version: "1.0",
   name: "Softblocked add-on",
   internalName: "classic/1.0",
   targetApplications: [{
@@ -507,17 +511,17 @@ function check_addon(aAddon, aExpectedVe
   }
   else {
     do_check_true(willBeActive);
   }
 }
 
 function run_test() {
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data/blocklistchange"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   do_test_pending();
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
   writeInstallRDFForExtension(default_theme, profileDir);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js
@@ -22,17 +22,17 @@ createAppInfo("xpcshell@tests.mozilla.or
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 const userExtDir = gProfD.clone();
 userExtDir.append("extensions2");
 userExtDir.append(gAppInfo.ID);
 registerDirectory("XREUSysExt", userExtDir.parent);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 function resetPrefs() {
   Services.prefs.setIntPref("bootstraptest.active_version", -1);
   Services.prefs.setIntPref("bootstraptest.installed_version", -1);
   Services.prefs.setIntPref("bootstraptest2.active_version", -1);
   Services.prefs.setIntPref("bootstraptest2.installed_version", -1);
   Services.prefs.setIntPref("bootstraptest.startup_reason", -1);
@@ -82,17 +82,17 @@ function getUninstallReason() {
 }
 
 function run_test() {
   do_test_pending();
 
   resetPrefs();
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   startupManager();
 
   let file = gProfD.clone();
   file.append("extensions.sqlite");
   do_check_false(file.exists());
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug299716.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug299716.js
@@ -21,17 +21,17 @@ const checkListener = {
 
   onUpdateFinished: function onUpdateFinished() {
     if (--this.pendingCount == 0)
       next_test();
   }
 }
 
 // Get the HTTP server.
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 var ADDONS = [
   // XPCShell
   {
     id: "bug299716-a@tests.mozilla.org",
     addon: "test_bug299716_a_1",
     installed: true,
@@ -123,17 +123,17 @@ function run_test() {
   const addonsDir = do_get_addon(ADDONS[0].addon).parent;
 
   // Make sure we can actually get our data files.
   const xpiFile = addonsDir.clone();
   xpiFile.append("test_bug299716_a_2.xpi");
   do_check_true(xpiFile.exists());
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", addonsDir);
   testserver.registerDirectory("/data/", dataDir);
   testserver.start(4444);
 
   // Make sure we can fetch the files over HTTP.
   const Ci = Components.interfaces;
   const xhr = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
                         .createInstance(Ci.nsIXMLHttpRequest)
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug299716_2.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug299716_2.js
@@ -2,34 +2,34 @@
  * 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/.
  */
 
 // Disables security checking our updates which haven't been signed
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 // Get the HTTP server.
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 var ADDON = {
   id: "bug299716-2@tests.mozilla.org",
   addon: "test_bug299716_2"
 };
 
 function run_test() {
   do_test_pending();
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
 
   const dataDir = do_get_file("data");
   const addonsDir = do_get_addon(ADDON.addon).parent;
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", addonsDir);
   testserver.registerDirectory("/data/", dataDir);
   testserver.start(4444);
 
   startupManager();
 
   installAllFiles([do_get_addon(ADDON.addon)], function() {
     restartManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug324121.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug324121.js
@@ -2,17 +2,17 @@
  * 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/.
  */
 
 // Disables security checking our updates which haven't been signed
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
 // Get the HTTP server.
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 var next_test = null;
 var gItemsNotChecked =[];
 
 var ADDONS = [ {id: "bug324121_1@tests.mozilla.org",
                 addon: "test_bug324121_1",
                 shouldCheck: false },
@@ -125,17 +125,17 @@ var updateListener = {
 
 function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
 
   const dataDir = do_get_file("data");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", dataDir);
   testserver.start(4444);
 
   startupManager();
 
   installAllFiles([do_get_addon(a.addon) for each (a in ADDONS)], function() {
     restartManager();
     AddonManager.getAddonByID(ADDONS[0].id, function(addon) {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug335238.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug335238.js
@@ -4,17 +4,20 @@
  */
 
 const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS";
 const PREF_SELECTED_LOCALE = "general.useragent.locale";
 
 // Disables security checking our updates which haven't been signed
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
-do_load_httpd_js();
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
+Cu.import("resource://testing-common/httpd.js");
 
 // This is the data we expect to see sent as part of the update url.
 var EXPECTED = [
   {
     id: "bug335238_1@tests.mozilla.org",
     version: "1.3.4",
     maxAppVersion: "5",
     status: "userEnabled",
@@ -89,18 +92,18 @@ var BlocklistService = {
   },
 
   isAddonBlocklisted: function(aId, aVersion, aAppVersion, aToolkitVersion) {
     return this.getAddonBlocklistState(aId, aVersion, aAppVersion, aToolkitVersion) ==
            Ci.nsIBlocklistService.STATE_BLOCKED;
   },
 
   QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIBlocklistService)
-     || iid.equals(Components.interfaces.nsISupports))
+    if (iid.equals(Ci.nsIBlocklistService)
+     || iid.equals(Ci.nsISupports))
       return this;
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
   }
 };
 
 var BlocklistServiceFactory = {
   createInstance: function (outer, iid) {
@@ -143,17 +146,17 @@ var requestHandler = {
     response.setStatusLine(metadata.httpVersion, 404, "Not Found");
   }
 }
 
 function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
-  server = new nsHttpServer();
+  server = new HttpServer();
   server.registerPathHandler("/0", requestHandler);
   server.registerPathHandler("/1", requestHandler);
   server.registerPathHandler("/2", requestHandler);
   server.registerPathHandler("/3", requestHandler);
   server.start(4444);
 
   Services.prefs.setBoolPref(PREF_MATCH_OS_LOCALE, false);
   Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "en-US");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug384052.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug384052.js
@@ -4,17 +4,17 @@ const CONTRACT_ID = "@mozilla.org/test-p
 var gTestURL = "http://127.0.0.1:4444/update.rdf?itemID=%ITEM_ID%&custom1=%CUSTOM1%&custom2=%CUSTOM2%";
 var gExpectedQuery = "itemID=test@mozilla.org&custom1=custom_parameter_1&custom2=custom_parameter_2";
 var gSeenExpectedURL = false;
 
 var gComponentRegistrar = Components.manager.QueryInterface(AM_Ci.nsIComponentRegistrar);
 var gCategoryManager = AM_Cc["@mozilla.org/categorymanager;1"].getService(AM_Ci.nsICategoryManager);
 
 // Get the HTTP server.
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 // Factory for our parameter handler
 var paramHandlerFactory = {
   QueryInterface: function(iid) {
     if (iid.equals(AM_Ci.nsIFactory) || iid.equals(AM_Ci.nsISupports))
       return this;
 
@@ -32,17 +32,17 @@ var paramHandlerFactory = {
 
 function initTest()
 {
   do_test_pending();
   // Setup extension manager
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerPathHandler("/update.rdf", function(aRequest, aResponse) {
     gSeenExpectedURL = aRequest.queryString == gExpectedQuery;
     aResponse.setStatusLine(null, 404, "Not Found");
   });
   testserver.start(4444);
 
   // Register our parameter handlers
   gComponentRegistrar.registerFactory(CLASS_ID, "Test component", CONTRACT_ID, paramHandlerFactory);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug394300.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug394300.js
@@ -1,17 +1,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/.
  */
 
 // Disables security checking our updates which haven't been signed
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var server;
 
 // nsIAddonUpdateCheckListener implementation
 var updateListener = {
   _count: 0,
 
   onUpdateAvailable: function onAddonUpdateEnded(aAddon, aInstall) {
     do_check_eq(aInstall.version, 10);
@@ -40,17 +40,17 @@ function run_test()
     restartManager();
 
     AddonManager.getAddonsByIDs(["bug394300_1@tests.mozilla.org",
                                  "bug394300_2@tests.mozilla.org"], function(updates) {
 
       do_check_neq(updates[0], null);
       do_check_neq(updates[1], null);
 
-      server = new nsHttpServer();
+      server = new HttpServer();
       server.registerDirectory("/", do_get_file("data"));
       server.start(4444);
 
       updates[0].findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
       updates[1].findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
     });
   });
 }
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug424262.js
@@ -1,17 +1,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/.
  */
 Components.utils.import("resource://gre/modules/AddonRepository.jsm");
 
 const PREF_GETADDONS_GETRECOMMENDED      = "extensions.getAddons.recommended.url";
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var server;
 var RESULTS = [
   null,
   null,
   0,
   2,
   4,
   5,
@@ -39,22 +39,22 @@ var RecommendedCallback = {
 };
 
 function run_test()
 {
   // EM needs to be running.
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
   startupManager();
 
-  server = new nsHttpServer();
+  server = new HttpServer();
   server.registerDirectory("/", do_get_file("data"));
   server.start(4444);
 
   // Point the addons repository to the test server
   Services.prefs.setCharPref(PREF_GETADDONS_GETRECOMMENDED, "http://localhost:4444/test_bug424262.xml");
-  
+
   do_check_neq(AddonRepository, null);
 
   do_test_pending();
   // Pull some results.
   AddonRepository.retrieveRecommendedAddons(RESULTS.length, RecommendedCallback);
 }
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug430120.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug430120.js
@@ -8,17 +8,17 @@ const PREF_BLOCKLIST_URL              = 
 const PREF_BLOCKLIST_ENABLED          = "extensions.blocklist.enabled";
 const PREF_APP_DISTRIBUTION           = "distribution.id";
 const PREF_APP_DISTRIBUTION_VERSION   = "distribution.version";
 const PREF_APP_UPDATE_CHANNEL         = "app.update.channel";
 const PREF_GENERAL_USERAGENT_LOCALE   = "general.useragent.locale";
 const CATEGORY_UPDATE_TIMER           = "update-timer";
 
 // Get the HTTP server.
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 var gOSVersion;
 var gBlocklist;
 
 // This is a replacement for the timer service so we can trigger timers
 var timerService = {
 
   hasTimer: function(id) {
@@ -98,17 +98,17 @@ function run_test() {
       gOSVersion = encodeURIComponent(osVersion);
     }
   }
   catch (e) {
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerPathHandler("/1", failHandler);
   testserver.registerPathHandler("/2", pathHandler);
   testserver.start(4444);
 
   // Initialise the blocklist service
   gBlocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
                          .getService(Components.interfaces.nsIBlocklistService)
                          .QueryInterface(Components.interfaces.nsIObserver);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
@@ -1,15 +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/.
  */
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-do_load_httpd_js();
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
+Cu.import("resource://testing-common/httpd.js");
 
 var ADDONS = [{
   id: "test_bug449027_1@tests.mozilla.org",
   name: "Bug 449027 Addon Test 1",
   version: "5",
   start: false,
   appBlocks: false,
   toolkitBlocks: false
@@ -367,20 +370,20 @@ var gNewBlocks = [];
 // A fake plugin host for the blocklist service to use
 var PluginHost = {
   getPluginTags: function(countRef) {
     countRef.value = PLUGINS.length;
     return PLUGINS;
   },
 
   QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIPluginHost)
-     || iid.equals(Components.interfaces.nsISupports))
+    if (iid.equals(Ci.nsIPluginHost)
+     || iid.equals(Ci.nsISupports))
       return this;
-  
+
     throw Components.results.NS_ERROR_NO_INTERFACE;
   }
 }
 
 var PluginHostFactory = {
   createInstance: function (outer, iid) {
     if (outer != null)
       throw Components.results.NS_ERROR_NO_AGGREGATION;
@@ -403,32 +406,32 @@ var WindowWatcher = {
     for (let listItem of list)
       gNewBlocks.push(listItem.name + " " + listItem.version);
 
     // Call the callback after the blocklist has finished up
     do_timeout(0, gCallback);
   },
 
   QueryInterface: function(iid) {
-    if (iid.equals(Components.interfaces.nsIWindowWatcher)
-     || iid.equals(Components.interfaces.nsISupports))
+    if (iid.equals(Ci.nsIWindowWatcher)
+     || iid.equals(Ci.nsISupports))
       return this;
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
   }
 }
 
 var WindowWatcherFactory = {
   createInstance: function createInstance(outer, iid) {
     if (outer != null)
       throw Components.results.NS_ERROR_NO_AGGREGATION;
     return WindowWatcher.QueryInterface(iid);
   }
 };
-var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
+var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
 registrar.registerFactory(Components.ID("{721c3e73-969e-474b-a6dc-059fd288c428}"),
                           "Fake Plugin Host",
                           "@mozilla.org/plugin/host;1", PluginHostFactory);
 registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                           "Fake Window Watcher",
                           "@mozilla.org/embedcomp/window-watcher;1", WindowWatcherFactory);
 
 function create_addon(addon) {
@@ -450,17 +453,17 @@ function create_addon(addon) {
                    "  </Description>\n" +
                    "</RDF>\n";
   var target = gProfD.clone();
   target.append("extensions");
   target.append(addon.id);
   target.append("install.rdf");
   target.create(target.NORMAL_FILE_TYPE, 0644);
   var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
-                         .createInstance(Components.interfaces.nsIFileOutputStream);
+                         .createInstance(Ci.nsIFileOutputStream);
   stream.init(target, 0x04 | 0x08 | 0x20, 0664, 0); // write, create, truncate
   stream.write(installrdf, installrdf.length);
   stream.close();
 }
 
 /**
  * Checks that items are blocklisted correctly according to the current test.
  * If a lastTest is provided checks that the notification dialog got passed
@@ -501,32 +504,32 @@ function check_state(test, lastTest, cal
     }
     callback();
   });
 }
 
 function load_blocklist(file) {
   Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:4444/data/" + file);
   var blocklist = Components.classes["@mozilla.org/extensions/blocklist;1"]
-                            .getService(Components.interfaces.nsITimerCallback);
+                            .getService(Ci.nsITimerCallback);
   blocklist.notify(null);
 }
 
 function run_test() {
   // Setup for test
   dump("Setting up tests\n");
   // Rather than keeping lots of identical add-ons in version control, just
   // write them into the profile.
   for (let addon of ADDONS)
     create_addon(addon);
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
   check_test_pt1();
 }
 
 /**
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug455906.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug455906.js
@@ -3,17 +3,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
 // Workaround for Bug 658720 - URL formatter can leak during xpcshell tests
 const PREF_BLOCKLIST_ITEM_URL = "extensions.blocklist.itemURL";
 Services.prefs.setCharPref(PREF_BLOCKLIST_ITEM_URL, "http://localhost:4444/blocklist/%blockID%");
 
-do_load_httpd_js();
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
+Cu.import("resource://testing-common/httpd.js");
 
 var ADDONS = [{
   // Tests how the blocklist affects a disabled add-on
   id: "test_bug455906_1@tests.mozilla.org",
   name: "Bug 455906 Addon Test 1",
   version: "5",
   appVersion: "3"
 }, {
@@ -242,17 +246,17 @@ function run_test() {
   if (blocklistFile.exists())
     blocklistFile.remove(false);
   var blocklist = do_get_file("data/bug455906_start.xml")
   blocklist.copyTo(gProfD, "blocklist.xml");
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
   check_test_pt1();
 }
 
 // Before every main test this is the state the add-ons are meant to be in
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_1.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_1.js
@@ -10,24 +10,24 @@ Services.prefs.setBoolPref(PREF_EM_STRIC
 var ADDONS = [
   "test_bug470377_1",
   "test_bug470377_2",
   "test_bug470377_3",
   "test_bug470377_4",
   "test_bug470377_5",
 ];
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var server;
 
 function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
 
-  server = new nsHttpServer();
+  server = new HttpServer();
   server.registerDirectory("/", do_get_file("data/test_bug470377"));
   server.start(4444);
 
   startupManager();
 
   installAllFiles([do_get_addon(a) for each (a in ADDONS)], function() {
     restartManager();
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_1_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_1_strictcompat.js
@@ -10,24 +10,24 @@ Services.prefs.setBoolPref(PREF_EM_STRIC
 var ADDONS = [
   "test_bug470377_1",
   "test_bug470377_2",
   "test_bug470377_3",
   "test_bug470377_4",
   "test_bug470377_5",
 ];
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var server;
 
 function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
 
-  server = new nsHttpServer();
+  server = new HttpServer();
   server.registerDirectory("/", do_get_file("data/test_bug470377"));
   server.start(4444);
 
   startupManager();
 
   installAllFiles([do_get_addon(a) for each (a in ADDONS)], function() {
     restartManager();
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_2.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_2.js
@@ -24,24 +24,24 @@ else {
 var ADDONS = [
   "test_bug470377_1",
   "test_bug470377_2",
   "test_bug470377_3",
   "test_bug470377_4",
   "test_bug470377_5",
 ];
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var server;
 
 function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2");
 
-  server = new nsHttpServer();
+  server = new HttpServer();
   server.registerDirectory("/", do_get_file("data/test_bug470377"));
   server.start(4444);
 
   startupManager();
 
   installAllFiles([do_get_addon(a) for each (a in ADDONS)], function() {
     restartManager();
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_3.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug514327_3.js
@@ -1,14 +1,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/. */
 
-do_load_httpd_js();
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
 
+Cu.import("resource://testing-common/httpd.js");
 
 const nsIBLS = Ci.nsIBlocklistService;
 const URI_EXTENSION_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
 var gBlocklist = null;
 var gPrefs = null;
 var gTestserver = null;
 
@@ -100,25 +103,25 @@ registrar.registerFactory(Components.ID(
                           "@mozilla.org/plugin/host;1", PluginHostFactory);
 registrar.registerFactory(Components.ID("{1dfeb90a-2193-45d5-9cb8-864928b2af55}"),
                           "Fake Window Watcher",
                           "@mozilla.org/embedcomp/window-watcher;1", WindowWatcherFactory);
 
 
 function do_update_blocklist(aDatafile, aNextPart) {
   gNextTestPart = aNextPart;
-  
+
   gPrefs.setCharPref("extensions.blocklist.url", "http://localhost:4444/data/" + aDatafile);
   gBlocklist.QueryInterface(Ci.nsITimerCallback).notify(null);
 }
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
-  
-  gTestserver = new nsHttpServer();
+
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
 
   // initialize the blocklist with no entries
   var blocklistFile = gProfD.clone();
   blocklistFile.append("blocklist.xml");
   if (blocklistFile.exists())
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug542391.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug542391.js
@@ -4,17 +4,21 @@
  */
 
 const URI_EXTENSION_UPDATE_DIALOG     = "chrome://mozapps/content/extensions/update.xul";
 const PREF_EM_SHOW_MISMATCH_UI        = "extensions.showMismatchUI";
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
-do_load_httpd_js();
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
+Cu.import("resource://testing-common/httpd.js");
 var testserver;
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 var gInstallUpdate = false;
 var gCheckUpdates = false;
 
@@ -297,17 +301,17 @@ function run_test() {
       id: "xpcshell@tests.mozilla.org",
       minVersion: "1",
       maxVersion: "1"
     }],
     name: "Test Addon 1",
   }, profileDir);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   startupManager();
 
   dest.remove(true);
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug554133.js
@@ -4,17 +4,17 @@
 
 // This verifies that if the AMO response provides total_results,
 // searchSucceeded is called with the correct number of total results
 
 Components.utils.import("resource://gre/modules/AddonRepository.jsm");
 
 const PREF_GETADDONS_GETSEARCHRESULTS = "extensions.getAddons.search.url";
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var server;
 
 var TESTS = [
 {
   query:      "bug554133",
   maxResults: 2,
   length:     2,
   total:      100
@@ -64,17 +64,17 @@ function run_current_test() {
 function run_test()
 {
   // Setup for test
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
 
   startupManager();
 
-  server = new nsHttpServer();
+  server = new HttpServer();
   server.registerDirectory("/", do_get_file("data"));
   server.start(4444);
 
   // Point search to the test server
   Services.prefs.setCharPref(PREF_GETADDONS_GETSEARCHRESULTS, "http://localhost:4444/test_%TERMS%.xml");
 
   do_check_neq(AddonRepository, null);
   gCurrentTest = 0;
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug570173.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug570173.js
@@ -2,26 +2,26 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that add-on update check failures are propogated correctly
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   writeInstallRDFForExtension({
     id: "addon1@tests.mozilla.org",
     version: "1.0",
     updateURL: "http://localhost:4444/data/test_missing.rdf",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug619730.js
@@ -1,14 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests whether
-do_load_httpd_js();
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
+Cu.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function load_blocklist(file) {
   Services.prefs.setCharPref("extensions.blocklist.url", "http://localhost:4444/data/" + file);
   var blocklist = Cc["@mozilla.org/extensions/blocklist;1"].
                   getService(Ci.nsITimerCallback);
   blocklist.notify(null);
@@ -17,17 +21,17 @@ function load_blocklist(file) {
 var gSawGFX = false;
 var gSawTest = false;
 
 // Performs the initial setup
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   Services.obs.addObserver(function(aSubject, aTopic, aData) {
     do_check_true(aSubject instanceof AM_Ci.nsIDOMElement);
     do_check_eq(aSubject.getAttribute("testattr"), "GFX");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug620837.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug620837.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 const PREF_BLOCKLIST_LASTUPDATETIME   = "app.update.lastUpdateTime.blocklist-background-update-timer";
 const PREF_BLOCKLIST_PINGCOUNTTOTAL   = "extensions.blocklist.pingCountTotal";
 const PREF_BLOCKLIST_PINGCOUNTVERSION = "extensions.blocklist.pingCountVersion";
 
 const SECONDS_IN_DAY = 60 * 60 * 24;
 
 var gExpectedQueryString = null;
@@ -23,17 +23,17 @@ function notify_blocklist() {
 function pathHandler(metadata, response) {
   do_check_eq(metadata.queryString, gExpectedQueryString);
   gNextTest();
 }
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerPathHandler("/", pathHandler);
   gTestserver.start(4444);
 
   Services.prefs.setCharPref("extensions.blocklist.url",
                              "http://localhost:4444/?%PING_COUNT%&%TOTAL_PING_COUNT%&%DAYS_SINCE_LAST_PING%");
 
   do_test_pending();
   test1();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug655254.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug655254.js
@@ -8,17 +8,17 @@
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 // Enable loading extensions from the user and system scopes
 Services.prefs.setIntPref("extensions.enabledScopes",
                           AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_USER);
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9.2");
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 var userDir = gProfD.clone();
 userDir.append("extensions2");
 userDir.append(gAppInfo.ID);
 
 var dirProvider = {
   getFile: function(aProp, aPersistent) {
@@ -45,17 +45,17 @@ var addon1 = {
   }]
 };
 
 // Set up the profile
 function run_test() {
   do_test_pending();
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.start(4444);
 
   run_test_1();
 }
 
 function end_test() {
   testserver.stop(do_test_finished);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_compatoverrides.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_compatoverrides.js
@@ -13,17 +13,17 @@ const BASE_URL        = "http://localhos
 const DEFAULT_URL     = "about:blank";
 const REQ_URL         = "/data.xml";
 
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
 Services.prefs.setBoolPref(PREF_GETADDONS_CACHE_ENABLED, true);
 Services.prefs.setCharPref(PREF_GETADDONS_BYIDS,
                            BASE_URL + REQ_URL);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var gServer;
 
 
 // Not hosted, no overrides
 var addon1 = {
   id: "addon1@tests.mozilla.org",
   version: "1.0",
   name: "Test addon 1",
@@ -174,17 +174,17 @@ function run_test() {
   writeInstallRDFForExtension(addon4, profileDir);
   writeInstallRDFForExtension(addon5, profileDir);
   writeInstallRDFForExtension(addon6, profileDir);
   writeInstallRDFForExtension(addon7, profileDir);
   writeInstallRDFForExtension(addon8, profileDir);
   writeInstallRDFForExtension(addon9, profileDir);
   writeInstallRDFForExtension(addon10, profileDir);
 
-  gServer = new nsHttpServer();
+  gServer = new HttpServer();
   gServer.registerFile(REQ_URL, do_get_file("data/test_compatoverrides.xml"));
   gServer.start(PORT);
 
   startupManager();
 
   trigger_background_update(run_test_1);
 }
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Checks that we rebuild something sensible from a corrupt database
 
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
 
 // Will be enabled
 var addon1 = {
@@ -139,17 +139,17 @@ function run_test() {
   writeInstallRDFForExtension(addon4, profileDir);
   writeInstallRDFForExtension(addon5, profileDir);
   writeInstallRDFForExtension(addon6, profileDir);
   writeInstallRDFForExtension(addon7, profileDir);
   writeInstallRDFForExtension(theme1, profileDir);
   writeInstallRDFForExtension(theme2, profileDir);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.start(4444);
 
   // Startup the profile and setup the initial state
   startupManager();
 
   AddonManager.getAddonsByIDs(["addon2@tests.mozilla.org",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_corrupt_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_corrupt_strictcompat.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Checks that we rebuild something sensible from a corrupt database
 
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
 
 // Will be enabled
 var addon1 = {
@@ -139,17 +139,17 @@ function run_test() {
   writeInstallRDFForExtension(addon4, profileDir);
   writeInstallRDFForExtension(addon5, profileDir);
   writeInstallRDFForExtension(addon6, profileDir);
   writeInstallRDFForExtension(addon7, profileDir);
   writeInstallRDFForExtension(theme1, profileDir);
   writeInstallRDFForExtension(theme2, profileDir);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.start(4444);
 
   // Startup the profile and setup the initial state
   startupManager();
 
   AddonManager.getAddonsByIDs(["addon2@tests.mozilla.org",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_dictionary.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_dictionary.js
@@ -13,17 +13,17 @@ createAppInfo("xpcshell@tests.mozilla.or
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 const userExtDir = gProfD.clone();
 userExtDir.append("extensions2");
 userExtDir.append(gAppInfo.ID);
 registerDirectory("XREUSysExt", userExtDir.parent);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 /**
  * This object is both a factory and an mozISpellCheckingEngine implementation (so, it
  * is de-facto a service). It's also an interface requestor that gives out
  * itself when asked for mozISpellCheckingEngine.
  */
 var HunspellEngine = {
@@ -94,17 +94,17 @@ var HunspellEngine = {
     });
   }
 };
 
 function run_test() {
   do_test_pending();
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   startupManager();
 
   run_test_1();
 }
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
@@ -40,17 +40,17 @@ var addon2 = {
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 profileDir.create(AM_Ci.nsILocalFile.DIRECTORY_TYPE, 0755);
 
 const sourceDir = gProfD.clone();
 sourceDir.append("source");
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 function writePointer(aId, aName) {
   let file = profileDir.clone();
   file.append(aName ? aName : aId);
 
   let target = sourceDir.clone();
   target.append(do_get_expected_addon_name(aId));
@@ -65,19 +65,19 @@ function writePointer(aId, aName) {
 }
 
 function writeRelativePointer(aId, aName) {
   let file = profileDir.clone();
   file.append(aName ? aName : aId);
 
   let absTarget = sourceDir.clone();
   absTarget.append(do_get_expected_addon_name(aId));
-  
-  var relTarget = absTarget.QueryInterface(Ci.nsILocalFile)
-                       .getRelativeDescriptor(profileDir);
+
+  var relTarget = absTarget.QueryInterface(AM_Ci.nsILocalFile)
+                           .getRelativeDescriptor(profileDir);
 
   var fos = AM_Cc["@mozilla.org/network/file-output-stream;1"].
             createInstance(AM_Ci.nsIFileOutputStream);
   fos.init(file,
            FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE | FileUtils.MODE_TRUNCATE,
            FileUtils.PERMS_FILE, 0);
   fos.write(relTarget, relTarget.length);
   fos.close();
@@ -87,17 +87,17 @@ function run_test() {
   // pointer files only work with unpacked directories
   if (Services.prefs.getBoolPref("extensions.alwaysUnpack") == false)
     return;
 
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   run_test_1();
 }
 
 function end_test() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Device.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which differs only on device ID, but otherwise
 // exactly matches the blacklist entry, is not blocked.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -63,17 +63,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("aabb");
       gfxInfo.spoofDriverVersion("5");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_DriverNew.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a new-enough driver bypasses the blacklist, even if the rest of
 // the attributes match the blacklist entry.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -62,17 +62,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("wxyz");
       gfxInfo.spoofDriverVersion("6");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverNew.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which is newer than the equal
 // blacklist entry is allowed.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -62,17 +62,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("uiop");
       gfxInfo.spoofDriverVersion("6");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_DriverOld.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which is older than the equal
 // blacklist entry is correctly allowed.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -62,17 +62,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("uiop");
       gfxInfo.spoofDriverVersion("4");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Equal_OK.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which exactly matches the equal
 // blacklist entry is successfully blocked.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -62,17 +62,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("uiop");
       gfxInfo.spoofDriverVersion("5");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_DriverOld.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which is lower than the greater-than-or-equal
 // blacklist entry is allowed.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -62,17 +62,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("ghjk");
       gfxInfo.spoofDriverVersion("6");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_GTE_OK.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which exactly matches the greater-than-or-equal
 // blacklist entry is successfully blocked.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -62,17 +62,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("ghjk");
       gfxInfo.spoofDriverVersion("7");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_No_Comparison.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which exactly matches the blacklist entry is
 // successfully blocked.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -56,17 +56,17 @@ function run_test() {
       break;
     case "Android":
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OK.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which exactly matches the blacklist entry is
 // successfully blocked.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -63,17 +63,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("asdf");
       gfxInfo.spoofDriverVersion("5");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_OS.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which differs only on OS version, but otherwise
 // exactly matches the blacklist entry, is not blocked.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -64,17 +64,17 @@ function run_test() {
       // there's so many of them).
       do_test_finished();
       return;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_Vendor.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether a machine which differs only on vendor, but otherwise
 // exactly matches the blacklist entry, is not blocked.
 // Uses test_gfxBlacklist.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -63,17 +63,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("asdf");
       gfxInfo.spoofDriverVersion("5");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function checkBlacklist()
   {
     var status = gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_prefs.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test whether the blacklist succesfully adds and removes the prefs that store
 // its decisions when the remote blacklist is changed.
 // Uses test_gfxBlacklist.xml and test_gfxBlacklist2.xml
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 
 var gTestserver = null;
 
 function get_platform() {
   var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"]
                              .getService(Components.interfaces.nsIXULRuntime);
   return xulRuntime.OS;
 }
@@ -63,17 +63,17 @@ function run_test() {
       gfxInfo.spoofDeviceID("asdf");
       gfxInfo.spoofDriverVersion("5");
       break;
   }
 
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3", "8");
   startupManager();
 
-  gTestserver = new nsHttpServer();
+  gTestserver = new HttpServer();
   gTestserver.registerDirectory("/data/", do_get_file("data"));
   gTestserver.start(4444);
 
   do_test_pending();
 
   function blacklistAdded(aSubject, aTopic, aData)
   {
     // If we wait until after we go through the event loop, gfxInfo is sure to
--- a/toolkit/mozapps/extensions/test/xpcshell/test_hotfix.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_hotfix.js
@@ -4,26 +4,26 @@
 
 // This verifies that hotfix installation works
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 // Ignore any certificate requirements the app has set
 Services.prefs.setBoolPref("extensions.hotfix.cert.checkAttributes", false);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   startupManager();
 
   do_test_pending();
   run_test_1();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_install.js
@@ -1,26 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that add-ons can be installed from XPI files
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
 
 // Maximum error in file modification times. Some file systems don't store
 // modification times exactly. As long as we are closer than this then it
 // still passes.
 const MAX_TIME_DIFFERENCE = 3000;
 
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-
 // install.rdf size, icon.png, icon64.png size
 const ADDON1_SIZE = 705 + 16 + 16;
 
-do_load_httpd_js();
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/NetUtil.jsm");
+Cu.import("resource://testing-common/httpd.js");
+
 var testserver;
 var gInstallDate;
 var gInstall = null;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
 
@@ -33,17 +36,17 @@ function run_test() {
   startupManager();
   // Make sure we only register once despite multiple calls
   AddonManager.addInstallListener(InstallListener);
   AddonManager.addAddonListener(AddonListener);
   AddonManager.addInstallListener(InstallListener);
   AddonManager.addAddonListener(AddonListener);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerPathHandler("/redirect", function(aRequest, aResponse) {
     aResponse.setStatusLine(null, 301, "Moved Permanently");
     let url = aRequest.host + ":" + aRequest.port + aRequest.queryString;
     aResponse.setHeader("Location", "http://" + url);
   });
   testserver.start(4444);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_install_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_install_strictcompat.js
@@ -1,26 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that add-ons can be installed from XPI files
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
 
 // Maximum error in file modification times. Some file systems don't store
 // modification times exactly. As long as we are closer than this then it
 // still passes.
 const MAX_TIME_DIFFERENCE = 3000;
 
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-
 // install.rdf size, icon.png, icon64.png size
 const ADDON1_SIZE = 705 + 16 + 16;
 
-do_load_httpd_js();
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/NetUtil.jsm");
+Cu.import("resource://testing-common/httpd.js");
+
 var testserver;
 var gInstallDate;
 var gInstall = null;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
 
@@ -34,17 +37,17 @@ function run_test() {
   startupManager();
   // Make sure we only register once despite multiple calls
   AddonManager.addInstallListener(InstallListener);
   AddonManager.addAddonListener(AddonListener);
   AddonManager.addInstallListener(InstallListener);
   AddonManager.addAddonListener(AddonListener);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerPathHandler("/redirect", function(aRequest, aResponse) {
     aResponse.setStatusLine(null, 301, "Moved Permanently");
     let url = aRequest.host + ":" + aRequest.port + aRequest.queryString;
     aResponse.setHeader("Location", "http://" + url);
   });
   testserver.start(4444);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_locked.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_locked.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Checks that we rebuild something sensible from a corrupt database
 
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
 
 // Will be enabled
 var addon1 = {
@@ -139,17 +139,17 @@ function run_test() {
   writeInstallRDFForExtension(addon4, profileDir);
   writeInstallRDFForExtension(addon5, profileDir);
   writeInstallRDFForExtension(addon6, profileDir);
   writeInstallRDFForExtension(addon7, profileDir);
   writeInstallRDFForExtension(theme1, profileDir);
   writeInstallRDFForExtension(theme2, profileDir);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.start(4444);
 
   // Startup the profile and setup the initial state
   startupManager();
 
   AddonManager.getAddonsByIDs(["addon2@tests.mozilla.org",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_locked_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_locked_strictcompat.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Checks that we rebuild something sensible from a corrupt database
 
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
 
 // Will be enabled
 var addon1 = {
@@ -139,17 +139,17 @@ function run_test() {
   writeInstallRDFForExtension(addon4, profileDir);
   writeInstallRDFForExtension(addon5, profileDir);
   writeInstallRDFForExtension(addon6, profileDir);
   writeInstallRDFForExtension(addon7, profileDir);
   writeInstallRDFForExtension(theme1, profileDir);
   writeInstallRDFForExtension(theme2, profileDir);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.start(4444);
 
   // Startup the profile and setup the initial state
   startupManager();
 
   AddonManager.getAddonsByIDs(["addon2@tests.mozilla.org",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js
@@ -86,26 +86,26 @@ var defaultTheme = {
     minVersion: "1",
     maxVersion: "2"
   }]
 };
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 let oldSyncGUIDs = {};
 
 function prepare_profile() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   writeInstallRDFForExtension(addon1, profileDir);
   writeInstallRDFForExtension(addon2, profileDir);
   writeInstallRDFForExtension(addon3, profileDir);
   writeInstallRDFForExtension(addon4, profileDir);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update.js
@@ -19,30 +19,30 @@ Services.prefs.setBoolPref("lightweightT
 Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm");
 
 const PARAMS = "?%REQ_VERSION%/%ITEM_ID%/%ITEM_VERSION%/%ITEM_MAXAPPVERSION%/" +
                "%ITEM_STATUS%/%APP_ID%/%APP_VERSION%/%CURRENT_APP_VERSION%/" +
                "%APP_OS%/%APP_ABI%/%APP_LOCALE%/%UPDATE_TYPE%";
 
 var gInstallDate;
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 let originalSyncGUID;
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
   Services.prefs.setBoolPref(PREF_MATCH_OS_LOCALE, false);
   Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "fr-FR");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   writeInstallRDFForExtension({
     id: "addon1@tests.mozilla.org",
     version: "1.0",
     updateURL: "http://localhost:4444/data/test_update.rdf",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
@@ -4,17 +4,17 @@
 
 // This verifies that add-on update check correctly fills in the
 // %COMPATIBILITY_MODE% token in the update URL.
 
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 var COMPATIBILITY_PREF;
 
 function run_test() {
   do_test_pending();
@@ -25,21 +25,21 @@ function run_test() {
     channel = Services.prefs.getCharPref("app.update.channel");
   } catch (e) { }
   if (channel != "aurora" &&
       channel != "beta" &&
       channel != "release") {
     var version = "nightly";
   } else {
     version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
-  }  
+  }
   COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   writeInstallRDFForExtension({
     id: "compatmode-normal@tests.mozilla.org",
     version: "1.0",
     updateURL: "http://localhost:4444/data/test_updatecompatmode_%COMPATIBILITY_MODE%.rdf",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update_ignorecompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update_ignorecompat.js
@@ -6,27 +6,27 @@
 // check is disabled.
 
 const PREF_GETADDONS_BYIDS_PERFORMANCE = "extensions.getAddons.getWithPerformance.url";
 const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   run_test_1();
 }
 
 // Test that the update check correctly observes the
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update_strictcompat.js
@@ -18,29 +18,29 @@ Services.prefs.setBoolPref("lightweightT
 Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm");
 
 const PARAMS = "?%REQ_VERSION%/%ITEM_ID%/%ITEM_VERSION%/%ITEM_MAXAPPVERSION%/" +
                "%ITEM_STATUS%/%APP_ID%/%APP_VERSION%/%CURRENT_APP_VERSION%/" +
                "%APP_OS%/%APP_ABI%/%APP_LOCALE%/%UPDATE_TYPE%";
 
 var gInstallDate;
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
   Services.prefs.setBoolPref(PREF_MATCH_OS_LOCALE, false);
   Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "fr-FR");
   Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   writeInstallRDFForExtension({
     id: "addon1@tests.mozilla.org",
     version: "1.0",
     updateURL: "http://localhost:4444/data/test_update.rdf",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
@@ -3,34 +3,34 @@
  */
 
 // This verifies that AddonUpdateChecker works correctly
 
 Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
 
 var COMPATIBILITY_PREF;
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   var channel = "default";
   try {
     channel = Services.prefs.getCharPref("app.update.channel");
   } catch (e) { }
   if (channel != "aurora" && channel != "beta" && channel != "release")
     var version = "nightly";
   else
     version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
   COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.start(4444);
 
   do_test_pending();
   run_test_1();
 }
 
 function end_test() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updateid.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updateid.js
@@ -2,17 +2,17 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that updating an add-on to a new ID works
 
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
 
-do_load_httpd_js();
+Components.utils.import("resource://testing-common/httpd.js");
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
 function resetPrefs() {
   Services.prefs.setIntPref("bootstraptest.active_version", -1);
   Services.prefs.setIntPref("bootstraptest.installed_version", -1);
   Services.prefs.setIntPref("bootstraptest.startup_reason", -1);
@@ -28,17 +28,17 @@ function getActiveVersion() {
 function getInstalledVersion() {
   return Services.prefs.getIntPref("bootstraptest.installed_version");
 }
 
 function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
   // Create and configure the HTTP server.
-  testserver = new nsHttpServer();
+  testserver = new HttpServer();
   testserver.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   do_test_pending();
   run_test_1();
 }