Hi folks, I would like to announce that we recently moved NodeServer classes from head_servers.js into a sys.mjs module <https://searchfox.org/firefox-main/source/netwerk/test/httpserver/NodeServer.sys.mjs> that is usable in xpcshell-tests anywhere in the tree. Previously if you wanted to set up a server for your tests you probably used httpd.sys.js <https://firefox-source-docs.mozilla.org/networking/http_server_for_testing.html>which had Firefox set up a very simple HTTP server. This server lacked basic features like connection reuse and HTTPS support. The other alternative was using moz-http2.js - which is a nodejs server implementation that is spawned by the test runner and shared state across all test runs.
The new classes spawn a different nodejs server instance for every instance, set up certificates for you and are well documented: https://firefox-source-docs.mozilla.org/networking/NodeServers.html Feel free to use the new servers in xpcshell tests. If you encounter any issues please file a bug blocking Bug 1988139 <https://bugzilla.mozilla.org/show_bug.cgi?id=1988139>. If there is interest for it, we might also extend this to work in mochitests. Thanks! -- You received this message because you are subscribed to the Google Groups "[email protected]" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/CACQYfiJRkgU4OmrrSwM3Q_phmeci9ijLc1SpNM2s826URjXZVg%40mail.gmail.com.
