fune/browser/base/content/test/urlbar/slow-page.sjs
Andrew McCreight b7bb86d0d4 Bug 1436184 - Remove definitions of Ci, Cr, Cc, and Cu from httpd.js and .sjs files. r=florian
MozReview-Commit-ID: IKKb9zr2OSf

--HG--
extra : rebase_source : 72d949405c18e6d421422e7865182352eee0c407
2018-02-06 15:03:13 -08:00

19 lines
596 B
JavaScript

"use strict";
let timer;
const DELAY_MS = 5000;
function handleRequest(request, response) {
if (request.queryString.endsWith("faster")) {
response.setHeader("Content-Type", "text/html", false);
response.write("<body>Not so slow!</body>");
return;
}
response.processAsync();
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.init(() => {
response.setHeader("Content-Type", "text/html", false);
response.write("<body>This was the slow load. You should never see this.</body>");
response.finish();
}, DELAY_MS, Ci.nsITimer.TYPE_ONE_SHOT);
}