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
Родитель 73af5c7ce6
Коммит 286d58e1ae
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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).