Bug 889034 - Use a dynamic port in places/ xpcshell tests so they can be run in parallel. r=mak

This commit is contained in:
Mihnea Dobrescu-Balaur 2013-07-10 16:43:44 -07:00
Родитель cbe020acda
Коммит 85bc4fa046
1 изменённых файлов: 3 добавлений и 5 удалений

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

@ -14,7 +14,8 @@ const TEMP_REDIR_PATH = "/tempredir";
const FOUND_PATH = "/found";
const HTTPSVR = new HttpServer();
const PORT = 4444;
HTTPSVR.start(-1);
const PORT = HTTPSVR.identity.primaryPort;
HTTPSVR.registerPathHandler(PERMA_REDIR_PATH, permaRedirHandler);
HTTPSVR.registerPathHandler(TEMP_REDIR_PATH, tempRedirHandler);
HTTPSVR.registerPathHandler(FOUND_PATH, foundHandler);
@ -61,10 +62,7 @@ function PathHandler(aMeta, aResponse, aChannelEvent, aRedirURL) {
function run_test() {
do_test_pending();
HTTPSVR.start(PORT);
var chan = NetUtil.ioService
.newChannelFromURI(uri("http://localhost:4444/permaredir"));
var chan = NetUtil.ioService.newChannelFromURI(uri(PERMA_REDIR_URL));
var listener = new ChannelListener();
chan.notificationCallbacks = listener;
chan.asyncOpen(listener, null);