summaryrefslogtreecommitdiffstats
path: root/toolkit/components/cookiebanners/test/browser/slowSubresource.sjs
blob: 1f14c2e9cf42ad3936acaa067f9af8b36a132db7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"use strict";

let timer;

const DELAY_MS = 5000;
function handleRequest(request, response) {
  response.processAsync();
  timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
  timer.init(
    () => {
      response.setHeader("Content-Type", "text/css ", false);
      response.write("body { background-color: red; }");
      response.finish();
    },
    DELAY_MS,
    Ci.nsITimer.TYPE_ONE_SHOT
  );
}