gecko/content/base/test/file_XHR_timeout.sjs
Alex Vincent accde6c016 Implement XMLHttpRequest.timeout support. Bug 525816, r=smaug, sr=sicking.
--HG--
extra : rebase_source : f8ec0171cab2d0fbcc1975c5e455162ebbeb2690
2012-01-26 11:02:22 +01:00

16 lines
489 B
JavaScript

var timer = null;
function handleRequest(request, response)
{
response.processAsync();
timer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
timer.initWithCallback(function()
{
response.setStatusLine(null, 200, "OK");
response.setHeader("Content-Type", "text/plain", false);
response.write("hello");
response.finish();
}, 3000 /* milliseconds */, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
}