bug 597706 - test for double content length in response header r=jduell

--HG--
extra : rebase_source : 66ce23e335720742724250d248c9947dfd4eb33c
This commit is contained in:
Patrick McManus 2011-06-02 20:48:05 -04:00
Родитель cadef387c5
Коммит 3199602600
2 изменённых файлов: 44 добавлений и 0 удалений

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

@ -0,0 +1,43 @@
do_load_httpd_js();
var httpserver = new nsHttpServer();
var index = 0;
function setupChannel(url)
{
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var chan = ios.newChannel("http://localhost:4444" + url, "", null);
var httpChan = chan.QueryInterface(Components.interfaces.nsIHttpChannel);
return httpChan;
}
function completeTest1(request, data, ctx)
{
httpserver.stop(do_test_finished);
}
function run_test()
{
httpserver.registerPathHandler("/2xcl", handler);
httpserver.start(4444);
var channel = setupChannel("/2xcl");
channel.asyncOpen(new ChannelListener(completeTest1,
channel, CL_EXPECT_FAILURE), null);
do_test_pending();
}
function handler(metadata, response)
{
var body = "012345678901234567890123456789";
response.seizePower();
response.write("HTTP/1.0 200 OK\r\n");
response.write("Content-Type: text/plain\r\n");
response.write("Content-Length: 20\r\n");
response.write("Content-Length: 30\r\n");
response.write("\r\n");
response.write(body);
response.finish();
}

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

@ -68,6 +68,7 @@ tail =
[test_cookie_header.js]
[test_data_protocol.js]
[test_dns_service.js]
[test_double_content_length.js]
[test_event_sink.js]
[test_extract_charset_from_content_type.js]
[test_fallback_no-cache-entry_canceled.js]