gecko/netwerk/test/unit/test_cacheflags.js

268 lines
8.8 KiB
JavaScript
Raw Normal View History

bug 482085 - fix all xpcshell tests to not reference files from the srcdir. r=bsmedberg,waldo --HG-- rename : toolkit/components/downloads/test/downloads.empty.sqlite => browser/components/privatebrowsing/test/unit/downloads.empty.sqlite rename : dom/src/json/test/fail1.json => dom/src/json/test/unit/fail1.json rename : dom/src/json/test/fail10.json => dom/src/json/test/unit/fail10.json rename : dom/src/json/test/fail11.json => dom/src/json/test/unit/fail11.json rename : dom/src/json/test/fail12.json => dom/src/json/test/unit/fail12.json rename : dom/src/json/test/fail13.json => dom/src/json/test/unit/fail13.json rename : dom/src/json/test/fail14.json => dom/src/json/test/unit/fail14.json rename : dom/src/json/test/fail15.json => dom/src/json/test/unit/fail15.json rename : dom/src/json/test/fail16.json => dom/src/json/test/unit/fail16.json rename : dom/src/json/test/fail17.json => dom/src/json/test/unit/fail17.json rename : dom/src/json/test/fail18.json => dom/src/json/test/unit/fail18.json rename : dom/src/json/test/fail19.json => dom/src/json/test/unit/fail19.json rename : dom/src/json/test/fail2.json => dom/src/json/test/unit/fail2.json rename : dom/src/json/test/fail20.json => dom/src/json/test/unit/fail20.json rename : dom/src/json/test/fail21.json => dom/src/json/test/unit/fail21.json rename : dom/src/json/test/fail22.json => dom/src/json/test/unit/fail22.json rename : dom/src/json/test/fail23.json => dom/src/json/test/unit/fail23.json rename : dom/src/json/test/fail24.json => dom/src/json/test/unit/fail24.json rename : dom/src/json/test/fail25.json => dom/src/json/test/unit/fail25.json rename : dom/src/json/test/fail26.json => dom/src/json/test/unit/fail26.json rename : dom/src/json/test/fail27.json => dom/src/json/test/unit/fail27.json rename : dom/src/json/test/fail28.json => dom/src/json/test/unit/fail28.json rename : dom/src/json/test/fail29.json => dom/src/json/test/unit/fail29.json rename : dom/src/json/test/fail3.json => dom/src/json/test/unit/fail3.json rename : dom/src/json/test/fail30.json => dom/src/json/test/unit/fail30.json rename : dom/src/json/test/fail31.json => dom/src/json/test/unit/fail31.json rename : dom/src/json/test/fail32.json => dom/src/json/test/unit/fail32.json rename : dom/src/json/test/fail33.json => dom/src/json/test/unit/fail33.json rename : dom/src/json/test/fail34.json => dom/src/json/test/unit/fail34.json rename : dom/src/json/test/fail4.json => dom/src/json/test/unit/fail4.json rename : dom/src/json/test/fail5.json => dom/src/json/test/unit/fail5.json rename : dom/src/json/test/fail6.json => dom/src/json/test/unit/fail6.json rename : dom/src/json/test/fail7.json => dom/src/json/test/unit/fail7.json rename : dom/src/json/test/fail8.json => dom/src/json/test/unit/fail8.json rename : dom/src/json/test/fail9.json => dom/src/json/test/unit/fail9.json rename : dom/src/json/test/json2.js => dom/src/json/test/unit/json2.js rename : dom/src/json/test/pass1.json => dom/src/json/test/unit/pass1.json rename : dom/src/json/test/pass3.json => dom/src/json/test/unit/pass3.json rename : testing/xpcshell/example/location_load.js => testing/xpcshell/example/unit/location_load.js rename : toolkit/components/commandlines/test/unit/unix/test_bug410156.js => toolkit/components/commandlines/test/unit_unix/test_bug410156.js rename : toolkit/components/commandlines/test/unit/win/test_bug410156.js => toolkit/components/commandlines/test/unit_win/test_bug410156.js rename : toolkit/mozapps/extensions/test/unit/addons/test_bug257155/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug257155/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_a_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_a_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_a_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_a_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_b_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_b_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_b_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_b_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_c_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_c_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_c_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_c_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_d_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_d_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_d_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_d_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_e_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_e_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_e_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_e_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_f_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_f_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_f_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_f_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_g_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_g_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug299716_g_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug299716_g_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_3/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_3/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_4/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_4/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_5/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_5/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_6/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_6/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_7/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_7/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_8/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_8/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug324121_9/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug324121_9/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug335238_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug335238_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug335238_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug335238_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_10/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_10/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_11/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_11/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_12/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_12/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_13/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_13/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_3/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_3/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_4/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_4/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_5/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_5/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_6/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_6/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_7/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_7/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_8/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_8/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug378216_9/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug378216_9/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug394300_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug394300_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug394300_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug394300_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_a_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_a_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_a_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_a_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_b_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_b_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_b_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_b_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_c_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_c_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_c_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_c_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_d_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_d_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug396129_d_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug396129_d_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug397778/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug397778/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug425657/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug425657/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_1/README => toolkit/mozapps/extensions/test/addons/test_bug428341_1/README rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_3/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_3/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_4/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_4/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_5/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_5/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_6/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_6/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_7/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_7/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_8/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_8/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug428341_9/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug428341_9/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug436207/install.js => toolkit/mozapps/extensions/test/addons/test_bug436207/install.js rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_1/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_1/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_2/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_2/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_3/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_3/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_4/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_4/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_5/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_5/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_6/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_6/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_7/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_7/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_8/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_8/install.rdf rename : toolkit/mozapps/extensions/test/unit/addons/test_bug463819_9/install.rdf => toolkit/mozapps/extensions/test/addons/test_bug463819_9/install.rdf
2009-03-21 08:20:00 -07:00
do_load_httpd_js();
var httpserver = null;
// Need to randomize, because apparently no one clears our cache
var suffix = Math.random();
var httpBase = "http://localhost:4444";
var httpsBase = "http://localhost:4445";
var shortexpPath = "/shortexp" + suffix;
var longexpPath = "/longexp" + suffix;
var nocachePath = "/nocache" + suffix;
var nostorePath = "/nostore" + suffix;
function make_channel(url, flags) {
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var req = ios.newChannel(url, null, null);
req.loadFlags = flags;
return req;
}
function Test(path, flags, expectSuccess, readFromCache, hitServer) {
this.path = path;
this.flags = flags;
this.expectSuccess = expectSuccess;
this.readFromCache = readFromCache;
this.hitServer = hitServer;
}
Test.prototype = {
flags: 0,
expectSuccess: true,
readFromCache: false,
hitServer: true,
_buffer: "",
_isFromCache: false,
QueryInterface: function(iid) {
if (iid.equals(Components.interfaces.nsIStreamListener) ||
iid.equals(Components.interfaces.nsIRequestObserver) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
onStartRequest: function(request, context) {
var cachingChannel = request.QueryInterface(Ci.nsICachingChannel);
this._isFromCache = request.isPending() && cachingChannel.isFromCache();
},
onDataAvailable: function(request, context, stream, offset, count) {
this._buffer = this._buffer.concat(read_stream(stream, count));
},
onStopRequest: function(request, context, status) {
do_check_eq(Components.isSuccessCode(status), this.expectSuccess);
do_check_eq(this._isFromCache, this.readFromCache);
do_check_eq(gHitServer, this.hitServer);
do_timeout(0, run_next_test);
},
run: function() {
dump("Running:" +
"\n " + this.path +
"\n " + this.flags +
"\n " + this.expectSuccess +
"\n " + this.readFromCache +
"\n " + this.hitServer + "\n");
gHitServer = false;
var channel = make_channel(this.path, this.flags);
channel.asyncOpen(this, null);
}
};
var gHitServer = false;
var gTests = [
new Test(httpBase + shortexpPath, 0,
true, // expect success
false, // read from cache
true), // hit server
new Test(httpBase + shortexpPath, 0,
true, // expect success
true, // read from cache
true), // hit server
new Test(httpBase + shortexpPath, Ci.nsIRequest.LOAD_BYPASS_CACHE,
true, // expect success
false, // read from cache
true), // hit server
new Test(httpBase + shortexpPath, Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE,
false, // expect success
false, // read from cache
false), // hit server
new Test(httpBase + shortexpPath,
Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE |
Ci.nsIRequest.VALIDATE_NEVER,
true, // expect success
true, // read from cache
false), // hit server
new Test(httpBase + shortexpPath, Ci.nsIRequest.LOAD_FROM_CACHE,
true, // expect success
true, // read from cache
false), // hit server
new Test(httpBase + longexpPath, 0,
true, // expect success
false, // read from cache
true), // hit server
new Test(httpBase + longexpPath, 0,
true, // expect success
true, // read from cache
false), // hit server
new Test(httpBase + longexpPath, Ci.nsIRequest.LOAD_BYPASS_CACHE,
true, // expect success
false, // read from cache
true), // hit server
new Test(httpBase + longexpPath,
Ci.nsIRequest.VALIDATE_ALWAYS,
true, // expect success
true, // read from cache
true), // hit server
new Test(httpBase + longexpPath, Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE,
true, // expect success
true, // read from cache
false), // hit server
new Test(httpBase + longexpPath,
Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE |
Ci.nsIRequest.VALIDATE_NEVER,
true, // expect success
true, // read from cache
false), // hit server
new Test(httpBase + longexpPath,
Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE |
Ci.nsIRequest.VALIDATE_ALWAYS,
false, // expect success
false, // read from cache
false), // hit server
new Test(httpBase + longexpPath, Ci.nsIRequest.LOAD_FROM_CACHE,
true, // expect success
true, // read from cache
false), // hit server
new Test(httpBase + nocachePath, 0,
true, // expect success
false, // read from cache
true), // hit server
new Test(httpBase + nocachePath, 0,
true, // expect success
true, // read from cache
true), // hit server
new Test(httpBase + nocachePath, Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE,
false, // expect success
false, // read from cache
false), // hit server
new Test(httpBase + nocachePath, Ci.nsIRequest.LOAD_FROM_CACHE,
true, // expect success
true, // read from cache
false), // hit server
// LOAD_ONLY_FROM_CACHE would normally fail (because no-cache forces
// a validation), but VALIDATE_NEVER should override that.
new Test(httpBase + nocachePath,
Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE |
Ci.nsIRequest.VALIDATE_NEVER,
true, // expect success
true, // read from cache
false), // hit server
// ... however, no-cache over ssl should act like no-store and force
// a validation (and therefore failure) even if VALIDATE_NEVER is
// set.
/* XXX bug 466524: We can't currently start an ssl server in xpcshell tests,
so this test is currently disabled.
new Test(httpsBase + nocachePath,
Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE |
Ci.nsIRequest.VALIDATE_NEVER,
false, // expect success
false, // read from cache
false) // hit server
*/
new Test(httpBase + nostorePath, 0,
true, // expect success
false, // read from cache
true), // hit server
new Test(httpBase + nostorePath, 0,
true, // expect success
false, // read from cache
true), // hit server
new Test(httpBase + nostorePath, Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE,
false, // expect success
false, // read from cache
false), // hit server
new Test(httpBase + nostorePath, Ci.nsIRequest.LOAD_FROM_CACHE,
true, // expect success
true, // read from cache
false), // hit server
// no-store should force the validation (and therefore failure, with
// LOAD_ONLY_FROM_CACHE) even if VALIDATE_NEVER is set.
new Test(httpBase + nostorePath,
Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE |
Ci.nsIRequest.VALIDATE_NEVER,
false, // expect success
false, // read from cache
false) // hit server
];
function run_next_test()
{
if (gTests.length == 0) {
httpserver.stop(do_test_finished);
return;
}
var test = gTests.shift();
test.run();
}
function handler(metadata, response) {
gHitServer = true;
try {
var etag = metadata.getHeader("If-None-Match");
} catch(ex) {
var etag = "";
}
if (etag == "testtag") {
// Allow using the cached data
response.setStatusLine(metadata.httpVersion, 304, "Not Modified");
} else {
response.setStatusLine(metadata.httpVersion, 200, "OK");
response.setHeader("Content-Type", "text/plain", false);
response.setHeader("ETag", "testtag", false);
const body = "data";
response.bodyOutputStream.write(body, body.length);
}
}
function nocache_handler(metadata, response) {
response.setHeader("Cache-Control", "no-cache", false);
handler(metadata, response);
}
function nostore_handler(metadata, response) {
response.setHeader("Cache-Control", "no-store", false);
handler(metadata, response);
}
function shortexp_handler(metadata, response) {
response.setHeader("Cache-Control", "max-age=0", false);
handler(metadata, response);
}
function longexp_handler(metadata, response) {
response.setHeader("Cache-Control", "max-age=10000", false);
handler(metadata, response);
}
function run_test() {
httpserver = new nsHttpServer();
httpserver.registerPathHandler(shortexpPath, shortexp_handler);
httpserver.registerPathHandler(longexpPath, longexp_handler);
httpserver.registerPathHandler(nocachePath, nocache_handler);
httpserver.registerPathHandler(nostorePath, nostore_handler);
httpserver.start(4444);
run_next_test();
do_test_pending();
}