Follow-on fix for bug 457825. Use sheet principal for agent and user sheets. r=dbaron...
[wine-gecko.git] / netwerk / test / unit / test_bug331825.js
blobb852579c935328c32c36047f33f383f2be97c2c3
1 do_import_script("netwerk/test/httpserver/httpd.js");
3 var server;
4 const BUGID = "331825";
6 function TestListener() {
8 TestListener.prototype.onStartRequest = function(request, context) {
10 TestListener.prototype.onStopRequest = function(request, context, status) {
11 var channel = request.QueryInterface(Components.interfaces.nsIHttpChannel);
12 do_check_eq(channel.responseStatus, 304);
14 server.stop();
15 do_test_finished();
18 function run_test() {
19 // start server
20 server = new nsHttpServer();
22 server.registerPathHandler("/bug" + BUGID, bug331825);
24 server.start(4444);
26 // make request
27 var channel =
28 Components.classes["@mozilla.org/network/io-service;1"].
29 getService(Components.interfaces.nsIIOService).
30 newChannel("http://localhost:4444/bug" + BUGID, null, null);
32 channel.QueryInterface(Components.interfaces.nsIHttpChannel);
33 channel.setRequestHeader("If-None-Match", "foobar", false);
34 channel.asyncOpen(new TestListener(), null);
36 do_test_pending();
39 // PATH HANDLER FOR /bug331825
40 function bug331825(metadata, response) {
41 response.setStatusLine(metadata.httpVersion, 304, "Not Modified");