summaryrefslogtreecommitdiffstats
path: root/parser/htmlparser/tests/mochitest/file_async_bug1104732.sjs
blob: b2ea43fddaf5fa66e4d50c6101850e277d62200e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var timer = null;

function handleRequest(request, response)
{
  response.processAsync();
  response.setHeader("Content-Type", "application/javascript", false);
  response.write("asyncState = 'mid-async';\n");

  timer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer);
  timer.initWithCallback(function() {
    response.write("asyncState = 'loaded';\n");
    response.finish();
  }, 5 * 1000 /* milliseconds */, timer.TYPE_ONE_SHOT);
}