fune/browser/base/content/test/tabs/wait-a-bit.sjs
Mark Banner 82ae63cedb Bug 1897770 - Improve .sjs file environment definitions in ESLint. r=frontend-codestyle-reviewers,extension-reviewers,Gijs
This stops sjs files from picking up the test environments/configurations which means they get just the sjs environment
which is what we want.

Differential Revision: https://phabricator.services.mozilla.com/D210928
2024-05-20 13:49:44 +00:00

22 lines
622 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { setTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
async function handleRequest(request, response) {
response.seizePower();
await new Promise(r => setTimeout(r, 2000));
response.write("HTTP/1.1 200 OK\r\n");
const body = "<title>wait a bit</title><body>ok</body>";
response.write("Content-Type: text/html\r\n");
response.write(`Content-Length: ${body.length}\r\n`);
response.write("\r\n");
response.write(body);
response.finish();
}