Follow-on fix for bug 457825. Use sheet principal for agent and user sheets. r=dbaron...
[wine-gecko.git] / netwerk / test / unit / test_bug412945.js
bloba6bb217923c9ca56e21872c14e6c77bd882cb391
1 do_import_script("netwerk/test/httpserver/httpd.js");
3 var httpserv;
5 function TestListener() {
8 TestListener.prototype.onStartRequest = function(request, context) {
11 TestListener.prototype.onStopRequest = function(request, context, status) {
12 httpserv.stop();
13 do_test_finished();
16 function run_test() {
17 httpserv = new nsHttpServer();
19 httpserv.registerPathHandler("/bug412945", bug412945);
21 httpserv.start(4444);
23 // make request
24 var channel =
25 Components.classes["@mozilla.org/network/io-service;1"].
26 getService(Components.interfaces.nsIIOService).
27 newChannel("http://localhost:4444/bug412945", null, null);
29 channel.QueryInterface(Components.interfaces.nsIHttpChannel);
30 channel.requestMethod = "post";
31 channel.asyncOpen(new TestListener(), null);
33 do_test_pending();
36 function bug412945(metadata, response) {
37 if (!metadata.hasHeader("Content-Length") ||
38 metadata.getHeader("Content-Length") != "0")
40 do_throw("Content-Length header not found!");