1 do_import_script("netwerk/test/httpserver/httpd.js");
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);
20 server
= new nsHttpServer();
22 server
.registerPathHandler("/bug" + BUGID
, bug331825
);
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);
39 // PATH HANDLER FOR /bug331825
40 function bug331825(metadata
, response
) {
41 response
.setStatusLine(metadata
.httpVersion
, 304, "Not Modified");