Test only - Bug 503409 - test_0030_general.js hangs on WinMo. add do_throw when the directory specified for nsHttpServer registerDirectory doesn't exist or isn't a directory. r=me

This commit is contained in:
Robert Strong 2009-07-09 15:50:45 -07:00
parent 5e37204846
commit 9a93cf2aa6
2 changed files with 11 additions and 2 deletions

View File

@ -698,9 +698,18 @@ function removeDirRecursive(aDir) {
* toolkit/mozapps/update/test/unit/
*/
function start_httpserver(aRelativeDirName) {
var dir = do_get_file(aRelativeDirName);
if (!dir.exists())
do_throw("The directory used by nsHttpServer does not exist! path: " +
dir.path + "\n");
if (!dir.isDirectory())
do_throw("A file instead of a directory was specified for nsHttpServer " +
"registerDirectory! path: " dir.path + "\n");
do_load_httpd_js();
gTestserver = new nsHttpServer();
gTestserver.registerDirectory("/data/", do_get_file(aRelativeDirName));
gTestserver.registerDirectory("/data/", dir);
gTestserver.start(4444);
}

View File

@ -39,7 +39,7 @@
/* General Update Manager Tests */
function run_test() {
dump("Testing: removing an active update for a channel that is not valid" +
dump("Testing: removing an active update for a channel that is not valid " +
"due to switching channels - bug 486275\n");
removeUpdateDirsAndFiles();
var defaults = getPrefBranch().QueryInterface(AUS_Ci.nsIPrefService).