summaryrefslogtreecommitdiffstats
path: root/parser/htmlparser/tests/mochitest/file_bug102699.sjs
blob: 6e7c57cae4b9a00df564ec6f0911624c6b77d6ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function handleRequest(request, response) {
  response.setHeader("Content-Type", "text/javascript", false);
  if (request.queryString.includes("report")) {
    if (getState("loaded") == "loaded") {
      response.write(
        "ok(false, 'This script was not supposed to get fetched.'); continueAfterReport();"
      );
    } else {
      response.write(
        "ok(true, 'This script was not supposed to get fetched.'); continueAfterReport();"
      );
    }
  } else {
    setState("loaded", "loaded");
    response.write(
      'document.documentElement.setAttribute("data-fail", "FAIL");'
    );
  }
}