summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/sync_xhr_unload.sjs
blob: f4f92649a88e39b859e5282d631452396ed48744 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var timer = null;

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