1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 const { HttpServer } = ChromeUtils.importESModule(
8 "resource://testing-common/httpd.sys.mjs"
11 const SERVER_PORT = 8080;
12 const baseURL = "http://localhost:" + SERVER_PORT + "/";
15 for (let i = 0; i < 10000; i++) {
16 cookie += " big cookie";
20 onStartRequest(request) {},
22 onDataAvailable(request, stream) {},
24 onStopRequest(request, status) {
25 Assert.equal(status, Cr.NS_OK);
26 server.stop(do_test_finished);
30 var server = new HttpServer();
32 server.start(SERVER_PORT);
33 server.registerPathHandler("/", function (metadata, response) {
34 response.setStatusLine(metadata.httpVersion, 200, "OK");
35 response.setHeader("Set-Cookie", "BigCookie=" + cookie, false);
36 response.write("Hello world");
38 var chan = NetUtil.newChannel({
40 loadUsingSystemPrincipal: true,
41 }).QueryInterface(Ci.nsIHttpChannel);
42 chan.asyncOpen(listener);