summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/fetch/slow.sjs
blob: 27b9719b71d5c3587619605ce3cfb5521f354c84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function handleRequest(request, response) {
  response.processAsync();

  timer = Components.classes["@mozilla.org/timer;1"].createInstance(
    Components.interfaces.nsITimer
  );
  timer.init(
    function () {
      response.write("Here the content. But slowly.");
      response.finish();
    },
    1000,
    Components.interfaces.nsITimer.TYPE_ONE_SHOT
  );
}