Bug 741972 - Test failures on ESR when channel is set to ESR, TEST-UNEXPECTED-FAIL | test_AddonRepository_compatmode.js | compatmode-strict@tests.mozilla.org == compatmode-ignore@tests.mozilla.org and more. Change tests to re-use the new AddonManager.checkCompatibility attribute for future-proofing channel additions/changes. r=bmcbride
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 17 Apr 2012 10:24:24 +0100
changeset 91842 993d0e9edd3f30122fad0bd27ffb280b02cca4b2
parent 91841 e5cd53eb0cf9d5af4bf620886fd198b6370848a9
child 91843 8a1dc2f6e8108f3ffbf161c61afeff346f79a5e0
push id22480
push useremorley@mozilla.com
push dateWed, 18 Apr 2012 00:48:48 +0000
treeherdermozilla-central@93dfd98900ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbmcbride
bugs741972
milestone14.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 741972 - Test failures on ESR when channel is set to ESR, TEST-UNEXPECTED-FAIL | test_AddonRepository_compatmode.js | compatmode-strict@tests.mozilla.org == compatmode-ignore@tests.mozilla.org and more. Change tests to re-use the new AddonManager.checkCompatibility attribute for future-proofing channel additions/changes. r=bmcbride
toolkit/mozapps/extensions/test/browser/browser_globalwarnings.js
toolkit/mozapps/extensions/test/browser/browser_searching.js
toolkit/mozapps/extensions/test/xpcshell/head_addons.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_compatmode.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_2.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_3.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_3_strictcompat.js
toolkit/mozapps/extensions/test/xpcshell/test_bug470377_4.js
toolkit/mozapps/extensions/test/xpcshell/test_bug521905.js
toolkit/mozapps/extensions/test/xpcshell/test_checkcompatibility.js
toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js
toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
--- a/toolkit/mozapps/extensions/test/browser/browser_globalwarnings.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_globalwarnings.js
@@ -11,33 +11,18 @@ function test() {
 
 function end_test() {
   finish();
 }
 
 add_test(function() {
   info("Testing compatibility checking warning");
 
-  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");
-  }
-
-  var pref = "extensions.checkCompatibility." + version;
-  info("Setting " + pref + " pref to false")
-  Services.prefs.setBoolPref(pref, false);
+  info("Setting checkCompatibility to false");
+  AddonManager.checkCompatibility = false;
 
   open_manager("addons://list/extension", function(aWindow) {
     var hbox = aWindow.document.querySelector("#list-view hbox.global-warning-checkcompatibility");
     is_element_visible(hbox, "Check Compatibility warning hbox should be visible");
     var button = aWindow.document.querySelector("#list-view button.global-warning-checkcompatibility");
     is_element_visible(button, "Check Compatibility warning button should be visible");
 
     info("Clicking 'Enable' button");
--- a/toolkit/mozapps/extensions/test/browser/browser_searching.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_searching.js
@@ -14,32 +14,16 @@ const REMOTE_TO_INSTALL = "remote1";
 const REMOTE_INSTALL_URL = TESTROOT + "addons/browser_searching.xpi";
 
 var gManagerWindow;
 var gCategoryUtilities;
 var gProvider;
 var gServer;
 var gAddonInstalled = false;
 
-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");
-}
-
-const COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
-
 function test() {
   requestLongerTimeout(2);
   // Turn on searching for this test
   Services.prefs.setIntPref(PREF_SEARCH_MAXRESULTS, 15);
   Services.prefs.setBoolPref(PREF_STRICT_COMPAT, true);
 
   waitForExplicitFinish();
 
@@ -603,26 +587,26 @@ add_test(function() {
       check_filtered_results(QUERY, "relevancescore", false);
       run_next_test();
     });
   });
 });
 
 // Tests that incompatible add-ons are shown with a warning if compatibility checking is disabled
 add_test(function() {
-  Services.prefs.setBoolPref(COMPATIBILITY_PREF, false);
+  AddonManager.checkCompatiblity = false;
   search("incompatible", false, function() {
     var item = get_addon_item("remote5");
     is_element_visible(item, "Incompatible addon should be visible");
     is(item.getAttribute("notification"), "warning", "Compatibility warning should be shown");
 
     var item = get_addon_item("remote6");
     is(item, null, "Addon incompatible with the product should not be visible");
 
-    Services.prefs.clearUserPref(COMPATIBILITY_PREF);
+    AddonManager.checkCompatiblity = true;
     run_next_test();
   });
 });
 
 // Tests that compatible-by-default addons are shown if strict compatibility checking is disabled
 add_test(function() {
   restart_manager(gManagerWindow, null, function(aWindow) {
     gManagerWindow = aWindow;
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -21,16 +21,20 @@ Components.utils.import("resource://gre/
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
 
 var gInternalManager = null;
 var gAppInfo = null;
 var gAddonsList;
 
 var TEST_UNPACKED = false;
 
+function isNightlyChannel(channel) {
+  return channel != "aurora" && channel != "beta" && channel != "release" && channel != "esr";
+}
+
 function createAppInfo(id, name, version, platformVersion) {
   gAppInfo = {
     // nsIXULAppInfo
     vendor: "Mozilla",
     name: name,
     ID: id,
     version: version,
     appBuildID: "2007010101",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_compatmode.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_compatmode.js
@@ -10,29 +10,16 @@ const PREF_GETADDONS_GETSEARCHRESULTS   
 do_load_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";
-  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.
   gServer = new nsHttpServer();
   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();
@@ -79,17 +66,17 @@ function run_test_2() {
       do_throw("Search should not have failed");
     }
   });
 }
 
 // Compatibility checking disabled.
 function run_test_3() {
   do_print("Testing with all compatibility checking disabled");
-  Services.prefs.setBoolPref(COMPATIBILITY_PREF, false);
+  AddonManager.checkCompatibility = false;
 
   AddonRepository.searchAddons("test", 6, {
     searchSucceeded: function(aAddons) {
       do_check_neq(aAddons, null);
       do_check_eq(aAddons.length, 1);
       do_check_eq(aAddons[0].id, "compatmode-ignore@tests.mozilla.org");
 
       end_test();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_2.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_2.js
@@ -33,31 +33,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL
  *
  * ***** END LICENSE BLOCK *****
  */
 
 // Disables security checking our updates which haven't been signed
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
-// Disables compatibility checking
-var channel = "default";
-try {
-  channel = Services.prefs.getCharPref("app.update.channel");
-}
-catch (e) { }
 
-if (channel != "aurora" &&
-    channel != "beta" &&
-    channel != "release") {
-  Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
-}
-else {
-  Services.prefs.setBoolPref("extensions.checkCompatibility.2", false);
-}
+AddonManager.checkCompatibility = false;
 
 var ADDONS = [
   "test_bug470377_1",
   "test_bug470377_2",
   "test_bug470377_3",
   "test_bug470377_4",
   "test_bug470377_5",
 ];
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_3.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_3.js
@@ -97,31 +97,18 @@ function run_test_1() {
     do_check_neq(a5, null);
     do_check_true(a5.isActive);
 
     run_test_2();
   });
 }
 
 function run_test_2() {
-  // Disable compatibility checks
-  var channel = "default";
-  try {
-    channel = Services.prefs.getCharPref("app.update.channel");
-  }
-  catch (e) { }
+  AddonManager.checkCompatibility = false;
 
-  if (channel != "aurora" &&
-      channel != "beta" &&
-      channel != "release") {
-    Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
-  }
-  else {
-    Services.prefs.setBoolPref("extensions.checkCompatibility.2.2", false);
-  }
   restartManager();
 
   AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
                                "bug470377_2@tests.mozilla.org",
                                "bug470377_3@tests.mozilla.org",
                                "bug470377_4@tests.mozilla.org",
                                "bug470377_5@tests.mozilla.org"],
                                function([a1, a2, a3, a4, a5]) {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_3_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_3_strictcompat.js
@@ -96,31 +96,18 @@ function run_test_1() {
     do_check_neq(a5, null);
     do_check_true(a5.isActive);
 
     run_test_2();
   });
 }
 
 function run_test_2() {
-  // Disable compatibility checks
-  var channel = "default";
-  try {
-    channel = Services.prefs.getCharPref("app.update.channel");
-  }
-  catch (e) { }
+  AddonManager.checkCompatibility = false;
 
-  if (channel != "aurora" &&
-      channel != "beta" &&
-      channel != "release") {
-    Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
-  }
-  else {
-    Services.prefs.setBoolPref("extensions.checkCompatibility.2.2", false);
-  }
   restartManager();
 
   AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
                                "bug470377_2@tests.mozilla.org",
                                "bug470377_3@tests.mozilla.org",
                                "bug470377_4@tests.mozilla.org",
                                "bug470377_5@tests.mozilla.org"],
                                function([a1, a2, a3, a4, a5]) {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_4.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug470377_4.js
@@ -31,31 +31,16 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL
  *
  * ***** END LICENSE BLOCK *****
  */
 
-var channel = "default";
-try {
-  channel = Services.prefs.getCharPref("app.update.channel");
-}
-catch (e) { }
-
-if (channel != "aurora" &&
-    channel != "beta" &&
-    channel != "release") {
-  var checkCompatPref = "extensions.checkCompatibility.nightly";
-}
-else {
-  checkCompatPref = "extensions.checkCompatibility.2.1a";
-}
-
 function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.1a4", "2");
 
   // inject the add-ons into the profile
   var profileDir = gProfD.clone();
   profileDir.append("extensions");
   var dest = profileDir.clone();
@@ -83,18 +68,18 @@ function run_test() {
   dest.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0755);
   source = do_get_file("data/test_bug470377/install_5.rdf");
   source.copyTo(dest, "install.rdf");
 
   run_test_1();
 }
 
 function run_test_1() {
-  // Disable compatibility checks
-  Services.prefs.setBoolPref(checkCompatPref, false);
+  AddonManager.checkCompatibility = false;
+
   startupManager();
 
   AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
                                "bug470377_2@tests.mozilla.org",
                                "bug470377_3@tests.mozilla.org",
                                "bug470377_4@tests.mozilla.org",
                                "bug470377_5@tests.mozilla.org"],
                                function([a1, a2, a3, a4, a5]) {
@@ -109,18 +94,18 @@ function run_test_1() {
     do_check_neq(a5, null);
     do_check_true(a5.isActive);
 
     run_test_2();
   });
 }
 
 function run_test_2() {
-  // Enable compatibility checks
-  Services.prefs.setBoolPref(checkCompatPref, true);
+  AddonManager.checkCompatibility = true;
+
   restartManager();
 
   AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
                                "bug470377_2@tests.mozilla.org",
                                "bug470377_3@tests.mozilla.org",
                                "bug470377_4@tests.mozilla.org",
                                "bug470377_5@tests.mozilla.org"],
                                function([a1, a2, a3, a4, a5]) {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug521905.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug521905.js
@@ -36,31 +36,28 @@
  * ***** END LICENSE BLOCK *****
  */
 
 const ADDON = "test_bug521905";
 const ID = "bug521905@tests.mozilla.org";
 
 // Disables security checking our updates which haven't been signed
 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
-// Disables compatibility checking
-Services.prefs.setBoolPref("extensions.checkCompatibility.2.0pre", false);
+AddonManager.checkCompatibility = false;
 
 function run_test() {
   var channel = "default";
   try {
     channel = Services.prefs.getCharPref("app.update.channel");
   }
   catch (e) { }
 
   // This test is only relevant on builds where the version is included in the
   // checkCompatibility preference name
-  if (channel != "aurora" &&
-      channel != "beta" &&
-      channel != "release") {
+  if (isNightlyChannel(channel)) {
     return;
   }
 
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.0pre", "2");
 
   startupManager();
   installAllFiles([do_get_addon(ADDON)], function() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_checkcompatibility.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_checkcompatibility.js
@@ -54,36 +54,24 @@ var ADDONS = [{
     minVersion: "1",
     maxVersion: "3"
   }]
 }];
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
-var gIsNightly = false;
-
 function run_test() {
   do_test_pending();
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.2.3", "2");
 
   ADDONS.forEach(function(a) {
     writeInstallRDFForExtension(a, profileDir);
   });
 
-  var channel = "default";
-  try {
-    channel = Services.prefs.getCharPref("app.update.channel");
-  }
-  catch (e) { }
-
-  gIsNightly = channel != "aurora" &&
-               channel != "beta" &&
-               channel != "release";
-
   startupManager();
 
   run_test_1();
 }
 
 /**
  * Checks that the add-ons are enabled as expected.
  * @param   overridden
@@ -140,20 +128,18 @@ function run_test_1() {
 
     run_test_2();
   });
 }
 
 // Tests that with compatibility checking disabled we see the incompatible
 // add-ons enabled
 function run_test_2() {
-  if (gIsNightly)
-    Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
-  else
-    Services.prefs.setBoolPref("extensions.checkCompatibility.2.2", false);
+  AddonManager.checkCompatibility = false;
+
   restartManager();
 
   AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
                                "addon2@tests.mozilla.org",
                                "addon3@tests.mozilla.org",
                                "addon4@tests.mozilla.org",
                                "addon5@tests.mozilla.org"],
                                function([a1, a2, a3, a4, a5]) {
@@ -161,18 +147,24 @@ function run_test_2() {
 
     run_test_3();
   });
 }
 
 // Tests that with compatibility checking disabled we see the incompatible
 // add-ons enabled.
 function run_test_3() {
-  if (!gIsNightly)
-    Services.prefs.setBoolPref("extensions.checkCompatibility.2.1a", false);
+  var channel = "default";
+  try {
+    channel = Services.prefs.getCharPref("app.update.channel");
+  }
+  catch (e) { }
+
+  if (!isNightlyChannel(channel))
+    AddonManager.checkCompatibility = false;
   restartManager("2.1a4");
 
   AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
                                "addon2@tests.mozilla.org",
                                "addon3@tests.mozilla.org",
                                "addon4@tests.mozilla.org",
                                "addon5@tests.mozilla.org"],
                                function([a1, a2, a3, a4, a5]) {
@@ -180,20 +172,18 @@ function run_test_3() {
 
     run_test_4();
   });
 }
 
 // Tests that with compatibility checking enabled we see the incompatible
 // add-ons disabled.
 function run_test_4() {
-  if (gIsNightly)
-    Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", true);
-  else
-    Services.prefs.setBoolPref("extensions.checkCompatibility.2.1a", true);
+  AddonManager.checkCompatibility = true;
+
   restartManager();
 
   AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
                                "addon2@tests.mozilla.org",
                                "addon3@tests.mozilla.org",
                                "addon4@tests.mozilla.org",
                                "addon5@tests.mozilla.org"],
                                function([a1, a2, a3, a4, a5]) {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js
@@ -127,19 +127,17 @@ function run_test() {
   do_check_true(Services.prefs.getBoolPref("extensions.strictCompatibility"));
 
 
   // AddonManager.checkCompatibility
   var channel = "default";
   try {
     channel = Services.prefs.getCharPref("app.update.channel");
   } catch (e) { }
-  if (channel != "aurora" &&
-      channel != "beta" &&
-      channel != "release") {
+  if (isNightlyChannel(channel)) {
     var version = "nightly";
   } else {
     version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
   }
   const COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
 
   gManagerEventsListener.expect(["onCompatibilityModeChanged"]);
   AddonManager.checkCompatibility = false;
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
@@ -9,35 +9,20 @@
 // The test extension uses an insecure update url.
 Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
 
 do_load_httpd_js();
 var testserver;
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 
-var COMPATIBILITY_PREF;
-
 function run_test() {
   do_test_pending();
   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.registerDirectory("/data/", do_get_file("data"));
   testserver.registerDirectory("/addons/", do_get_file("addons"));
   testserver.start(4444);
 
   writeInstallRDFForExtension({
     id: "compatmode-normal@tests.mozilla.org",
@@ -169,17 +154,17 @@ function run_test_3() {
       }
     }, AddonManager.UPDATE_WHEN_USER_REQUESTED);
   });
 }
 
 // Compatibility checking disabled.
 function run_test_4() {
   do_print("Testing with all compatibility checking disabled");
-  Services.prefs.setBoolPref(COMPATIBILITY_PREF, false);
+  AddonManager.checkCompatibility = false;
   AddonManager.getAddonByID("compatmode-ignore@tests.mozilla.org", function(addon) {
     do_check_neq(addon, null);
     addon.findUpdates({
       onCompatibilityUpdateAvailable: function() {
         do_throw("Should have not have seen compatibility information");
       },
 
       onNoUpdateAvailable: function() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
@@ -1,34 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that AddonUpdateChecker works correctly
 
 Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
 
-var COMPATIBILITY_PREF;
-
 do_load_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.registerDirectory("/data/", do_get_file("data"));
   testserver.start(4444);
 
   do_test_pending();
   run_test_1();
 }