/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et: */ /* 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/. */
/* * Tests for correct behavior of the server start() and stop() methods.
*/
ChromeUtils.defineLazyGetter(this, "PORT", function () { return srv.identity.primaryPort;
});
ChromeUtils.defineLazyGetter(this, "PREPATH", function () { return"http://localhost:" + PORT;
});
var srv, srv2;
function run_test() { if (mozinfo.os == "win") {
dumpn( "*** not running test_start_stop.js on Windows for now, because " + "Windows is dumb"
); return;
}
dumpn("*** run_test");
srv = createServer();
srv.start(-1);
try {
srv.start(PORT);
do_throw("starting a started server");
} catch (e) {
isException(e, Cr.NS_ERROR_ALREADY_INITIALIZED);
}
// Don't rely on the exact (but implementation-constant) sequence of events // as it currently exists by making either run_test_5 or serverStopped handle // the final shutdown.
do_test_pending();
var stopped = false; function serverStopped() {
dumpn("*** server really, fully shut down now");
stopped = true; if (testsComplete) {
do_test_finished();
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.