summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/file_XHR_timeout.sjs
blob: b349d122ec5cc78fffdab41d30f348d071be088f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
}