2012-08-14 18:06:04 +04:00
|
|
|
Cu.import("resource://testing-common/httpd.js");
|
2015-12-19 00:31:16 +03:00
|
|
|
Cu.import("resource://gre/modules/NetUtil.jsm");
|
2011-07-24 15:46:33 +04:00
|
|
|
|
|
|
|
const SERVER_PORT = 8080;
|
|
|
|
const baseURL = "http://localhost:" + SERVER_PORT + "/";
|
|
|
|
|
|
|
|
var cookie = "";
|
|
|
|
for (let i =0; i < 10000; i++) {
|
|
|
|
cookie += " big cookie";
|
|
|
|
}
|
|
|
|
|
|
|
|
var listener = {
|
|
|
|
onStartRequest: function (request, ctx) {
|
|
|
|
},
|
|
|
|
|
|
|
|
onDataAvailable: function (request, ctx, stream) {
|
|
|
|
},
|
|
|
|
|
|
|
|
onStopRequest: function (request, ctx, status) {
|
|
|
|
do_check_eq(status, Components.results.NS_OK);
|
|
|
|
do_test_finished();
|
|
|
|
},
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
function run_test() {
|
2012-08-14 18:06:04 +04:00
|
|
|
var server = new HttpServer();
|
2011-07-24 15:46:33 +04:00
|
|
|
server.start(SERVER_PORT);
|
|
|
|
server.registerPathHandler('/', function(metadata, response) {
|
|
|
|
response.setStatusLine(metadata.httpVersion, 200, "OK");
|
|
|
|
response.setHeader("Set-Cookie", "BigCookie=" + cookie, false);
|
|
|
|
response.write("Hello world");
|
|
|
|
});
|
2015-12-19 00:31:16 +03:00
|
|
|
var chan = NetUtil.newChannel({uri: baseURL, loadUsingSystemPrincipal: true})
|
|
|
|
.QueryInterface(Components.interfaces.nsIHttpChannel);
|
|
|
|
chan.asyncOpen2(listener);
|
2011-07-24 15:46:33 +04:00
|
|
|
do_test_pending();
|
|
|
|
}
|